]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/checklst.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxCheckListBox
4 // Author: wxWidgets team
5 // Licence: wxWindows licence
6 /////////////////////////////////////////////////////////////////////////////
11 A wxCheckListBox is like a wxListBox, but allows items to be checked or
14 When using this class under Windows wxWidgets must be compiled with
15 wxUSE_OWNER_DRAWN set to 1.
17 @beginEventEmissionTable{wxCommandEvent}
18 @event{EVT_CHECKLISTBOX(id, func)}
19 Process a @c wxEVT_CHECKLISTBOX event, when an item in
20 the check list box is checked or unchecked. wxCommandEvent::GetInt()
21 will contain the index of the item that was checked or unchecked.
22 wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked()
28 @appearance{checklistbox}
30 @see wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
32 class wxCheckListBox
: public wxListBox
42 Constructor, creating and showing a list box.
45 Parent window. Must not be @NULL.
47 Window identifier. The value wxID_ANY indicates a default value.
50 If ::wxDefaultPosition is specified then a default position is chosen.
53 If ::wxDefaultSize is specified then the window is sized appropriately.
55 Number of strings with which to initialise the control.
57 An array of strings with which to initialise the control.
59 Window style. See wxCheckListBox.
66 Not supported by wxPerl.
69 wxCheckListBox(wxWindow
* parent
, wxWindowID id
,
70 const wxPoint
& pos
= wxDefaultPosition
,
71 const wxSize
& size
= wxDefaultSize
,
73 const wxString choices
[] = NULL
,
75 const wxValidator
& validator
= wxDefaultValidator
,
76 const wxString
& name
= "listBox");
78 Constructor, creating and showing a list box.
81 Parent window. Must not be @NULL.
83 Window identifier. The value wxID_ANY indicates a default value.
87 Window size. If wxDefaultSize is specified then the window is sized
90 An array of strings with which to initialise the control.
92 Window style. See wxCheckListBox.
99 Use an array reference for the @a choices parameter.
102 wxCheckListBox(wxWindow
* parent
, wxWindowID id
,
105 const wxArrayString
& choices
,
107 const wxValidator
& validator
= wxDefaultValidator
,
108 const wxString
& name
= "listBox");
111 bool Create(wxWindow
*parent
,
113 const wxPoint
& pos
= wxDefaultPosition
,
114 const wxSize
& size
= wxDefaultSize
,
116 const wxString choices
[] = NULL
,
118 const wxValidator
& validator
= wxDefaultValidator
,
119 const wxString
& name
= wxListBoxNameStr
);
121 bool Create(wxWindow
*parent
,
125 const wxArrayString
& choices
,
127 const wxValidator
& validator
= wxDefaultValidator
,
128 const wxString
& name
= wxListBoxNameStr
);
131 Destructor, destroying the list box.
133 virtual ~wxCheckListBox();
136 Checks the given item. Note that calling this method does not result in
137 a @c wxEVT_CHECKLISTBOX event being emitted.
140 Index of item to check.
142 @true if the item is to be checked, @false otherwise.
144 void Check(unsigned int item
, bool check
= true);
147 Returns @true if the given item is checked, @false otherwise.
150 Index of item whose check status is to be returned.
152 bool IsChecked(unsigned int item
) const;
155 Return the indices of the checked items.
158 A reference to the array that is filled with the indices of the
160 @return The number of checked items.
162 @see Check(), IsChecked()
166 unsigned int GetCheckedItems(wxArrayInt
& checkedItems
) const;