[wx-dev] wxImageComboBox API

Alex Bligh alex at alex.org.uk
Tue Sep 5 02:05:13 PDT 2006



--On 04 September 2006 21:38 +0200 Vadim Zeitlin <vadim at wxwindows.org> 
wrote:

>  Specifying bitmaps is more convenient. OTOH wxImageList is used in other
> wx classes (wxList/TreeCtrl, wxNotebook, possibly others) and so people
> shouldn't be very upset by having to use it, at least nobody really
> complained much about it so far.

OK. Here is the first complaint: you can't have icons of different sizes.
Even horizontal sizes, when the items are in a vertical list. This is
irritating if your bitmaps are dual use. I've found that annoying on
wxTreeCtrl (specifically in wxTreeBook). I think it would be good to
avoid replicating this restriction in wxImageComboBox.

Perhaps an alternative route (and I apologize for not looking at the API
before commenting - very busy on other stuff for the past 2 weeks) would
be to put in a virtual DoGetBitmap() which by default returns the bitmap
from the image list, but is can be overriden to return a specific wxBitmap
for the combo box item.

Incidentally Jakko, how are you handling the bitmap (if any) which is
displayed in actual combo box text field itself? If you look at (say) the
Xara Xtreme font menu, we have icons for true type and type 1 fonts next to
the font name. In this instance we'd want the same bitmap in (or rather
immediately to the left of) the text field). In the bitmap dropdown on
our fill tool, we actually display the bitmap there, which means it has
to be scaled (retaining aspect ratio or not). In other scenarios I can
see you might not want it displayed at all.

Alex




More information about the wx-dev mailing list