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(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
);
75 virtual void DoInsertItems(const wxArrayString
& items
, unsigned int pos
);
78 // Pressing space or clicking the check box toggles the item
80 void OnChar(wxKeyEvent
& rEvent
);
81 void OnLeftClick(wxMouseEvent
& rEvent
);
84 size_t m_nItemHeight
; // height of checklistbox items (the same for all)
86 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
88 }; // end of CLASS wxCheckListBox