wx.lib.buttons.GenBitmapButton¶
A generic bitmap button.
Class Hierarchy¶
Known Subclasses¶
wx.lib.buttons.GenBitmapTextButton
, wx.lib.buttons.GenBitmapToggleButton
, wx.lib.buttons.ThemedGenBitmapButton
, wx.lib.colourselect.ColourSelect
Known Superclasses¶
Methods Summary¶
Default class constructor. |
|
Returns the bitmap for the button’s disabled state, which may be invalid. |
|
Returns the bitmap for the button’s focused state, which may be invalid. |
|
Returns the bitmap for the button’s normal state. |
|
Returns the bitmap for the button’s pressed state, which may be invalid. |
|
Sets the bitmap for the disabled button appearance. |
|
Sets the bitmap for the focused button appearance. |
|
Set the bitmap to display normally. |
|
Sets the bitmap for the selected (depressed) button appearance. |
Class API¶
- class GenBitmapButton(GenButton)¶
A generic bitmap button.
Methods¶
- __init__(self, parent, id=-1, bitmap=wx.NullBitmap, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, validator=wx.DefaultValidator, name='genbutton')¶
Default class constructor.
- Parameters:
parent (wx.Window) – parent window. Must not be
None
;id (integer) – window identifier. A value of -1 indicates a default value;
bitmap (wx.Bitmap) – the button bitmap;
pos (tuple or
wx.Point
) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;size (tuple or
wx.Size
) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;style (integer) – the button style;
validator (wx.Validator) – the validator associated to the button;
name (string) – the button name.
See also
wx.Button
for a list of valid window styles.
- DrawLabel(self, dc, width, height, dx=0, dy=0)¶
- GetBitmapDisabled(self)¶
Returns the bitmap for the button’s disabled state, which may be invalid.
- Return type:
See also
- GetBitmapFocus(self)¶
Returns the bitmap for the button’s focused state, which may be invalid.
- Return type:
See also
- GetBitmapLabel(self)¶
Returns the bitmap for the button’s normal state.
- Return type:
See also
- GetBitmapSelected(self)¶
Returns the bitmap for the button’s pressed state, which may be invalid.
- Return type:
See also
- SetBitmapDisabled(self, bitmap)¶
Sets the bitmap for the disabled button appearance.
- Parameters:
bitmap (wx.Bitmap) – the bitmap for the disabled button appearance.
- SetBitmapFocus(self, bitmap)¶
Sets the bitmap for the focused button appearance.
- Parameters:
bitmap (wx.Bitmap) – the bitmap for the focused button appearance.
- 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.- Parameters:
bitmap (wx.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.