]> git.saurik.com Git - wxWidgets.git/blob - include/wx/osx/checklst.h
proper default for iphone
[wxWidgets.git] / include / wx / osx / checklst.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/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 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MAC_CHECKLST_H_
13 #define _WX_MAC_CHECKLST_H_
14
15 class WXDLLIMPEXP_CORE wxCheckListBox : public wxCheckListBoxBase
16 {
17 public:
18 // ctors
19 wxCheckListBox() { Init(); }
20 wxCheckListBox(wxWindow *parent,
21 wxWindowID id,
22 const wxPoint& pos = wxDefaultPosition,
23 const wxSize& size = wxDefaultSize,
24 int nStrings = 0,
25 const wxString *choices = NULL,
26 long style = 0,
27 const wxValidator& validator = wxDefaultValidator,
28 const wxString& name = wxListBoxNameStr)
29 {
30 Init();
31
32 Create(parent, id, pos, size, nStrings, choices, style, validator, name);
33 }
34 wxCheckListBox(wxWindow *parent,
35 wxWindowID id,
36 const wxPoint& pos,
37 const wxSize& size,
38 const wxArrayString& choices,
39 long style = 0,
40 const wxValidator& validator = wxDefaultValidator,
41 const wxString& name = wxListBoxNameStr)
42 {
43 Init();
44
45 Create(parent, id, pos, size, choices, style, validator, name);
46 }
47
48 bool Create(wxWindow *parent,
49 wxWindowID id,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 int nStrings = 0,
53 const wxString *choices = NULL,
54 long style = 0,
55 const wxValidator& validator = wxDefaultValidator,
56 const wxString& name = wxListBoxNameStr);
57 bool Create(wxWindow *parent,
58 wxWindowID id,
59 const wxPoint& pos,
60 const wxSize& size,
61 const wxArrayString& choices,
62 long style = 0,
63 const wxValidator& validator = wxDefaultValidator,
64 const wxString& name = wxListBoxNameStr);
65
66 // items may be checked
67 bool IsChecked(unsigned int uiIndex) const;
68 void Check(unsigned int uiIndex, bool bCheck = true);
69
70 // data callbacks
71 virtual void GetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value );
72 virtual void SetValueCallback( unsigned int n, wxListWidgetColumn* col , wxListWidgetCellValue& value );
73
74 protected:
75 // override all methods which add/delete items to update m_checks array as
76 // well
77 virtual void OnItemInserted(unsigned int pos);
78 virtual void DoDeleteOneItem(unsigned int n);
79 virtual void DoClear();
80
81 // the array containing the checked status of the items
82 wxArrayInt m_checks;
83
84 wxListWidgetColumn* m_checkColumn ;
85
86 void Init();
87
88 private:
89 DECLARE_EVENT_TABLE()
90 DECLARE_DYNAMIC_CLASS(wxCheckListBox)
91 };
92
93 #endif // _WX_MAC_CHECKLST_H_