1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
5 // Author: Stefan Csomor
9 // Copyright: (c) Stefan Csomor
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
16 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
17 #pragma interface "checklst.h"
20 #if !defined(__MWERKS__) && !defined(__UNIX__)
21 typedef unsigned int size_t;
24 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
26 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
29 wxCheckListBox() { Init(); }
30 wxCheckListBox(wxWindow
*parent
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
35 const wxString
*choices
= NULL
,
37 const wxValidator
& validator
= wxDefaultValidator
,
38 const wxString
& name
= wxListBoxNameStr
)
42 Create(parent
, id
, pos
, size
, nStrings
, choices
, style
, validator
, name
);
44 wxCheckListBox(wxWindow
*parent
,
48 const wxArrayString
& choices
,
50 const wxValidator
& validator
= wxDefaultValidator
,
51 const wxString
& name
= wxListBoxNameStr
)
55 Create(parent
, id
, pos
, size
, choices
, style
, validator
, name
);
58 bool Create(wxWindow
*parent
,
60 const wxPoint
& pos
= wxDefaultPosition
,
61 const wxSize
& size
= wxDefaultSize
,
63 const wxString
*choices
= 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 // items may be checked
77 bool IsChecked(size_t uiIndex
) const;
78 void Check(size_t uiIndex
, bool bCheck
= TRUE
);
79 void OnChar(wxKeyEvent
& event
) ;
80 void OnLeftClick(wxMouseEvent
& event
) ;
83 wxInt32 m_checkBoxWidth
;
84 wxInt32 m_checkBoxHeight
;
85 wxInt32 m_TextBaseLineOffset
;
87 // the array containing the checked status of the items
90 // override all methods which add/delete items to update m_checks array as
92 virtual void Delete(int n
);
94 virtual int DoAppend(const wxString
& item
);
95 virtual void DoInsertItems(const wxArrayString
& items
, int pos
);
96 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
97 virtual void DoClear();
98 // common part of all ctors
101 DECLARE_EVENT_TABLE()