Text-Style Underline in SWT [message #371981] |
Fri, 25 July 2003 10:34 |
Eclipse User |
|
|
|
Originally posted by: benjamin.pasero.pixelpark.com
Hello,
I wonder why there are only SWT.NORMAL, SWT.BOLD and SWT.ITALIC
supportet by SWT. I need an underline for displaying a link in a Label.
Eclipse draws an underline, so how is it done :-) ?
thx 4 help,
Ben
|
|
|
|
Re: Text-Style Underline in SWT [message #371986 is a reply to message #371983] |
Fri, 25 July 2003 13:53 |
Eclipse User |
|
|
|
Originally posted by: benjamin.pasero.pixelpark.com
Hi,
thanks for the tip, I used StyledText before in another context, but I don't
find any possibility to underline a text :-(.
In API I found:
"A StyledText is an editable user interface object that displays lines of
text. The following style attributes can be defined for the text:
- font style (bold, regular)
- ...
"
Ben
Ralf Koban schrieb:
> Hi Benjamin,
>
> use StyledText.
>
> Ralf
>
> Benjamin Pasero schrieb:
> > Hello,
> > I wonder why there are only SWT.NORMAL, SWT.BOLD and SWT.ITALIC
> > supportet by SWT. I need an underline for displaying a link in a Label.
> > Eclipse draws an underline, so how is it done :-) ?
> > thx 4 help,
> > Ben
> >
|
|
|
|
Re: Text-Style Underline in SWT [message #371989 is a reply to message #371986] |
Fri, 25 July 2003 14:42 |
Ralf Koban Messages: 319 Registered: July 2009 |
Senior Member |
|
|
Hi Benjamin,
maybe that can help you a little bit:
<eclipse-root-src>/plugins/org.eclipse.ui.workbench/Eclipse
UI/org/eclipse/ui/internal/dialogs/AboutDialog.java
Ralf
Benjamin Pasero schrieb:
> Hi,
> thanks for the tip, I used StyledText before in another context, but I don't
> find any possibility to underline a text :-(.
> In API I found:
>
> "A StyledText is an editable user interface object that displays lines of
> text. The following style attributes can be defined for the text:
> - font style (bold, regular)
> - ...
> "
>
> Ben
>
> Ralf Koban schrieb:
>
>
>>Hi Benjamin,
>>
>>use StyledText.
>>
>>Ralf
>>
>>Benjamin Pasero schrieb:
>>
>>>Hello,
>>>I wonder why there are only SWT.NORMAL, SWT.BOLD and SWT.ITALIC
>>>supportet by SWT. I need an underline for displaying a link in a Label.
>>>Eclipse draws an underline, so how is it done :-) ?
>>>thx 4 help,
>>>Ben
>>>
>
>
|
|
|
Re: Text-Style Underline in SWT [message #371991 is a reply to message #371986] |
Fri, 25 July 2003 14:44 |
Eclipse User |
|
|
|
Originally posted by: tech_le_lourd.NOSPAM.yahoo.fr
Benjamin Pasero wrote:
> Hi,
> thanks for the tip, I used StyledText before in another context, but I don't
> find any possibility to underline a text :-(.
> In API I found:
> "A StyledText is an editable user interface object that displays lines of
> text. The following style attributes can be defined for the text:
> - font style (bold, regular)
> - ...
> "
Actually, you can specify a font using the setFont() method of StyledText.
There, you can undeline your text. Please refer to the SWT examples, in
the Custom Control example. You will see whait I mean :)
|
|
|
Re: Text-Style Underline in SWT [message #371999 is a reply to message #371991] |
Fri, 25 July 2003 19:37 |
Eclipse User |
|
|
|
Originally posted by: benjamin.pasero.pixelpark.com
Jesus, this took me a while. Didn't expect it to be so complicated,
because I never thought of an OS-dependance when dealing with underline.
Thx all for the help :-).
My Solution (Windows only):
Font systemFont = display.getSystemFont();
FontData winFontData = systemFont.getFontData()[0];
LOGFONT b = winFontData.data;
b.lfUnderline = 0x4; //Set the byte to display the underline
hope that helps some other peoples with the same prob to save some hours
;-)
|
|
|
Powered by
FUDForum. Page generated in 0.04197 seconds