.. include:: headings.inc .. _BitmapToggleButton: ========================================================================================================================================== |phoenix_title| **BitmapToggleButton** ========================================================================================================================================== :ref:`BitmapToggleButton` is a :ref:`ToggleButton` that contains a bitmap instead of text. This class is not available in all ports currently (although it is available in the major ones), test for ``HAS_BITMAPTOGGLEBUTTON`` to determine whether it can be used (in addition for possibly testing for ``USE_TOGGLEBTN`` which can be set to 0 to explicitly disable support for this class and :ref:`ToggleButton`). This control emits an update UI event. .. _BitmapToggleButton-events: |events| Events Emitted by this Class ===================================== Handlers bound for the following event types will receive a :ref:`CommandEvent` parameter. - EVT_TOGGLEBUTTON: Handles a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event. | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **BitmapToggleButton** .. raw:: html

Inheritance diagram of BitmapToggleButton

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~BitmapToggleButton.__init__` Default constructor. :meth:`~BitmapToggleButton.Create` Create method for two-step construction. :meth:`~BitmapToggleButton.GetValue` Gets the state of the toggle button. :meth:`~BitmapToggleButton.SetValue` Sets the toggle button to the given state. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~BitmapToggleButton.Value` See :meth:`~BitmapToggleButton.GetValue` and :meth:`~BitmapToggleButton.SetValue` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: BitmapToggleButton(ToggleButton) BitmapToggleButton is a ToggleButton that contains a bitmap instead of text. **Possible constructors**:: BitmapToggleButton() BitmapToggleButton(parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr) .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations**: **~~~** **__init__** `(self)` Default constructor. **~~~** **__init__** `(self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr)` Constructor, creating and showing a toggle button with the bitmap `label`. Internally calls :meth:`Create` . :param `parent`: :type `parent`: Window :param `id`: :type `id`: int :param `label`: :type `label`: Bitmap :param `pos`: :type `pos`: Point :param `size`: :type `size`: Size :param `style`: :type `style`: long :param `val`: :type `val`: Validator :param `name`: :type `name`: string **~~~** .. method:: Create(self, parent, id=ID_ANY, label=NullBitmap, pos=DefaultPosition, size=DefaultSize, style=0, val=DefaultValidator, name=CheckBoxNameStr) Create method for two-step construction. :param `parent`: :type `parent`: Window :param `id`: :type `id`: int :param `label`: :type `label`: Bitmap :param `pos`: :type `pos`: Point :param `size`: :type `size`: Size :param `style`: :type `style`: long :param `val`: :type `val`: Validator :param `name`: :type `name`: string :rtype: `bool` .. method:: GetValue(self) Gets the state of the toggle button. :rtype: `bool` :returns: Returns ``True`` if it is pressed, ``False`` otherwise. .. method:: SetValue(self, state) Sets the toggle button to the given state. This does not cause a ``EVT_TOGGLEBUTTON`` event to be emitted. :param `state`: If ``True``, the button is pressed. :type `state`: bool .. attribute:: Value See :meth:`~BitmapToggleButton.GetValue` and :meth:`~BitmapToggleButton.SetValue`