]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/checklst.h
On screens with restricted space, it's useful to be able to add controls
[wxWidgets.git] / include / wx / mac / carbon / checklst.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/checklst.h
3 // Purpose: wxCheckListBox class - a listbox with checkable items
4 // Note: this is an optional class.
5 // Author: Stefan Csomor
6 // Modified by:
7 // Created: 1998-01-01
8 // RCS-ID: $Id$
9 // Copyright: (c) Stefan Csomor
10 // Licence: wxWindows licence
11 ///////////////////////////////////////////////////////////////////////////////
12
13 #ifndef _WX_CHECKLST_H_
14 #define _WX_CHECKLST_H_
15
16 class WXDLLEXPORT wxCheckListBox : public wxCheckListBoxBase
17 {
18 DECLARE_DYNAMIC_CLASS(wxCheckListBox)
19 public:
20 // ctors
21 wxCheckListBox() { Init(); }
22 wxCheckListBox(wxWindow *parent,
23 wxWindowID id,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize,
26 int nStrings = 0,
27 const wxString *choices = NULL,
28 long style = 0,
29 const wxValidator& validator = wxDefaultValidator,
30 const wxString& name = wxListBoxNameStr)
31 {
32 Init();
33
34 Create(parent, id, pos, size, nStrings, choices, style, validator, name);
35 }
36 wxCheckListBox(wxWindow *parent,
37 wxWindowID id,
38 const wxPoint& pos,
39 const wxSize& size,
40 const wxArrayString& choices,
41 long style = 0,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxListBoxNameStr)
44 {
45 Init();
46
47 Create(parent, id, pos, size, choices, style, validator, name);
48 }
49
50 bool Create(wxWindow *parent,
51 wxWindowID id,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize,
54 int nStrings = 0,
55 const wxString *choices = NULL,
56 long style = 0,
57 const wxValidator& validator = wxDefaultValidator,
58 const wxString& name = wxListBoxNameStr);
59 bool Create(wxWindow *parent,
60 wxWindowID id,
61 const wxPoint& pos,
62 const wxSize& size,
63 const wxArrayString& choices,
64 long style = 0,
65 const wxValidator& validator = wxDefaultValidator,
66 const wxString& name = wxListBoxNameStr);
67
68 // items may be checked
69 bool IsChecked(unsigned int uiIndex) const;
70 void Check(unsigned int uiIndex, bool bCheck = true);
71
72
73 // override all methods which add/delete items to update m_checks array as
74 // well
75 virtual void Delete(unsigned int n);
76 // the array containing the checked status of the items
77 wxArrayInt m_checks;
78
79 protected:
80 virtual int DoAppend(const wxString& item);
81 virtual void DoInsertItems(const wxArrayString& items, unsigned int pos);
82 virtual void DoSetItems(const wxArrayString& items, void **clientData);
83 virtual void DoClear();
84 // common part of all ctors
85 void Init();
86 private:
87
88 DECLARE_EVENT_TABLE()
89 };
90
91 #endif
92 // _WX_CHECKLST_H_