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 WXDLLIMPEXP_CORE 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(unsigned int n
);
54 virtual bool SetFont(const wxFont
&rFont
);
57 // Items may be checked
59 bool IsChecked(unsigned int uiIndex
) const;
60 void Check(unsigned int uiIndex
, bool bCheck
= true);
65 size_t GetItemHeight(void) const { return m_nItemHeight
; }
69 // We create our items ourselves and they have non-standard size,
70 // so we need to override these functions
72 virtual wxOwnerDrawn
* CreateItem(size_t n
);
73 virtual long OS2OnMeasure(WXMEASUREITEMSTRUCT
* pItem
);
76 // Pressing space or clicking the check box toggles the item
78 void OnChar(wxKeyEvent
& rEvent
);
79 void OnLeftClick(wxMouseEvent
& rEvent
);
82 size_t m_nItemHeight
; // height of checklistbox items (the same for all)
84 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
86 }; // end of CLASS wxCheckListBox