| Multi Line Labels/Text Fields [message #370988] |
Mon, 16 June 2003 05:47  |
Eclipse User |
|
|
|
Originally posted by: meghani.strandgenomics.com
Hi,
How can I create multi line labels that can contain more than one line of
displayed text and automatically wrapped onto a different line if it is not
fitting within the availabel area?
Also, how can I do the same for text areas
regards
Shripal
|
|
|
|
|
|
|
| Re: Multi Line Labels/Text Fields [message #371049 is a reply to message #371022] |
Tue, 17 June 2003 10:07  |
Eclipse User |
|
|
|
Originally posted by: veronika_irvine.oti.com
If you use a GridLayout and do not specify any GridData, then the Text
widget will be given its preferred width which will be big enough to show
the whole line without wrapping. If the Text widget has no text, the
default size is one line high and a width of 64. If you want the Text
widget to wrap than you should set the GridData.widthHint for the Text
widget (same is true for Label). For the Text widget, you should also
specify a vertical scrollbar so that the user can enter more lines of text
than are visible (otherwise, you will just get a beep when you hit return in
the last visible line).
Text t = new Text(shell, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
GridData data = new GridData();
data.widthHint = 300;
data.heightHint = 100;
t.setLayoutData(data);
As far as multiple line text editors in a Tree or Table see bug 19496 - text
wrap in table cells.
"Shripal Meghani" <meghani@strandgenomics.com> wrote in message
news:bcm7i6$gno$1@rogue.oti.com...
> Do various layouts mess around with these things? Becuase I have tried
both
> of these options before posting my earlier query...
> and I did not get a proper result....
>
> Also, Is there some way of displaying multiple lines inside a TableViewer
> (say by fooling around with the CellRenderers??)
>
|
|
|
Powered by
FUDForum. Page generated in 0.03601 seconds