Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Center vertical text on a clabel
Center vertical text on a clabel [message #479893] Wed, 12 August 2009 18:44 Go to next message
Eclipse User
Originally posted by: vicenterg.arrakis.es

Hello!.
Can anybody tell me how can i center vertical text on a CLabel?
I mean: i have a clabel using formdata/formlayout. Normally the text
centers well, but now, the clabel y a bit higher than usually and the
text lays on the upper side of a clabel.
As my english isn't very good, i ask graphically:


NORMALLY: WITH HIGH CLABEL WHAT I WANT

----------- --------------- -------------
Text------- Text----------- -------------
----------- --------------- Text---------
--------------- -------------
--------------- -------------

Thanks!!!
Re: Center vertical text on a clabel [message #481905 is a reply to message #479893] Mon, 24 August 2009 12:55 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi, sorry for the late reply,

To clarify, you are saying that when a CLabel is very tall that its text
does not show vertically-centered, right? I tried this with the snippet
below and it seems well-centered for me (I tried on win2000). How does the
snippet work for you? And if its text is centered, are you able to change
the snippet to show the bad behaviour that you are seeing?

public static void main (String [] args) {
final Display display = new Display ();
final Shell shell = new Shell (display);
shell.setBounds(10,10,250,250);
CLabel label = new CLabel(shell, SWT.BORDER);
label.setBounds(50,50,100,100);
label.setText("text");
shell.open();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch ()) display.sleep ();
}
display.dispose ();
}

Grant


"Vicente Rico Guill
Previous Topic:Difficulties scrolling a ListViewer
Next Topic:Table header menu snippet
Goto Forum:
  


Current Time: Thu Aug 21 22:16:44 EDT 2014

Powered by FUDForum. Page generated in 0.11541 seconds