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
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
);
45 bool Create(wxWindow
*parent
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
50 const wxString
*choices
= NULL
,
52 const wxValidator
& validator
= wxDefaultValidator
,
53 const wxString
& name
= wxListBoxNameStr
);
55 // implement check list box methods
56 virtual bool IsChecked(size_t item
) const;
57 virtual void Check(size_t item
, bool check
= TRUE
);
60 virtual bool PerformAction(const wxControlAction
& action
,
62 const wxString
& strArg
= wxEmptyString
);
64 // override all methods which add/delete items to update m_checks array as
66 virtual void Delete(int n
);
69 virtual int DoAppend(const wxString
& item
);
70 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
71 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
72 virtual void DoClear();
74 // draw the check items instead of the usual ones
75 virtual void DoDrawRange(wxControlRenderer
*renderer
,
76 int itemFirst
, int itemLast
);
78 // take them also into account for size calculation
79 virtual wxSize
DoGetBestClientSize() const;
81 // common part of all ctors
85 // the array containing the checked status of the items
88 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
91 // ----------------------------------------------------------------------------
92 // wxStdCheckListBoxInputHandler
93 // ----------------------------------------------------------------------------
95 class WXDLLEXPORT wxStdCheckListboxInputHandler
: public wxStdListboxInputHandler
98 wxStdCheckListboxInputHandler(wxInputHandler
*inphand
);
100 virtual bool HandleKey(wxInputConsumer
*consumer
,
101 const wxKeyEvent
& event
,
103 virtual bool HandleMouse(wxInputConsumer
*consumer
,
104 const wxMouseEvent
& event
);
107 #endif // _WX_UNIV_CHECKLST_H_