Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Combo box with icons, hierarchy
Combo box with icons, hierarchy [message #452602] Wed, 23 March 2005 01:44 Go to next message
Eclipse UserFriend
Originally posted by: freddie_nurke.hotmail.com

Hi everyone,

I'm creating a combo box that has a Table rather than a List in its
dropdown Shell. I'm doing this for two reasons: I want to add icons to
the combo, and I want to show hierarchy. My dropdown contents should
look like this:

* Parent 1
# Child 1.1
# Child 1.2
# Child 1.3
& Parent 2
+ Child 2.1
+ Child 2.2

where random punctuation represents icons.

I'd like some advice on the best way to attack this problem to effect as
much code reuse as possible. I can't really extend
org.eclipse.swt.widgets.Combo because the underlying data representation
is different -- it's now more than just a list of strings. In MFC I'd
intercept the AboutToDropDown notification and draw my own control below
the combo, but I don't know if I can do that in SWT. I expect,
eventually, to use this control in a JFace Viewer with a label provider
and all that good stuff.

Any suggestions or existing examples would be much appreciated.

Thanks,

Fred.
Re: Combo box with icons, hierarchy [message #453025 is a reply to message #452602] Wed, 30 March 2005 00:40 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
You'll have to build your Combo from scratch, like CCombo except using a
Table instead of a List. Check the source.

"Fred Nurke" <freddie_nurke@hotmail.com> wrote in message
news:d1qmed$iqo$1@news.eclipse.org...
> Hi everyone,
>
> I'm creating a combo box that has a Table rather than a List in its
> dropdown Shell. I'm doing this for two reasons: I want to add icons to
> the combo, and I want to show hierarchy. My dropdown contents should
> look like this:
>
> * Parent 1
> # Child 1.1
> # Child 1.2
> # Child 1.3
> & Parent 2
> + Child 2.1
> + Child 2.2
>
> where random punctuation represents icons.
>
> I'd like some advice on the best way to attack this problem to effect as
> much code reuse as possible. I can't really extend
> org.eclipse.swt.widgets.Combo because the underlying data representation
> is different -- it's now more than just a list of strings. In MFC I'd
> intercept the AboutToDropDown notification and draw my own control below
> the combo, but I don't know if I can do that in SWT. I expect,
> eventually, to use this control in a JFace Viewer with a label provider
> and all that good stuff.
>
> Any suggestions or existing examples would be much appreciated.
>
> Thanks,
>
> Fred.
Previous Topic:Table and Scrollbars
Next Topic:Image on a button
Goto Forum:
  


Current Time: Tue Oct 22 09:25:32 GMT 2019

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

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

Back to the top