1 ///////////////////////////////////////////////////////////////////////////////
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 wxCheckListBoxItem
; // fwd decl, define in checklst.cpp
22 class WXDLLEXPORT wxCheckListBox
: public wxListBox
24 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
28 wxCheckListBox(wxWindow
*parent
, wxWindowID id
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
32 const wxString choices
[] = NULL
,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxListBoxNameStr
);
37 // override base class virtuals
38 virtual void Delete(int n
);
39 virtual void InsertItems(int nItems
, const wxString items
[], int pos
);
41 virtual bool SetFont( const wxFont
&font
);
43 // items may be checked
44 bool IsChecked(size_t uiIndex
) const;
45 void Check(size_t uiIndex
, bool bCheck
= TRUE
);
48 size_t GetItemHeight() const { return m_nItemHeight
; }
51 // we create our items ourselves and they have non-standard size,
52 // so we need to override these functions
53 virtual wxOwnerDrawn
*CreateItem(size_t n
);
54 // virtual bool OS2OnMeasure(WXMEASUREITEMSTRUCT *item);
56 // pressing space or clicking the check box toggles the item
57 void OnChar(wxKeyEvent
& event
);
58 void OnLeftClick(wxMouseEvent
& event
);
61 size_t m_nItemHeight
; // height of checklistbox items (the same for all)
63 //Virtual function hiding suppression, do not use
64 virtual wxControl
*CreateItem(const wxItemResource
* childResource
,
65 const wxItemResource
* parentResource
,
66 const wxResourceTable
*table
= (const wxResourceTable
*) NULL
)
67 { return(wxWindowBase::CreateItem(childResource
, parentResource
, table
));};