.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2017 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.CheckListBox:

==========================================================================================================================================
|phoenix_title|  **wx.CheckListBox**
==========================================================================================================================================

A :ref:`wx.CheckListBox`  is like a :ref:`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. 







.. _CheckListBox-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.CommandEvent` parameter.


- EVT_CHECKLISTBOX: Process a  ``wxEVT_CHECKLISTBOX``   event, when an item in the check list box is checked or unchecked.  :meth:`wx.CommandEvent.GetInt`   will contain the index of the item that was checked or unchecked. :meth:`wx.CommandEvent.IsChecked`   is not valid! Use :meth:`wx.CheckListBox.IsChecked`   instead.  








         



.. seealso:: :ref:`wx.ListBox`, :ref:`wx.Choice`, :ref:`wx.ComboBox`, :ref:`wx.ListCtrl`, :ref:`wx.CommandEvent`    







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>CheckListBox</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.CheckListBox_inheritance.png" alt="Inheritance diagram of CheckListBox" usemap="#dummy" class="inheritance"/></center>
   </div>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.Control.html" title="wx.Control" alt="" coords="224,237,312,267"/> <area shape="rect" id="node8" href="wx.ListBox.html" title="wx.ListBox" alt="" coords="152,315,240,344"/> <area shape="rect" id="node2" href="wx.Window.html" title="wx.Window" alt="" coords="233,160,321,189"/> <area shape="rect" id="node3" href="wx.ItemContainer.html" title="wx.ItemContainer" alt="" coords="57,237,191,267"/> <area shape="rect" id="node4" href="wx.ItemContainerImmutable.html" title="wx.ItemContainerImmutable" alt="" coords="5,160,208,189"/> <area shape="rect" id="node5" href="wx.Object.html" title="wx.Object" alt="" coords="179,5,260,35"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="wx.EvtHandler" alt="" coords="221,83,332,112"/> <area shape="rect" id="node7" href="wx.CheckListBox.html" title="wx.CheckListBox" alt="" coords="133,392,259,421"/> <area shape="rect" id="node9" href="wx.Trackable.html" title="wx.Trackable" alt="" coords="285,5,387,35"/> </map> 
   </p>

|


|appearance| Control Appearance
===============================

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.checklistbox.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


.. figure:: _static/images/widgets/fullsize/wxmac/wx.checklistbox.png
   :alt: wxMAC
   :figclass: floatright

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.checklistbox.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|


|sub_classes| Known Subclasses
==============================

:ref:`wx.RearrangeList`

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.CheckListBox.__init__`                                                Constructor, creating and showing a list box.
:meth:`~wx.CheckListBox.Check`                                                   Checks the given item.
:meth:`~wx.CheckListBox.Create`                                                  
:meth:`~wx.CheckListBox.GetCheckedItems`                                         GetCheckedItems()
:meth:`~wx.CheckListBox.GetCheckedStrings`                                       GetCheckedStrings()
:meth:`~wx.CheckListBox.IsChecked`                                               Returns ``True`` if the given item is checked, ``False`` otherwise.
:meth:`~wx.CheckListBox.SetCheckedItems`                                         SetCheckedItems(indexes)
:meth:`~wx.CheckListBox.SetCheckedStrings`                                       SetCheckedStrings(strings)
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.CheckListBox.Checked`                                                 See :meth:`~wx.CheckListBox.GetChecked` and :meth:`~wx.CheckListBox.SetChecked`
:attr:`~wx.CheckListBox.CheckedItems`                                            See :meth:`~wx.CheckListBox.GetCheckedItems` and :meth:`~wx.CheckListBox.SetCheckedItems`
:attr:`~wx.CheckListBox.CheckedStrings`                                          See :meth:`~wx.CheckListBox.GetCheckedStrings` and :meth:`~wx.CheckListBox.SetCheckedStrings`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: 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.



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

      
      **__init__** `(self)`
      
      Default constructor.                   
      
      
      
      
      **~~~**






   .. method:: Check(self, item, check=True)

      Checks the given item.                  

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




      :param `item`: Index of item to check.   
      :type `item`: int
      :param `check`: ``True`` if the item is to be checked, ``False`` otherwise.   
      :type `check`: bool






                  





   .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, choices=[], style=0, validator=DefaultValidator, name=ListBoxNameStr)




      :param `parent`: 
      :type `parent`: wx.Window
      :param `id`: 
      :type `id`: wx.WindowID
      :param `pos`: 
      :type `pos`: wx.Point
      :param `size`: 
      :type `size`: wx.Size
      :param `choices`: 
      :type `choices`: list of strings
      :param `style`: 
      :type `style`: long
      :param `validator`: 
      :type `validator`: wx.Validator
      :param `name`: 
      :type `name`: string




      :rtype: `bool`








   .. method:: GetCheckedItems(self)

      GetCheckedItems()
      
      Return a sequence of integers corresponding to the checked items in
      the control, based on :meth:`IsChecked`.



   .. method:: GetCheckedStrings(self)

      GetCheckedStrings()
      
      Return a tuple of strings corresponding to the checked
      items of the control, based on :meth:`GetChecked`.



   .. method:: IsChecked(self, item)

      Returns ``True`` if the given item is checked, ``False`` otherwise.                  




      :param `item`: Index of item whose check status is to be returned.   
      :type `item`: int






      :rtype: `bool`



                  





   .. method:: SetCheckedItems(self, indexes)

      SetCheckedItems(indexes)
      
      Sets the checked state of items if the index of the item is
      found in the indexes sequence.



   .. method:: SetCheckedStrings(self, strings)

      SetCheckedStrings(strings)
      
      Sets the checked state of items if the item's string is found
      in the strings sequence.



   .. attribute:: Checked

      See :meth:`~wx.CheckListBox.GetChecked` and :meth:`~wx.CheckListBox.SetChecked`


   .. attribute:: CheckedItems

      See :meth:`~wx.CheckListBox.GetCheckedItems` and :meth:`~wx.CheckListBox.SetCheckedItems`


   .. attribute:: CheckedStrings

      See :meth:`~wx.CheckListBox.GetCheckedStrings` and :meth:`~wx.CheckListBox.SetCheckedStrings`

