*************** wx.BitmapButton *************** Inheritance diagram for `wx.BitmapButton`: | .. inheritance-diagram:: wx.BitmapButton | Description =========== A bitmap button is a control that contains a bitmap. It may be placed on a `dialog `_ or `panel `_, or indeed almost any other window. .. seealso:: `wx.Button `_ Derived From ^^^^^^^^^^^^^ * `wx.Button `_ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.ContextHelpButton `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.BU_AUTODRAW`` If this is specified, the button will be drawn automatically using the label bitmap only, providing a 3D-look border. If this style is not specified, the button will be drawn without borders and using all provided bitmaps. WIN32 only. ``wx.BU_LEFT`` Left-justifies the bitmap label. WIN32 only. ``wx.BU_TOP`` Aligns the bitmap label to the top of the button. WIN32 only. ``wx.BU_RIGHT`` Right-justifies the bitmap label. WIN32 only. ``wx.BU_BOTTOM`` Aligns the bitmap label to the bottom of the button. WIN32 only. ================================================== ================================================== Remarks ^^^^^^^ A bitmap button can be supplied with a single bitmap, and wxPython will draw all button states using this bitmap. If the application needs more control, additional bitmaps for the selected state, unpressed focused state, and greyed-out state may be supplied. Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_BUTTON(id, func) Process a ``wx.wxEVT_COMMAND_BUTTON_CLICKED`` event, when the button is clicked. ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/bitmapbutton.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/bitmapbutton.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/bitmapbutton.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetBitmapDisabled <#GetBitmapDisabled>`_ * `GetBitmapFocus <#GetBitmapFocus>`_ * `GetBitmapHover <#GetBitmapHover>`_ * `GetBitmapLabel <#GetBitmapLabel>`_ * `GetBitmapSelected <#GetBitmapSelected>`_ * `GetMarginX <#GetMarginX>`_ * `GetMarginY <#GetMarginY>`_ * `SetBitmapDisabled <#SetBitmapDisabled>`_ * `SetBitmapFocus <#SetBitmapFocus>`_ * `SetBitmapHover <#SetBitmapHover>`_ * `SetBitmapLabel <#SetBitmapLabel>`_ * `SetBitmapSelected <#SetBitmapSelected>`_ * `SetMargins <#SetMargins>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `BitmapDisabled <#BitmapDisabled>`_ * `BitmapFocus <#BitmapFocus>`_ * `BitmapHover <#BitmapHover>`_ * `BitmapLabel <#BitmapLabel>`_ * `BitmapSelected <#BitmapSelected>`_ * `MarginX <#MarginX>`_ * `MarginY <#MarginY>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, bitmap=wx.NullBitmap, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.BU_AUTODRAW, validator=wx.DefaultValidator, name=wx.ButtonNameStr) Create and show a button with a bitmap for the label. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `bitmap` (`wx.Bitmap `_) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.BitmapButton `_ -------- .. method:: GetBitmapDisabled() Returns the bitmap for the disabled state, may be invalid. | **Returns:** `wx.Bitmap `_ .. seealso:: `SetBitmapDisabled <#SetBitmapDisabled>`_ -------- .. method:: GetBitmapFocus() Returns the bitmap for the focused state, may be invalid. | **Returns:** `wx.Bitmap `_ .. seealso:: `SetBitmapFocus <#SetBitmapFocus>`_ -------- .. method:: GetBitmapHover() Returns the bitmap used when the mouse is over the button, may be invalid. | **Returns:** `wx.Bitmap `_ .. seealso:: `SetBitmapHover <#SetBitmapHover>`_ -------- .. method:: GetBitmapLabel() Returns the label bitmap (the one passed to the constructor), always valid. | **Returns:** `wx.Bitmap `_ .. seealso:: `SetBitmapLabel <#SetBitmapLabel>`_ -------- .. method:: GetBitmapSelected() Returns the bitmap for the pushed button state, may be invalid. | **Returns:** `wx.Bitmap `_ .. seealso:: `SetBitmapSelected <#SetBitmapSelected>`_ -------- .. method:: GetMarginX() `No docstrings available for this method.` -------- .. method:: GetMarginY() `No docstrings available for this method.` -------- .. method:: SetBitmapDisabled(bitmap) Sets the bitmap for the disabled button appearance. **Parameters:** * `bitmap` (`wx.Bitmap `_): The bitmap to set. .. seealso:: `GetBitmapDisabled <#GetBitmapDisabled>`_, `SetBitmapLabel <#SetBitmapLabel>`_, `SetBitmapSelected <#SetBitmapSelected>`_, `SetBitmapFocus <#SetBitmapFocus>`_ -------- .. method:: SetBitmapFocus(bitmap) Sets the bitmap for the button appearance when it has the keyboard focus. **Parameters:** * `bitmap` (`wx.Bitmap `_): The bitmap to set. .. seealso:: `GetBitmapFocus <#GetBitmapFocus>`_, `SetBitmapLabel <#SetBitmapLabel>`_, `SetBitmapSelected <#SetBitmapSelected>`_, `SetBitmapDisabled <#SetBitmapDisabled>`_ -------- .. method:: SetBitmapHover(bitmap) Sets the bitmap to be shown when the mouse is over the button. This function is new since wxWidgets version 2.7.0 and the hover bitmap is currently only supported in wxMSW. **Parameters:** * `bitmap` (`wx.Bitmap `_) .. seealso:: `GetBitmapHover <#GetBitmapHover>`_ -------- .. method:: SetBitmapLabel(bitmap) Sets the bitmap label for the button. **Parameters:** * `bitmap` (`wx.Bitmap `_): The bitmap label to set. .. note:: This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided. .. seealso:: `GetBitmapLabel <#GetBitmapLabel>`_ -------- .. method:: SetBitmapSelected(bitmap) Sets the bitmap for the selected (depressed) button appearance. **Parameters:** * `bitmap` (`wx.Bitmap `_): The bitmap to set. -------- .. method:: SetMargins(x, y) | **Parameters:** * `x` (int) * `y` (int) -------- Properties ^^^^^^^^^^ .. attribute:: BitmapDisabled See `GetBitmapDisabled <#GetBitmapDisabled>`_ and `SetBitmapDisabled <#SetBitmapDisabled>`_ .. attribute:: BitmapFocus See `GetBitmapFocus <#GetBitmapFocus>`_ and `SetBitmapFocus <#SetBitmapFocus>`_ .. attribute:: BitmapHover See `GetBitmapHover <#GetBitmapHover>`_ and `SetBitmapHover <#SetBitmapHover>`_ .. attribute:: BitmapLabel See `GetBitmapLabel <#GetBitmapLabel>`_ and `SetBitmapLabel <#SetBitmapLabel>`_ .. attribute:: BitmapSelected See `GetBitmapSelected <#GetBitmapSelected>`_ and `SetBitmapSelected <#SetBitmapSelected>`_ .. attribute:: MarginX See `GetMarginX <#GetMarginX>`_ .. attribute:: MarginY See `GetMarginY <#GetMarginY>`_