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(size_t item
) const;
74 virtual void Check(size_t item
, bool check
= true);
77 virtual bool PerformAction(const wxControlAction
& action
,
79 const wxString
& strArg
= wxEmptyString
);
81 // override all methods which add/delete items to update m_checks array as
83 virtual void Delete(int n
);
86 virtual int DoAppend(const wxString
& item
);
87 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
88 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
89 virtual void DoClear();
91 // draw the check items instead of the usual ones
92 virtual void DoDrawRange(wxControlRenderer
*renderer
,
93 int itemFirst
, int itemLast
);
95 // take them also into account for size calculation
96 virtual wxSize
DoGetBestClientSize() const;
98 // common part of all ctors
102 // the array containing the checked status of the items
105 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
108 // ----------------------------------------------------------------------------
109 // wxStdCheckListBoxInputHandler
110 // ----------------------------------------------------------------------------
112 class WXDLLEXPORT wxStdCheckListboxInputHandler
: public wxStdListboxInputHandler
115 wxStdCheckListboxInputHandler(wxInputHandler
*inphand
);
117 virtual bool HandleKey(wxInputConsumer
*consumer
,
118 const wxKeyEvent
& event
,
120 virtual bool HandleMouse(wxInputConsumer
*consumer
,
121 const wxMouseEvent
& event
);
124 #endif // _WX_UNIV_CHECKLST_H_