1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/classic/checklst.h
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 class WXDLLEXPORT wxCheckListBox
: public wxCheckListBoxBase
18 DECLARE_DYNAMIC_CLASS(wxCheckListBox
)
21 wxCheckListBox() { Init(); }
22 wxCheckListBox(wxWindow
*parent
,
24 const wxPoint
& pos
= wxDefaultPosition
,
25 const wxSize
& size
= wxDefaultSize
,
27 const wxString
*choices
= NULL
,
29 const wxValidator
& validator
= wxDefaultValidator
,
30 const wxString
& name
= wxListBoxNameStr
)
34 Create(parent
, id
, pos
, size
, nStrings
, choices
, style
, validator
, name
);
36 wxCheckListBox(wxWindow
*parent
,
40 const wxArrayString
& choices
,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxListBoxNameStr
)
47 Create(parent
, id
, pos
, size
, 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
);
59 bool Create(wxWindow
*parent
,
63 const wxArrayString
& choices
,
65 const wxValidator
& validator
= wxDefaultValidator
,
66 const wxString
& name
= wxListBoxNameStr
);
68 // items may be checked
69 bool IsChecked(unsigned int uiIndex
) const;
70 void Check(unsigned int uiIndex
, bool bCheck
= true);
71 void OnChar(wxKeyEvent
& event
) ;
72 void OnLeftClick(wxMouseEvent
& event
) ;
75 wxInt32 m_checkBoxWidth
;
76 wxInt32 m_checkBoxHeight
;
77 wxInt32 m_TextBaseLineOffset
;
79 // the array containing the checked status of the items
82 // override all methods which add/delete items to update m_checks array as
84 virtual void Delete(unsigned int n
);
86 virtual int DoAppend(const wxString
& item
);
87 virtual void DoInsertItems(const wxArrayString
& items
, unsigned int pos
);
88 virtual void DoSetItems(const wxArrayString
& items
, void **clientData
);
89 virtual void DoClear();
90 // common part of all ctors