.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 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

Inheritance diagram for class
SBitmapButton:
|
|appearance| Control Appearance
===============================
|
.. container:: control-appearance-figures
.. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.shapedbutton.sbitmapbutton.png
:alt: wxMSW
:figclass: appearance-figure
**wxMSW**
.. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png
:alt: wxMAC
:figclass: appearance-figure
**wxMAC**
.. figure:: _static/images/widgets/fullsize/wxgtk/wx.lib.agw.shapedbutton.sbitmapbutton.png
:alt: wxGTK
:figclass: appearance-figure
**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.