Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Font and text color
Font and text color [message #450495] Mon, 14 February 2005 12:54 Go to next message
Arnaud is currently offline ArnaudFriend
Messages: 60
Registered: July 2009
Member
Hi !

I use a custom propertydescriptor in my rcp app which let me change the
font of a button or label. It pops up a FontDialog where I can choose
which font I want. It works great except that only the type, height and
style are taken in account. The color of the text is not applied (you
know, in Windows XP font dialog, you can pick up a color for the text).
And if I reopen the Font dialog, the color I choosed later isn't
remembered, it always go back to black.

How can you make use of the color selected in the font dialog ?

TIA

--
Arnaud

PS : another question : whith labels I can choose back/foreground, but
whith buttons it doesn't seem to be taken in account (for example, the
background doesn't paint to yellow if I choose this color in my Color
dialog). Is it a normal behaviour of SWT.Button ?
Re: Font and text color [message #450501 is a reply to message #450495] Mon, 14 February 2005 16:08 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
You need to use FontDialog.getRGB() and FontDialog.setRGB(RGB) since colour
is not included within a Font or FontData.

Setting the background Color of a Button does not work on win32 due to a
platform limitation, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=36055
..

Grant

"Arnaud" <no@mail.please> wrote in message
news:cuq71e$pht$1@www.eclipse.org...
> Hi !
>
> I use a custom propertydescriptor in my rcp app which let me change the
> font of a button or label. It pops up a FontDialog where I can choose
> which font I want. It works great except that only the type, height and
> style are taken in account. The color of the text is not applied (you
> know, in Windows XP font dialog, you can pick up a color for the text).
> And if I reopen the Font dialog, the color I choosed later isn't
> remembered, it always go back to black.
>
> How can you make use of the color selected in the font dialog ?
>
> TIA
>
> --
> Arnaud
>
> PS : another question : whith labels I can choose back/foreground, but
> whith buttons it doesn't seem to be taken in account (for example, the
> background doesn't paint to yellow if I choose this color in my Color
> dialog). Is it a normal behaviour of SWT.Button ?
Re: Font and text color [message #450530 is a reply to message #450501] Tue, 15 February 2005 08:07 Go to previous message
Arnaud is currently offline ArnaudFriend
Messages: 60
Registered: July 2009
Member
Thanks for info !

--
Arnaud
Previous Topic:Adding a ProgressBar in a Table
Next Topic:DSOFramer ActiveX and SWT - SWTOleSample.java (0/1)
Goto Forum:
  


Current Time: Thu Sep 19 13:11:58 GMT 2024

Powered by FUDForum. Page generated in 0.04568 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top