Combo box with icons, hierarchy [message #452602] |
Tue, 22 March 2005 20:44  |
Eclipse User |
|
|
|
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] |
Tue, 29 March 2005 19:40  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.05210 seconds