wx.CheckListBox¶A wx.CheckListBox is like a wx.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.
Events Emitted by this Class¶Handlers bound for the following event types will receive a wx.CommandEvent parameter.
wxEVT_CHECKLISTBOX event, when an item in the check list box is checked or unchecked. wx.CommandEvent.GetInt will contain the index of the item that was checked or unchecked. wx.CommandEvent.IsChecked is not valid! Use wx.CheckListBox.IsChecked instead.See also
wx.ListBox, wx.Choice, wx.ComboBox, wx.ListCtrl, wx.CommandEvent
Methods Summary¶__init__ |
Constructor, creating and showing a list box. |
Check |
Checks the given item. |
Create |
|
GetCheckedItems |
GetCheckedItems() |
GetCheckedStrings |
GetCheckedStrings() |
IsChecked |
Returns True if the given item is checked, False otherwise. |
SetCheckedItems |
SetCheckedItems(indexes) |
SetCheckedStrings |
SetCheckedStrings(strings) |
Properties Summary¶Checked |
See GetChecked and SetChecked |
CheckedItems |
See GetCheckedItems and SetCheckedItems |
CheckedStrings |
See GetCheckedStrings and SetCheckedStrings |
Class API¶wx.CheckListBox(ListBox)¶Possible constructors:
CheckListBox(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
choices=[], style=0, validator=DefaultValidator, name="listBox")
CheckListBox()
A CheckListBox is like a ListBox, but allows items to be checked or unchecked.
__init__(self, *args, **kw)¶__init__ (self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=0, validator=DefaultValidator, name=”listBox”)
Constructor, creating and showing a list box.
| Parameters: |
|
|---|
__init__ (self)
Default constructor.
Check(self, item, check=True)¶Checks the given item.
Note that calling this method does not result in a wxEVT_CHECKLISTBOX event being emitted.
| Parameters: |
|
|---|
Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=0, validator=DefaultValidator, name=ListBoxNameStr)¶| Parameters: |
|
|---|---|
| Return type: | bool |
GetCheckedItems(self)¶GetCheckedItems()
Return a sequence of integers corresponding to the checked items in
the control, based on IsChecked.
GetCheckedStrings(self)¶GetCheckedStrings()
Return a tuple of strings corresponding to the checked
items of the control, based on GetChecked.
IsChecked(self, item)¶Returns True if the given item is checked, False otherwise.
| Parameters: | item (int) – Index of item whose check status is to be returned. |
|---|---|
| Return type: | bool |
SetCheckedItems(self, indexes)¶SetCheckedItems(indexes)
Sets the checked state of items if the index of the item is found in the indexes sequence.
SetCheckedStrings(self, strings)¶SetCheckedStrings(strings)
Sets the checked state of items if the item’s string is found in the strings sequence.
Checked¶See GetChecked and SetChecked
CheckedItems¶See GetCheckedItems and SetCheckedItems
CheckedStrings¶See GetCheckedStrings and SetCheckedStrings