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_
16 #pragma interface "univchecklst.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
23 #define wxACTION_CHECKLISTBOX_TOGGLE _T("toggle")
25 // ----------------------------------------------------------------------------
27 // ----------------------------------------------------------------------------
29 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
33 wxCheckListBox() { Init(); }
35 wxCheckListBox(wxWindow
*parent
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
40 const wxString
*choices
= NULL
,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxListBoxNameStr
)
47 Create(parent
, id
, pos
, size
, nStrings
, choices
, style
, validator
, name
);
50 bool Create(wxWindow
*parent
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
,
55 const wxString
*choices
= NULL
,
57 const wxValidator
& validator
= wxDefaultValidator
,
58 const wxString
& name
= wxListBoxNameStr
);
60 // implement check list box methods
61 virtual bool IsChecked(size_t item
) const;
62 virtual void Check(size_t item
, bool check
= TRUE
);
65 virtual bool PerformAction(const wxControlAction
& action
,
67 const wxString
& strArg
= wxEmptyString
);
69 // override all methods which add/delete items to update m_checks array as
71 virtual void Delete(int n
);
74 virtual int DoAppend(const wxString
& item
);
75 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
76 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
77 virtual void DoClear();
79 // draw the check items instead of the usual ones
80 virtual void DoDrawRange(wxControlRenderer
*renderer
,
81 int itemFirst
, int itemLast
);
83 // take them also into account for size calculation
84 virtual wxSize
DoGetBestClientSize() const;
86 // common part of all ctors
90 // the array containing the checked status of the items
93 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
96 // ----------------------------------------------------------------------------
97 // wxStdCheckListBoxInputHandler
98 // ----------------------------------------------------------------------------
100 class WXDLLEXPORT wxStdCheckListboxInputHandler
: public wxStdListboxInputHandler
103 wxStdCheckListboxInputHandler(wxInputHandler
*inphand
);
105 virtual bool HandleKey(wxControl
*control
,
106 const wxKeyEvent
& event
,
108 virtual bool HandleMouse(wxControl
*control
,
109 const wxMouseEvent
& event
);
112 #endif // _WX_UNIV_CHECKLST_H_