1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/checklst.h
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
5 // Author: David Webster
9 // Copyright: (c) David Webster
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
20 class wxOwnerDrawn
; // so the compiler knows, it is a class.
22 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
29 wxCheckListBox( wxWindow
* pParent
31 ,const wxPoint
& rPos
= wxDefaultPosition
32 ,const wxSize
& vSize
= wxDefaultSize
34 ,const wxString asChoices
[] = NULL
36 ,const wxValidator
& rValidator
= wxDefaultValidator
37 ,const wxString
& rsName
= wxListBoxNameStr
39 wxCheckListBox( wxWindow
* pParent
43 ,const wxArrayString
& asChoices
45 ,const wxValidator
& rValidator
= wxDefaultValidator
46 ,const wxString
& rsName
= wxListBoxNameStr
50 // Override base class virtuals
52 virtual void Delete(int n
);
54 virtual bool SetFont(const wxFont
&rFont
);
57 // Items may be checked
59 bool IsChecked(size_t uiIndex
) const;
60 void Check( size_t uiIndex
67 size_t GetItemHeight(void) const { return m_nItemHeight
; }
71 // We create our items ourselves and they have non-standard size,
72 // so we need to override these functions
74 virtual wxOwnerDrawn
* CreateItem(size_t n
);
75 virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT
* pItem
);
77 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
80 // Pressing space or clicking the check box toggles the item
82 void OnChar(wxKeyEvent
& rEvent
);
83 void OnLeftClick(wxMouseEvent
& rEvent
);
86 size_t m_nItemHeight
; // height of checklistbox items (the same for all)
88 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
90 }; // end of CLASS wxCheckListBox