The idea of an ExtendedChoice implementation that is (hopefully) portable to all platforms supported by wxPython is interesting. Windows already have this kind of feature.
ExtendedChoice is built using 4 different controls:
A wx.StaticBitmap to handle the icons;
A wx.lib.stattext.StaticText to simulate the behavior of a wx.TextCtrl (which does not line up correctly in a sizer if you use the wx.NO_BORDER style for it);
A wx.lib.buttons.GenBitmapButton to simulate the wx.Choice/wx.ComboBox button;
A wx.Dialog (to replace a wx.PopupTransientWindow) with a wx.VListBox inside to simulate the behavior of wx.Choice/wx.ComboBox expanded choice list.
What It Can Do:
Behaves like wx.Choice or wx.ComboBox in handling Char/Key events;
- Set the whole control colour or change it in runtime;
- Set most Background/Foreground colour for choices, Background/Foreground
- Motifs/Styles, text colour and text selection colour;
- Set or change in runtime font associated to each or all the choices;
- Depending On The Class Construction (EC_RULES Style), You Can Have Borders And Customize Them;
- Sort ascending/descending the choices;
- Add or remove choices from the choice-list;
Add icons/images in runtime to the wx.ImageList associated to the control;
- Change the order in which icons and choices are associated (change icon for an already present choice);
- Replace choices with other user-defined strings/labels.
Downloads, screenshots, demo and more info can be found at:
http://xoomer.virgilio.it/infinity77/eng/freeware.html#extendedchoice
OR:
http://sigmacore.net/andrea/?page_id=2
Andrea.