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
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CHECKLST_H_
13 #define _WX_CHECKLST_H_
19 class wxOwnerDrawn
; // so the compiler knows, it is a class.
21 class WXDLLIMPEXP_CORE wxCheckListBox
: public wxCheckListBoxBase
28 wxCheckListBox( wxWindow
* pParent
30 ,const wxPoint
& rPos
= wxDefaultPosition
31 ,const wxSize
& vSize
= wxDefaultSize
33 ,const wxString asChoices
[] = NULL
35 ,const wxValidator
& rValidator
= wxDefaultValidator
36 ,const wxString
& rsName
= wxListBoxNameStr
38 wxCheckListBox( wxWindow
* pParent
42 ,const wxArrayString
& asChoices
44 ,const wxValidator
& rValidator
= wxDefaultValidator
45 ,const wxString
& rsName
= wxListBoxNameStr
49 // Override base class virtuals
51 virtual void Delete(unsigned int n
);
53 virtual bool SetFont(const wxFont
&rFont
);
56 // Items may be checked
58 bool IsChecked(unsigned int uiIndex
) const;
59 void Check(unsigned int uiIndex
, bool bCheck
= true);
64 size_t GetItemHeight(void) const { return m_nItemHeight
; }
68 // We create our items ourselves and they have non-standard size,
69 // so we need to override these functions
71 virtual wxOwnerDrawn
* CreateItem(size_t n
);
72 virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT
* pItem
);
75 // Pressing space or clicking the check box toggles the item
77 void OnChar(wxKeyEvent
& rEvent
);
78 void OnLeftClick(wxMouseEvent
& rEvent
);
81 size_t m_nItemHeight
; // height of checklistbox items (the same for all)
83 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
85 }; // end of CLASS wxCheckListBox