// the wxComboCtrl.
// ----------------------------------------------------------------------------
-class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox : public wxComboCtrl,
- public wxItemContainer
+class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox :
+ public wxWindowWithItems<wxComboCtrl, wxItemContainer>
{
//friend class wxComboPopupWindow;
friend class wxVListBoxComboPopup;
public:
// ctors and such
- wxOwnerDrawnComboBox() : wxComboCtrl() { Init(); }
+ wxOwnerDrawnComboBox() { Init(); }
wxOwnerDrawnComboBox(wxWindow *parent,
wxWindowID id,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
- : wxComboCtrl()
{
Init();
virtual bool IsSorted() const { return HasFlag(wxCB_SORT); }
- wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
-
protected:
virtual void DoClear();
virtual void DoDeleteOneItem(unsigned int n);
// Callback for item width, or -1 for default/undetermined
virtual wxCoord OnMeasureItemWidth( size_t item ) const;
+ // override base implementation so we can return the size for the
+ // largest item
+ virtual wxSize DoGetBestSize() const;
+
// Callback for background drawing. Flags are same as with
// OnDrawItem.
virtual void OnDrawBackground( wxDC& dc, const wxRect& rect, int item, int flags ) const;