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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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
);
49 wxCheckListBox(wxWindow
*parent
,
53 const wxArrayString
& choices
,
55 const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
& name
= wxListBoxNameStr
);
58 bool Create(wxWindow
*parent
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
63 const wxString choices
[] = (const wxString
*) NULL
,
65 const wxValidator
& validator
= wxDefaultValidator
,
66 const wxString
& name
= wxListBoxNameStr
);
67 bool Create(wxWindow
*parent
,
71 const wxArrayString
& choices
,
73 const wxValidator
& validator
= wxDefaultValidator
,
74 const wxString
& name
= wxListBoxNameStr
);
76 // implement check list box methods
77 virtual bool IsChecked(size_t item
) const;
78 virtual void Check(size_t item
, bool check
= TRUE
);
81 virtual bool PerformAction(const wxControlAction
& action
,
83 const wxString
& strArg
= wxEmptyString
);
85 // override all methods which add/delete items to update m_checks array as
87 virtual void Delete(int n
);
90 virtual int DoAppend(const wxString
& item
);
91 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
92 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
93 virtual void DoClear();
95 // draw the check items instead of the usual ones
96 virtual void DoDrawRange(wxControlRenderer
*renderer
,
97 int itemFirst
, int itemLast
);
99 // take them also into account for size calculation
100 virtual wxSize
DoGetBestClientSize() const;
102 // common part of all ctors
106 // the array containing the checked status of the items
109 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
112 // ----------------------------------------------------------------------------
113 // wxStdCheckListBoxInputHandler
114 // ----------------------------------------------------------------------------
116 class WXDLLEXPORT wxStdCheckListboxInputHandler
: public wxStdListboxInputHandler
119 wxStdCheckListboxInputHandler(wxInputHandler
*inphand
);
121 virtual bool HandleKey(wxInputConsumer
*consumer
,
122 const wxKeyEvent
& event
,
124 virtual bool HandleMouse(wxInputConsumer
*consumer
,
125 const wxMouseEvent
& event
);
128 #endif // _WX_UNIV_CHECKLST_H_