- inline bool IsOwnerDrawn() const { return m_bOwnerDrawn; }
- inline void ResetOwnerDrawn() { m_bOwnerDrawn = FALSE; }
-
-public:
- // constants used in OnDrawItem
- // (they have the same values as corresponding Win32 constants)
- enum wxODAction
- {
- wxODDrawAll = 0x0001, // redraw entire control
- wxODSelectChanged = 0x0002, // selection changed (see Status.Select)
- wxODFocusChanged = 0x0004, // keyboard focus changed (see Status.Focus)
- };
-
- enum wxODStatus
- {
- wxODSelected = 0x0001, // control is currently selected
- wxODGrayed = 0x0002, // item is to be grayed
- wxODDisabled = 0x0004, // item is to be drawn as disabled
- wxODChecked = 0x0008, // item is to be checked
- wxODHasFocus = 0x0010, // item has the keyboard focus
- wxODDefault = 0x0020, // item is the default item
- };
-
- // virtual functions to implement drawing (return TRUE if processed)
- virtual bool OnMeasureItem(uint *pwidth, uint *pheight);
- virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat);
+ bool IsOwnerDrawn() const
+ { return m_ownerDrawn; }
+
+ // switch on/off owner-drawing the item
+ void SetOwnerDrawn(bool ownerDrawn = true)
+ { m_ownerDrawn = ownerDrawn; }
+
+
+ // constants used in OnDrawItem
+ // (they have the same values as corresponding Win32 constants)
+ enum wxODAction
+ {
+ wxODDrawAll = 0x0001, // redraw entire control
+ wxODSelectChanged = 0x0002, // selection changed (see Status.Select)
+ wxODFocusChanged = 0x0004 // keyboard focus changed (see Status.Focus)
+ };
+
+ enum wxODStatus
+ {
+ wxODSelected = 0x0001, // control is currently selected
+ wxODGrayed = 0x0002, // item is to be grayed
+ wxODDisabled = 0x0004, // item is to be drawn as disabled
+ wxODChecked = 0x0008, // item is to be checked
+ wxODHasFocus = 0x0010, // item has the keyboard focus
+ wxODDefault = 0x0020, // item is the default item
+ wxODHidePrefix= 0x0100 // hide keyboard cues (w2k and xp only)
+ };
+
+ // virtual functions to implement drawing (return true if processed)
+ virtual bool OnMeasureItem(size_t *width, size_t *height);
+ virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat) = 0;