1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
5 // Author: Julian Smart
9 // Copyright: (c) Julian Smart
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
16 #include "wx/listbox.h"
18 class WXDLLIMPEXP_CORE wxCheckListBox
: public wxCheckListBoxBase
20 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
25 wxCheckListBox(wxWindow
*parent
, wxWindowID id
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
29 const wxString choices
[] = NULL
,
31 const wxValidator
& validator
= wxDefaultValidator
,
32 const wxString
& name
= wxListBoxNameStr
);
34 wxCheckListBox(wxWindow
*parent
, wxWindowID id
,
37 const wxArrayString
& choices
,
39 const wxValidator
& validator
= wxDefaultValidator
,
40 const wxString
& name
= wxListBoxNameStr
);
42 bool Create(wxWindow
*parent
, wxWindowID id
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 int n
= 0, const wxString choices
[] = NULL
,
47 const wxValidator
& validator
= wxDefaultValidator
,
48 const wxString
& name
= wxListBoxNameStr
);
50 bool Create(wxWindow
*parent
, wxWindowID id
,
53 const wxArrayString
& choices
,
55 const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
& name
= wxListBoxNameStr
);
58 // items may be checked
59 bool IsChecked(size_t uiIndex
) const;
60 void Check(size_t uiIndex
, bool bCheck
= true);
62 // override base class functions
63 virtual int DoAppend(const wxString
& item
);
64 virtual int FindString(const wxString
& s
) const;
65 virtual void SetString(int n
, const wxString
& s
);
66 virtual wxString
GetString(int n
) const;
68 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
69 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
71 void DoToggleItem( int item
, int x
);