A checklistbox is like a listbox, but allows items to be checked or unchecked.
When using this class under Windows wxWidgets must be compiled with USE_OWNER_DRAWN set to 1.
Only the new functions for this class are documented; see also wxListBox.
Please note that wxCheckListBox uses client data in its implementation, and therefore this is not available to the application.
Derived from
wxListBox
wxControl
wxWindow
wxEvtHandler
wxObject
Include files
<wx/checklst.h>
Window styles
See wxListBox.
Event handling
EVT_CHECKLISTBOX(id, func) | Process a wxEVT_COMMAND_CHECKLISTBOX_TOGGLED event, when an item in the check list box is checked or unchecked. |
See also
wxListBox, wxChoice, wxComboBox, wxListCtrl, wxCommandEvent
Members
wxCheckListBox::wxCheckListBox
wxCheckListBox::~wxCheckListBox
wxCheckListBox::Check
wxCheckListBox::IsChecked
wxCheckListBox()
Default constructor.
wxCheckListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "listBox")
wxCheckListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "listBox")
Constructor, creating and showing a list box.
Parameters
parent
id
pos
size
n
choices
style
validator
name
wxPython note: The wxCheckListBox constructor in wxPython reduces the n and choices arguments are to a single argument, which is a list of strings.
void ~wxCheckListBox()
Destructor, destroying the list box.
void Check(int item, bool check = true)
Checks the given item. Note that calling this method doesn't result in wxEVT_COMMAND_CHECKLISTBOX_TOGGLE being emitted.
Parameters
item
check
bool IsChecked(unsigned int item) const
Returns true if the given item is checked, false otherwise.
Parameters
item