A class for common button functionality used as the base for the various button classes.
Return the bitmap shown by the button. |
|
Returns the bitmap used when the mouse is over the button. |
|
Returns the bitmap used for the disabled state. |
|
Returns the bitmap used for the focused state. |
|
Returns the bitmap for the normal state. |
|
Get the margins between the bitmap and the text of the button. |
|
Returns the bitmap used when the button is pressed. |
|
Sets the bitmap to display in the button. |
|
Sets the bitmap to be shown when the mouse is over the button. |
|
Sets the bitmap for the disabled button appearance. |
|
Sets the bitmap for the button appearance when it has the keyboard focus. |
|
Sets the bitmap label for the button. |
|
Set the margins between the bitmap and the text of the button. |
|
Set the position at which the bitmap is displayed. |
|
Sets the bitmap for the selected (depressed) button appearance. |
See |
|
See |
|
See |
|
See |
|
See |
|
See |
wx.
AnyButton
(Control)¶Possible constructors:
AnyButton()
A class for common button functionality used as the base for the various button classes.
__init__
(self)¶GetBitmap
(self)¶Return the bitmap shown by the button.
The returned bitmap may be invalid only if the button doesn’t show any images.
New in version 2.9.1.
See also
GetBitmapCurrent
(self)¶Returns the bitmap used when the mouse is over the button.
The returned bitmap is only valid if SetBitmapCurrent
had been previously called.
New in version 2.9.1: (available as BitmapButton.GetBitmapHover() in previous versions)
GetBitmapDisabled
(self)¶Returns the bitmap used for the disabled state.
The returned bitmap is only valid if SetBitmapDisabled
had been previously called.
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
GetBitmapFocus
(self)¶Returns the bitmap used for the focused state.
The returned bitmap is only valid if SetBitmapFocus
had been previously called.
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
GetBitmapLabel
(self)¶Returns the bitmap for the normal state.
This is exactly the same as GetBitmap
but uses a name backwards-compatible with wx.BitmapButton.
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
See also
GetBitmapMargins
(self)¶Get the margins between the bitmap and the text of the button.
New in version 2.9.1.
See also
GetBitmapPressed
(self)¶Returns the bitmap used when the button is pressed.
The returned bitmap is only valid if SetBitmapPressed
had been previously called.
New in version 2.9.1: (available as BitmapButton.GetBitmapSelected() in previous versions)
SetBitmap
(self, bitmap, dir=LEFT)¶Sets the bitmap to display in the button.
The bitmap is displayed together with the button label. This method sets up a single bitmap which is used in all button states, use SetBitmapDisabled
, SetBitmapPressed
, SetBitmapCurrent
or SetBitmapFocus
to change the individual images used in different states.
bitmap (wx.BitmapBundle) – The bitmap bundle containing the resolution-dependent bitmaps to display in the button. At default DPI
, the size of the bitmap is determined by the default bundle size, i.e. the value returned from wx.BitmapBundle.GetDefaultSize
. If the bitmap bundle is invalid, any currently shown bitmaps are removed from the button.
dir (Direction) – The position of the bitmap inside the button. By default it is positioned to the left of the text, near to the left button border. Other possible values include wx.RIGHT
, wx.TOP
and wx.BOTTOM
.
New in version 2.9.1.
See also
SetBitmapCurrent
(self, bitmap)¶Sets the bitmap to be shown when the mouse is over the button.
If bitmap is invalid, the normal bitmap will be used in the current state.
bitmap (wx.BitmapBundle) –
New in version 2.9.1: (available as BitmapButton.SetBitmapHover() in previous versions)
See also
SetBitmapDisabled
(self, bitmap)¶Sets the bitmap for the disabled button appearance.
If bitmap is invalid, the disabled bitmap is set to the automatically generated greyed out version of the normal bitmap, i.e. the same bitmap as is used by default if this method is not called at all. Use SetBitmap
with an invalid bitmap to remove the bitmap completely (for all states).
bitmap (wx.BitmapBundle) –
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
See also
GetBitmapDisabled
, SetBitmapLabel
, SetBitmapPressed
, SetBitmapFocus
SetBitmapFocus
(self, bitmap)¶Sets the bitmap for the button appearance when it has the keyboard focus.
If bitmap is invalid, the normal bitmap will be used in the focused state.
bitmap (wx.BitmapBundle) –
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
See also
GetBitmapFocus
, SetBitmapLabel
, SetBitmapPressed
, SetBitmapDisabled
SetBitmapLabel
(self, bitmap)¶Sets the bitmap label for the button.
bitmap (wx.BitmapBundle) –
New in version 2.9.1: (available in wx.BitmapButton only in previous versions)
Note
This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided.
See also
SetBitmapMargins
(self, *args, **kw)¶Set the margins between the bitmap and the text of the button.
This method is currently only implemented under MSW. If it is not called, default margin is used around the bitmap.
New in version 2.9.1.
See also
SetBitmapMargins (self, x, y)
x (int) –
y (int) –
SetBitmapMargins (self, sz)
sz (wx.Size) –
SetBitmapPosition
(self, dir)¶Set the position at which the bitmap is displayed.
This method should only be called if the button does have an associated bitmap.
dir (Direction) – Direction in which the bitmap should be positioned, one of wx.LEFT
, wx.RIGHT
, wx.TOP
or wx.BOTTOM
.
New in version 2.9.1.
SetBitmapPressed
(self, bitmap)¶Sets the bitmap for the selected (depressed) button appearance.
bitmap (wx.BitmapBundle) –
New in version 2.9.1: (available as BitmapButton.SetBitmapSelected() in previous versions)
BitmapCurrent
¶See GetBitmapCurrent
and SetBitmapCurrent
BitmapDisabled
¶See GetBitmapDisabled
and SetBitmapDisabled
BitmapFocus
¶See GetBitmapFocus
and SetBitmapFocus
BitmapLabel
¶See GetBitmapLabel
and SetBitmapLabel
BitmapMargins
¶See GetBitmapMargins
and SetBitmapMargins
BitmapPressed
¶See GetBitmapPressed
and SetBitmapPressed