1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/univ/checklst.h
3 // Purpose: wxCheckListBox class for wxUniversal
4 // Author: Vadim Zeitlin
7 // Copyright: (c) Vadim Zeitlin
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_UNIV_CHECKLST_H_
12 #define _WX_UNIV_CHECKLST_H_
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 #define wxACTION_CHECKLISTBOX_TOGGLE wxT("toggle")
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxCheckListBox
: public wxCheckListBoxBase
28 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
);
44 wxCheckListBox(wxWindow
*parent
,
48 const wxArrayString
& choices
,
50 const wxValidator
& validator
= wxDefaultValidator
,
51 const wxString
& name
= wxListBoxNameStr
);
53 bool Create(wxWindow
*parent
,
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
58 const wxString choices
[] = (const wxString
*) NULL
,
60 const wxValidator
& validator
= wxDefaultValidator
,
61 const wxString
& name
= wxListBoxNameStr
);
62 bool Create(wxWindow
*parent
,
66 const wxArrayString
& choices
,
68 const wxValidator
& validator
= wxDefaultValidator
,
69 const wxString
& name
= wxListBoxNameStr
);
71 // implement check list box methods
72 virtual bool IsChecked(unsigned int item
) const;
73 virtual void Check(unsigned int item
, bool check
= true);
76 virtual bool PerformAction(const wxControlAction
& action
,
78 const wxString
& strArg
= wxEmptyString
);
80 static wxInputHandler
*GetStdInputHandler(wxInputHandler
*handlerDef
);
81 virtual wxInputHandler
*DoGetStdInputHandler(wxInputHandler
*handlerDef
)
83 return GetStdInputHandler(handlerDef
);
87 // override all methods which add/delete items to update m_checks array as
89 virtual void OnItemInserted(unsigned int pos
);
90 virtual void DoDeleteOneItem(unsigned int n
);
91 virtual void DoClear();
93 // draw the check items instead of the usual ones
94 virtual void DoDrawRange(wxControlRenderer
*renderer
,
95 int itemFirst
, int itemLast
);
97 // take them also into account for size calculation
98 virtual wxSize
DoGetBestClientSize() const;
100 // common part of all ctors
104 // the array containing the checked status of the items
107 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
110 #endif // _WX_UNIV_CHECKLST_H_