.. 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.agw.shapedbutton

.. highlight:: python



.. _wx.lib.agw.shapedbutton.SBitmapButton:

==========================================================================================================================================
|phoenix_title|  **wx.lib.agw.shapedbutton.SBitmapButton**
==========================================================================================================================================

Subclass of :class:`SButton` which displays a bitmap, acting like a
:class:`wx.BitmapButton`.



|

|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>SBitmapButton</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.agw.shapedbutton.SBitmapButton_inheritance.png" alt="Inheritance diagram of SBitmapButton" 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.agw.shapedbutton.SBitmapButton.html" title="Subclass of SButton which displays a bitmap, acting like a" alt="" coords="5,392,300,421"/> <area shape="rect" id="node2" href="wx.lib.agw.shapedbutton.SButton.html" title="This is the main implementation of `ShapedButton`." alt="" coords="29,315,276,344"/> <area shape="rect" id="node3" href="wx.Window.html" title="wx.Window  is the base class for all windows and represents any visible object on screen." alt="" coords="104,237,201,267"/> <area shape="rect" id="node4" href="wx.WindowBase.html" title="wx.WindowBase" alt="" coords="87,160,218,189"/> <area shape="rect" id="node5" href="wx.EvtHandler.html" title="A class that can handle events from the windowing system." alt="" coords="93,83,212,112"/> <area shape="rect" id="node6" href="wx.Object.html" title="This is the root class of many of the wxWidgets classes." alt="" coords="47,5,135,35"/> <area shape="rect" id="node7" href="wx.Trackable.html" title="Add-on base class for a trackable object." alt="" coords="160,5,271,35"/> </map> 
   </p>
   </div>

|


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

|

.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.shapedbutton.sbitmapbutton.png
   :alt: wxMSW
   :figclass: floatleft

   **wxMSW**


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

   **wxMAC**


.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.shapedbutton.sbitmapbutton.png
   :alt: wxGTK
   :figclass: floatcenter

   **wxGTK**


|




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

:class:`wx.lib.agw.shapedbutton.SBitmapTextButton`, :class:`wx.lib.agw.shapedbutton.SBitmapToggleButton`

|


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

:class:`wx.lib.agw.shapedbutton.SButton`

|


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

================================================================================ ================================================================================
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.__init__`                          Default class constructor.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.DrawLabel`                         Draws the bitmap in the middle of the button.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.GetBitmapDisabled`                 Returns the bitmap displayed when the button is disabled.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.GetBitmapFocus`                    Returns the bitmap displayed when the button has the focus.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.GetBitmapLabel`                    Returns the bitmap associated with the button in the normal state.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.GetBitmapSelected`                 Returns the bitmap displayed when the button is selected (pressed).
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.SetBitmapDisabled`                 Sets the bitmap to display when the button is disabled.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.SetBitmapFocus`                    Sets the bitmap to display when the button has the focus.
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.SetBitmapLabel`                    Sets the bitmap to display normally. This is the only one that is
:meth:`~wx.lib.agw.shapedbutton.SBitmapButton.SetBitmapSelected`                 Sets the bitmap to display when the button is selected (pressed).
================================================================================ ================================================================================


|


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


.. class:: SBitmapButton(SButton)

   Subclass of :class:`SButton` which displays a bitmap, acting like a
   :class:`wx.BitmapButton`.

   .. method:: __init__(self, parent, id, bitmap, pos=wx.DefaultPosition, size=wx.DefaultSize)

      Default class constructor.
      
      :param `parent`: the :class:`SBitmapButton` parent. Must not be ``None``;
      :param `id`: window identifier. A value of -1 indicates a default value;
      :param `bitmap`: the button bitmap (if any);
      :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;
      :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.


   .. method:: DrawLabel(self, dc, width, height, dw=0, dh=0)

      Draws the bitmap in the middle of the button.
      
      :param `dc`: an instance of :class:`wx.DC`;
      :param `width`: the button width;
      :param `height`: the button height;
      :param `dw`: width differential, to show a 3D effect;
      :param `dh`: height differential, to show a 3D effect.


   .. method:: GetBitmapDisabled(self)

      Returns the bitmap displayed when the button is disabled. 


   .. method:: GetBitmapFocus(self)

      Returns the bitmap displayed when the button has the focus. 


   .. method:: GetBitmapLabel(self)

      Returns the bitmap associated with the button in the normal state. 


   .. method:: GetBitmapSelected(self)

      Returns the bitmap displayed when the button is selected (pressed). 


   .. method:: SetBitmapDisabled(self, bitmap)

      Sets the bitmap to display when the button is disabled.
      
      :param `bitmap`: a valid :class:`wx.Bitmap` object.


   .. method:: SetBitmapFocus(self, bitmap)

      Sets the bitmap to display when the button has the focus.
      
      :param `bitmap`: a valid :class:`wx.Bitmap` object.


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

      Sets the bitmap to display normally. This is the only one that is
      required.
      
      :param `bitmap`: a valid :class:`wx.Bitmap` object;
      :param `createothers`: if set to ``True``, then the other bitmaps will be
       generated on the fly. Currently, only the disabled bitmap is generated.


   .. method:: SetBitmapSelected(self, bitmap)

      Sets the bitmap to display when the button is selected (pressed).
      
      :param `bitmap`: a valid :class:`wx.Bitmap` object.