Table Of Contents

Previous topic

CheckBoxState

Next topic

ChildFocusEvent

This Page

phoenix_title CheckListBox

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.

events Events Emitted by this Class

Handlers bound for the following event types will receive a CommandEvent parameter.


class_hierarchy Inheritance Diagram

Inheritance diagram for class CheckListBox

Inheritance diagram of CheckListBox


appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


sub_classes Known Subclasses

RearrangeList


method_summary Methods Summary

__init__ Constructor, creating and showing a list box.
Check Checks the given item.
Create Creates the listbox for two-step construction.
GetChecked GetChecked()
GetCheckedStrings GetCheckedStrings()
IsChecked Returns True if the given item is checked, False otherwise.
SetChecked SetChecked(indexes)
SetCheckedStrings SetCheckedStrings(strings)

api Class API



class CheckListBox(ListBox)

A CheckListBox is like a ListBox, but allows items to be checked or unchecked.

Possible constructors:

CheckListBox(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize,
             choices=[], style=0, validator=DefaultValidator,
             name="listBox")

CheckListBox()

Methods



__init__(self, *args, **kw)

overload Overloaded Implementations:



__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:
  • parent (Window) – Parent window. Must not be None.
  • id (int) – Window identifier. The value ID_ANY indicates a default value.
  • pos (Point) – Window position.
  • size (Size) – Window size. If DefaultSize is specified then the window is sized appropriately.
  • choices (list of strings) – An array of strings with which to initialise the control.
  • style (long) – Window style. See CheckListBox.
  • validator (Validator) – Window validator.
  • name (string) – Window name.



__init__ (self)

Default constructor.





Check(self, item, check=True)

Checks the given item.

Note that calling this method does not result in a wxEVT_COMMAND_CHECKLISTBOX_TOGGLE event being emitted.

Parameters:
  • item (int) – Index of item to check.
  • check (bool) – True if the item is to be checked, False otherwise.


Create(self, *args, **kw)

Creates the listbox for two-step construction.

See ListBox for further details.



GetChecked(self)

GetChecked()

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


SetChecked(self, indexes)

SetChecked(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.


Properties



Checked

See GetChecked and SetChecked



CheckedStrings

See GetCheckedStrings and SetCheckedStrings