]> git.saurik.com Git - wxWidgets.git/blob - interface/wx/checklst.h
don't make wxGridTableBase::IsEmptyCell() pure virtual, there is really no point...
[wxWidgets.git] / interface / wx / checklst.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: checklst.h
3 // Purpose: interface of wxCheckListBox
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxCheckListBox
11
12 A wxCheckListBox is like a wxListBox, but allows items to be checked or
13 unchecked.
14
15 When using this class under Windows wxWidgets must be compiled with
16 wxUSE_OWNER_DRAWN set to 1.
17
18 Only the new functions for this class are documented; see also wxListBox.
19
20 Please note that wxCheckListBox uses client data in its implementation,
21 and therefore this is not available to the application.
22
23 @beginEventTable{wxCommandEvent}
24 @event{EVT_CHECKLISTBOX(id, func)}
25 Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
26 the check list box is checked or unchecked.
27 @endEventTable
28
29 @library{wxcore}
30 @category{ctrl}
31 @appearance{checklistbox.png}
32
33 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
34 */
35 class wxCheckListBox : public wxListBox
36 {
37 public:
38 /**
39 Default constructor.
40 */
41 wxCheckListBox();
42
43 //@{
44 /**
45 Constructor, creating and showing a list box.
46
47 @param parent
48 Parent window. Must not be @NULL.
49 @param id
50 Window identifier. The value wxID_ANY indicates a default value.
51 @param pos
52 Window position.
53 @param size
54 Window size. If wxDefaultSize is specified then the window is sized
55 appropriately.
56 @param n
57 Number of strings with which to initialise the control.
58 @param choices
59 An array of strings with which to initialise the control.
60 @param style
61 Window style. See wxCheckListBox.
62 @param validator
63 Window validator.
64 @param name
65 Window name.
66 */
67 wxCheckListBox(wxWindow* parent, wxWindowID id,
68 const wxPoint& pos = wxDefaultPosition,
69 const wxSize& size = wxDefaultSize,
70 int n = 0,
71 const wxString choices[] = NULL,
72 long style = 0,
73 const wxValidator& validator = wxDefaultValidator,
74 const wxString& name = "listBox");
75 /**
76 Constructor, creating and showing a list box.
77
78 @param parent
79 Parent window. Must not be @NULL.
80 @param id
81 Window identifier. The value wxID_ANY indicates a default value.
82 @param pos
83 Window position.
84 @param size
85 Window size. If wxDefaultSize is specified then the window is sized
86 appropriately.
87 @param choices
88 An array of strings with which to initialise the control.
89 @param style
90 Window style. See wxCheckListBox.
91 @param validator
92 Window validator.
93 @param name
94 Window name.
95 */
96 wxCheckListBox(wxWindow* parent, wxWindowID id,
97 const wxPoint& pos,
98 const wxSize& size,
99 const wxArrayString& choices,
100 long style = 0,
101 const wxValidator& validator = wxDefaultValidator,
102 const wxString& name = "listBox");
103 //@}
104
105 /**
106 Destructor, destroying the list box.
107 */
108 virtual ~wxCheckListBox();
109
110 /**
111 Checks the given item. Note that calling this method does not result in
112 a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
113
114 @param item
115 Index of item to check.
116 @param check
117 @true if the item is to be checked, @false otherwise.
118 */
119 void Check(unsigned int item, bool check = true);
120
121 /**
122 Returns @true if the given item is checked, @false otherwise.
123
124 @param item
125 Index of item whose check status is to be returned.
126 */
127 bool IsChecked(unsigned int item) const;
128 };
129