1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
9 // Copyright: (c) AUTHOR
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
17 #pragma interface "checklst.h"
20 #if !defined(__MWERKS__) && !defined(__UNIX__)
21 typedef unsigned int size_t;
24 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
26 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
29 wxCheckListBox() { Init(); }
30 wxCheckListBox(wxWindow
*parent
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
35 const wxString
*choices
= NULL
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxListBoxNameStr
)
42 Create(parent
, id
, pos
, size
, nStrings
, choices
, style
, validator
, name
);
45 bool Create(wxWindow
*parent
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
50 const wxString
*choices
= NULL
,
52 const wxValidator
& validator
= wxDefaultValidator
,
53 const wxString
& name
= wxListBoxNameStr
);
55 // items may be checked
56 bool IsChecked(size_t uiIndex
) const;
57 void Check(size_t uiIndex
, bool bCheck
= TRUE
);
58 void OnChar(wxKeyEvent
& event
) ;
59 void OnLeftClick(wxMouseEvent
& event
) ;
62 wxInt32 m_checkBoxWidth
;
63 wxInt32 m_checkBoxHeight
;
64 wxInt32 m_TextBaseLineOffset
;
66 // the array containing the checked status of the items
69 // override all methods which add/delete items to update m_checks array as
71 virtual void Delete(int n
);
73 virtual int DoAppend(const wxString
& item
);
74 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
75 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
76 virtual void DoClear();
77 // common part of all ctors