#include </home/zeitlin/src/wx/github/interface/wx/checklst.h>
A wxCheckListBox is like a wxListBox, but allows items to be checked or unchecked.
When using this class under Windows wxWidgets must be compiled with wxUSE_OWNER_DRAWN set to 1.
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
event, when an item in the check list box is checked or unchecked. wxCommandEvent::GetInt() will contain the index of the item that was checked or unchecked. wxCommandEvent::IsChecked() is not valid! Use wxCheckListBox::IsChecked() instead. wxMSW appearance | wxGTK appearance | wxMac appearance |
Public Member Functions | |
wxCheckListBox () | |
Default constructor. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int nStrings=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr) |
Creates the listbox for two-step construction. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, const wxArrayString &choices, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListBoxNameStr) |
Creates the listbox for two-step construction. | |
virtual | ~wxCheckListBox () |
Destructor, destroying the list box. | |
void | Check (unsigned int item, bool check=true) |
Checks the given item. | |
bool | IsChecked (unsigned int item) const |
Returns true if the given item is checked, false otherwise. | |
wxCheckListBox (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, int n=0, const wxString choices[]=NULL, long style=0, const wxValidator &validator=wxDefaultValidator, const wxString &name="listBox") | |
Constructor, creating and showing a list box. | |
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. |
wxCheckListBox::wxCheckListBox | ( | ) |
Default constructor.
wxCheckListBox::wxCheckListBox | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = NULL , |
||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = "listBox" |
||
) |
Constructor, creating and showing a list box.
parent | Parent window. Must not be NULL. |
id | Window identifier. The value wxID_ANY indicates a default value. |
pos | Window position. If wxDefaultPosition is specified then a default position is chosen. |
size | Window size. If wxDefaultSize is specified then the window is sized appropriately. |
n | Number of strings with which to initialise the control. |
choices | An array of strings with which to initialise the control. |
style | Window style. See wxCheckListBox. |
validator | Window validator. |
name | Window name. |
wxPerl Note: Not supported by wxPerl.
wxCheckListBox::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.
parent | Parent window. Must not be NULL. |
id | Window identifier. The value wxID_ANY indicates a default value. |
pos | Window position. |
size | Window size. If wxDefaultSize is specified then the window is sized appropriately. |
choices | An array of strings with which to initialise the control. |
style | Window style. See wxCheckListBox. |
validator | Window validator. |
name | Window name. |
wxPerl Note: Use an array reference for the choices parameter.
virtual wxCheckListBox::~wxCheckListBox | ( | ) | [virtual] |
Destructor, destroying the list box.
void wxCheckListBox::Check | ( | unsigned int | item, |
bool | check = true |
||
) |
Checks the given item.
Note that calling this method does not result in a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE
event being emitted.
item | Index of item to check. |
check | true if the item is to be checked, false otherwise. |
bool wxCheckListBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos, | ||
const wxSize & | size, | ||
const wxArrayString & | choices, | ||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxListBoxNameStr |
||
) |
Creates the listbox for two-step construction.
See wxListBox() for further details.
Reimplemented from wxListBox.
bool wxCheckListBox::Create | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
int | n = 0 , |
||
const wxString | choices[] = NULL , |
||
long | style = 0 , |
||
const wxValidator & | validator = wxDefaultValidator , |
||
const wxString & | name = wxListBoxNameStr |
||
) |
Creates the listbox for two-step construction.
See wxListBox() for further details.
Reimplemented from wxListBox.
bool wxCheckListBox::IsChecked | ( | unsigned int | item | ) | const |
Returns true if the given item is checked, false otherwise.
item | Index of item whose check status is to be returned. |