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 WXDLLIMPEXP_CORE 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
);
88 // override all methods which add/delete items to update m_checks array as
90 virtual void OnItemInserted(unsigned int pos
);
91 virtual void DoDeleteOneItem(unsigned int n
);
92 virtual void DoClear();
94 // draw the check items instead of the usual ones
95 virtual void DoDrawRange(wxControlRenderer
*renderer
,
96 int itemFirst
, int itemLast
);
98 // take them also into account for size calculation
99 virtual wxSize
DoGetBestClientSize() const;
101 // common part of all ctors
105 // the array containing the checked status of the items
108 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
111 #endif // _WX_UNIV_CHECKLST_H_