1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/checklst.h
3 // Purpose: wxCheckListBox class for wxUniversal
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIV_CHECKLST_H_
13 #define _WX_UNIV_CHECKLST_H_
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #define wxACTION_CHECKLISTBOX_TOGGLE _T("toggle")
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
29 wxCheckListBox() { Init(); }
31 wxCheckListBox(wxWindow
*parent
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
36 const wxString choices
[] = NULL
,
38 const wxValidator
& validator
= wxDefaultValidator
,
39 const wxString
& name
= wxListBoxNameStr
)
43 Create(parent
, id
, pos
, size
, nStrings
, choices
, style
, validator
, name
);
45 wxCheckListBox(wxWindow
*parent
,
49 const wxArrayString
& choices
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxListBoxNameStr
);
54 bool Create(wxWindow
*parent
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
59 const wxString choices
[] = (const wxString
*) NULL
,
61 const wxValidator
& validator
= wxDefaultValidator
,
62 const wxString
& name
= wxListBoxNameStr
);
63 bool Create(wxWindow
*parent
,
67 const wxArrayString
& choices
,
69 const wxValidator
& validator
= wxDefaultValidator
,
70 const wxString
& name
= wxListBoxNameStr
);
72 // implement check list box methods
73 virtual bool IsChecked(unsigned int item
) const;
74 virtual void Check(unsigned int item
, bool check
= true);
77 virtual bool PerformAction(const wxControlAction
& action
,
79 const wxString
& strArg
= wxEmptyString
);
81 static wxInputHandler
*GetStdInputHandler(wxInputHandler
*handlerDef
);
82 virtual wxInputHandler
*DoGetStdInputHandler(wxInputHandler
*handlerDef
)
84 return GetStdInputHandler(handlerDef
);
87 // override all methods which add/delete items to update m_checks array as
89 virtual void Delete(unsigned int n
);
92 virtual int DoAppend(const wxString
& item
);
93 virtual void DoInsertItems(const wxArrayString
& items
, unsigned int pos
);
94 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
95 virtual void DoClear();
97 // draw the check items instead of the usual ones
98 virtual void DoDrawRange(wxControlRenderer
*renderer
,
99 int itemFirst
, int itemLast
);
101 // take them also into account for size calculation
102 virtual wxSize
DoGetBestClientSize() const;
104 // common part of all ctors
108 // the array containing the checked status of the items
111 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
114 #endif // _WX_UNIV_CHECKLST_H_