Center vertical text on a clabel [message #479893] |
Wed, 12 August 2009 22:44 |
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 16:55 |
Grant Gayed Messages: 2150 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
|
|
|
Powered by
FUDForum. Page generated in 0.02587 seconds