.. wxPython Phoenix documentation

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

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

.. include:: headings.inc

.. currentmodule:: wx.lib.buttons

.. highlight:: python



.. _wx.lib.buttons.GenBitmapButton:

==========================================================================================================================================
|phoenix_title|  **wx.lib.buttons.GenBitmapButton**
==========================================================================================================================================

A generic bitmap button. 



|

|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>GenBitmapButton</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.lib.buttons.GenBitmapButton_inheritance.png" alt="Inheritance diagram of GenBitmapButton" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.lib.buttons.GenBitmapButton.html" title="A generic bitmap button." alt="" coords="5,469,245,499"/> <area shape="rect" id="node2" href="wx.lib.buttons.GenButton.html" title="A generic button, and base class for the other generic buttons." alt="" coords="29,392,221,421"/> <area shape="rect" id="node3" href="wx.Control.html" title="This is the base class for a control or 'widget'." alt="" coords="79,315,172,344"/> <area shape="rect" id="node4" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="77,237,174,267"/> <area shape="rect" id="node5" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="60,160,191,189"/> <area shape="rect" id="node6" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="66,83,185,112"/> <area shape="rect" id="node7" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="20,5,108,35"/> <area shape="rect" id="node8" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="133,5,243,35"/> </map> 
   </p>
   </div>

|


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

:class:`wx.lib.buttons.GenBitmapTextButton`, :class:`wx.lib.buttons.GenBitmapToggleButton`, :class:`wx.lib.buttons.ThemedGenBitmapButton`, :class:`wx.lib.colourselect.ColourSelect`

|


|super_classes| Known Superclasses
==================================

:class:`wx.lib.buttons.GenButton`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.buttons.GenBitmapButton.__init__`                                 Default class constructor.
:meth:`~wx.lib.buttons.GenBitmapButton.DrawLabel`                                
:meth:`~wx.lib.buttons.GenBitmapButton.GetBitmapDisabled`                        Returns the bitmap for the button's disabled state, which may be invalid.
:meth:`~wx.lib.buttons.GenBitmapButton.GetBitmapFocus`                           Returns the bitmap for the button's focused state, which may be invalid.
:meth:`~wx.lib.buttons.GenBitmapButton.GetBitmapLabel`                           Returns the bitmap for the button's normal state.
:meth:`~wx.lib.buttons.GenBitmapButton.GetBitmapSelected`                        Returns the bitmap for the button's pressed state, which may be invalid.
:meth:`~wx.lib.buttons.GenBitmapButton.SetBitmapDisabled`                        Sets the bitmap for the disabled button appearance.
:meth:`~wx.lib.buttons.GenBitmapButton.SetBitmapFocus`                           Sets the bitmap for the focused button appearance.
:meth:`~wx.lib.buttons.GenBitmapButton.SetBitmapLabel`                           Set the bitmap to display normally.
:meth:`~wx.lib.buttons.GenBitmapButton.SetBitmapSelected`                        Sets the bitmap for the selected (depressed) button appearance.
================================================================================ ================================================================================


|


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


.. class:: GenBitmapButton(GenButton)

   A generic bitmap button. 

   .. method:: __init__(self, parent, id=-1, bitmap=wx.NullBitmap, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, validator = wx.DefaultValidator, name = "genbutton")

      Default class constructor.
      
      :param wx.Window `parent`: parent window. Must not be ``None``;
      :param integer `id`: window identifier. A value of -1 indicates a default value;
      :param wx.Bitmap `bitmap`: the button bitmap;
      :param `pos`: the control position. A value of (-1, -1) indicates a default position,
       chosen by either the windowing system or wxPython, depending on platform;
      :type `pos`: tuple or :class:`wx.Point`
      :param `size`: the control size. A value of (-1, -1) indicates a default size,
       chosen by either the windowing system or wxPython, depending on platform;
      :type `size`: tuple or :class:`wx.Size`
      :param integer `style`: the button style;
      :param wx.Validator `validator`: the validator associated to the button;
      :param string `name`: the button name.
      
      .. seealso:: :class:`wx.Button` for a list of valid window styles.


   .. method:: DrawLabel(self, dc, width, height, dx=0, dy=0)


   .. method:: GetBitmapDisabled(self)

      Returns the bitmap for the button's disabled state, which may be invalid.
      
      :rtype: :class:`wx.Bitmap`
      
      .. seealso:: :meth:`SetBitmapDisabled`


   .. method:: GetBitmapFocus(self)

      Returns the bitmap for the button's focused state, which may be invalid.
      
      :rtype: :class:`wx.Bitmap`
      
      .. seealso:: :meth:`SetBitmapFocus`


   .. method:: GetBitmapLabel(self)

      Returns the bitmap for the button's normal state.
      
      :rtype: :class:`wx.Bitmap`
      
      .. seealso:: :meth:`SetBitmapLabel`


   .. method:: GetBitmapSelected(self)

      Returns the bitmap for the button's pressed state, which may be invalid.
      
      :rtype: :class:`wx.Bitmap`
      
      .. seealso:: :meth:`SetBitmapSelected`


   .. method:: SetBitmapDisabled(self, bitmap)

      Sets the bitmap for the disabled button appearance.
      
      :param wx.Bitmap `bitmap`: the bitmap for the disabled button appearance.
      
      .. seealso::
      
         :meth:`GetBitmapDisabled`, :meth:`SetBitmapLabel`,
         :meth:`SetBitmapSelected`, :meth:`SetBitmapFocus`


   .. method:: SetBitmapFocus(self, bitmap)

      Sets the bitmap for the focused button appearance.
      
      :param wx.Bitmap `bitmap`: the bitmap for the focused button appearance.
      
      .. seealso::
      
         :meth:`GetBitmapFocus`, :meth:`SetBitmapLabel`,
         :meth:`SetBitmapSelected`, :meth:`SetBitmapDisabled`


   .. method:: SetBitmapLabel(self, bitmap, createOthers=True)

      Set the bitmap to display normally.
      This is the only one that is required.
      
      If `createOthers` is ``True``, then the other bitmaps will be generated
      on the fly.  Currently, only the disabled bitmap is generated.
      
      :param wx.Bitmap `bitmap`: the bitmap for the normal button appearance.
      
      .. note:: This is the bitmap used for the unselected state, and for all other
         states if no other bitmaps are provided.


   .. method:: SetBitmapSelected(self, bitmap)

      Sets the bitmap for the selected (depressed) button appearance.
      
      :param wx.Bitmap `bitmap`: the bitmap for the selected (depressed) button appearance.
      
      .. seealso::
      
         :meth:`GetBitmapSelected`, :meth:`SetBitmapLabel`,
         :meth:`SetBitmapDisabled`, :meth:`SetBitmapFocus`