wx.BitmapButton

Inheritance diagram for 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.

See also

wx.Button

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


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


Class API

Methods

__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:


Returns:

wx.BitmapButton


GetBitmapDisabled()

Returns the bitmap for the disabled state, may be invalid.


Returns:

wx.Bitmap


GetBitmapFocus()

Returns the bitmap for the focused state, may be invalid.


Returns:

wx.Bitmap

See also

SetBitmapFocus


GetBitmapHover()

Returns the bitmap used when the mouse is over the button, may be invalid.


Returns:

wx.Bitmap

See also

SetBitmapHover


GetBitmapLabel()

Returns the label bitmap (the one passed to the constructor), always valid.


Returns:

wx.Bitmap

See also

SetBitmapLabel


GetBitmapSelected()

Returns the bitmap for the pushed button state, may be invalid.


Returns:

wx.Bitmap


GetMarginX()
No docstrings available for this method.

GetMarginY()
No docstrings available for this method.

SetBitmapDisabled(bitmap)

Sets the bitmap for the disabled button appearance.

Parameters:


SetBitmapFocus(bitmap)

Sets the bitmap for the button appearance when it has the keyboard focus.

Parameters:


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:

See also

GetBitmapHover


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.

See also

GetBitmapLabel


SetBitmapSelected(bitmap)

Sets the bitmap for the selected (depressed) button appearance.

Parameters:


SetMargins(x, y)

Parameters:

  • x (int)
  • y (int)

Properties

BitmapDisabled
See GetBitmapDisabled and SetBitmapDisabled
BitmapFocus
See GetBitmapFocus and SetBitmapFocus
BitmapHover
See GetBitmapHover and SetBitmapHover
BitmapLabel
See GetBitmapLabel and SetBitmapLabel
BitmapSelected
See GetBitmapSelected and SetBitmapSelected
MarginX
See GetMarginX
MarginY
See GetMarginY