Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Color Combobox - how to do ?
Color Combobox - how to do ? [message #453879] Wed, 13 April 2005 16:14 Go to next message
Holger is currently offline HolgerFriend
Messages: 6
Registered: July 2009
Junior Member
I spent ages for finding out how to create a combobox that can be used to
show colors instead of text (strings).

As far as I found out as beginner there is no way to subclass Combo or
CCombo in order to draw the list field (in that case different colors as
background for every item)
And I couldn't find a way to set an own List-derived class to CCombo.
I cant imagine that he only way should be to create a custom control
instead of accessing the list-values or set an own list class.

Any suggestions ?

Thanks

Holger
Re: Color Combobox - how to do ? [message #453940 is a reply to message #453879] Thu, 14 April 2005 13:09 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Holger,

Combo and CCombo won't do these, so you will need your own component.
CCombo provides a good starting point, just change its popup List to a Table
that has no lines or header.

As a side note, color selection in eclipse (for example in the preference
pages) is usually exposed through a button with the color on it, so that
pressing it will bring up the ColorDialog which allows for selection of any
available color. This alternative strategy may or may not be appropriate in
your context.

Grant

"Holger" <tballmann@gmx.de> wrote in message
news:675aece9a62eeb8c6e9726e83f6f0a12$1@www.eclipse.org...
> I spent ages for finding out how to create a combobox that can be used to
> show colors instead of text (strings).
>
> As far as I found out as beginner there is no way to subclass Combo or
> CCombo in order to draw the list field (in that case different colors as
> background for every item)
> And I couldn't find a way to set an own List-derived class to CCombo.
> I cant imagine that he only way should be to create a custom control
> instead of accessing the list-values or set an own list class.
>
> Any suggestions ?
>
> Thanks
>
> Holger
>
Previous Topic:event between the display and the system.
Next Topic:height/size of TableViewer within WizardDialog
Goto Forum:
  


Current Time: Tue Apr 16 04:11:25 GMT 2024

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

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

Back to the top