]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/checklst.h
9689955c6b31c602591e967215ee4470eba3c023
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxCheckListBox
4 // Author: wxWidgets team
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 A wxCheckListBox is like a wxListBox, but allows items to be checked or
15 When using this class under Windows wxWidgets must be compiled with
16 wxUSE_OWNER_DRAWN set to 1.
18 @beginEventEmissionTable{wxCommandEvent}
19 @event{EVT_CHECKLISTBOX(id, func)}
20 Process a @c wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in
21 the check list box is checked or unchecked. wxCommandEvent::GetInt()
22 will contain the index of the item that was checked or unchecked.
23 wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked()
29 @appearance{checklistbox}
31 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
33 class wxCheckListBox
: public wxListBox
43 Constructor, creating and showing a list box.
46 Parent window. Must not be @NULL.
48 Window identifier. The value wxID_ANY indicates a default value.
51 If ::wxDefaultPosition is specified then a default position is chosen.
54 If ::wxDefaultSize is specified then the window is sized appropriately.
56 Number of strings with which to initialise the control.
58 An array of strings with which to initialise the control.
60 Window style. See wxCheckListBox.
67 Not supported by wxPerl.
70 wxCheckListBox(wxWindow
* parent
, wxWindowID id
,
71 const wxPoint
& pos
= wxDefaultPosition
,
72 const wxSize
& size
= wxDefaultSize
,
74 const wxString choices
[] = NULL
,
76 const wxValidator
& validator
= wxDefaultValidator
,
77 const wxString
& name
= "listBox");
79 Constructor, creating and showing a list box.
82 Parent window. Must not be @NULL.
84 Window identifier. The value wxID_ANY indicates a default value.
88 Window size. If wxDefaultSize is specified then the window is sized
91 An array of strings with which to initialise the control.
93 Window style. See wxCheckListBox.
100 Use an array reference for the @a choices parameter.
103 wxCheckListBox(wxWindow
* parent
, wxWindowID id
,
106 const wxArrayString
& choices
,
108 const wxValidator
& validator
= wxDefaultValidator
,
109 const wxString
& name
= "listBox");
112 bool Create(wxWindow
*parent
,
114 const wxPoint
& pos
= wxDefaultPosition
,
115 const wxSize
& size
= wxDefaultSize
,
117 const wxString choices
[] = NULL
,
119 const wxValidator
& validator
= wxDefaultValidator
,
120 const wxString
& name
= wxListBoxNameStr
);
122 bool Create(wxWindow
*parent
,
126 const wxArrayString
& choices
,
128 const wxValidator
& validator
= wxDefaultValidator
,
129 const wxString
& name
= wxListBoxNameStr
);
132 Destructor, destroying the list box.
134 virtual ~wxCheckListBox();
137 Checks the given item. Note that calling this method does not result in
138 a @c wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.
141 Index of item to check.
143 @true if the item is to be checked, @false otherwise.
145 void Check(unsigned int item
, bool check
= true);
148 Returns @true if the given item is checked, @false otherwise.
151 Index of item whose check status is to be returned.
153 bool IsChecked(unsigned int item
) const;
156 Return the indices of the checked items.
159 A reference to the array that is filled with the indices of the
161 @return The number of checked items.
163 @see Check(), IsChecked()
167 unsigned int GetCheckedItems(wxArrayInt
& checkedItems
) const;