AGW Logo

agw_title SBitmapButton

Subclass of SButton which displays a bitmap, acting like a wx.BitmapButton.

hierarchy Inheritance Diagram

Inheritance diagram for: SBitmapButton

Inheritance diagram of SBitmapButton


supclasses Known Superclasses


appearance Control Appearance


SBitmapButton

SBitmapButton


method_summary Methods Summary

__init__Default class constructor.
DrawLabelDraws the bitmap in the middle of the button.
GetBitmapDisabledReturns the bitmap displayed when the button is disabled.
GetBitmapFocusReturns the bitmap displayed when the button has the focus.
GetBitmapLabelReturns the bitmap associated with the button in the normal state.
GetBitmapSelectedReturns the bitmap displayed when the button is selected (pressed).
SetBitmapDisabledSets the bitmap to display when the button is disabled.
SetBitmapFocusSets the bitmap to display when the button has the focus.
SetBitmapLabelSets the bitmap to display normally.
SetBitmapSelectedSets the bitmap to display when the button is selected (pressed).
_GetLabelSizeUsed internally.

API Class API

class SBitmapButton(SButton)[source]

Subclass of SButton which displays a bitmap, acting like a wx.BitmapButton.



__init__(parent, id, bitmap, pos=wx.DefaultPosition, size=wx.DefaultSize)[source]

Default class constructor.

Parameters:
  • parent – the SBitmapButton parent. Must not be None;
  • id – window identifier. A value of -1 indicates a default value;
  • bitmap – the button bitmap (if any);
  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;
  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform.


DrawLabel(dc, width, height, dw=0, dh=0)[source]

Draws the bitmap in the middle of the button.

Parameters:
  • dc – an instance of wx.DC;
  • width – the button width;
  • height – the button height;
  • dw – width differential, to show a 3D effect;
  • dh – height differential, to show a 3D effect.


GetBitmapDisabled()[source]

Returns the bitmap displayed when the button is disabled.



GetBitmapFocus()[source]

Returns the bitmap displayed when the button has the focus.



GetBitmapLabel()[source]

Returns the bitmap associated with the button in the normal state.



GetBitmapSelected()[source]

Returns the bitmap displayed when the button is selected (pressed).



SetBitmapDisabled(bitmap)[source]

Sets the bitmap to display when the button is disabled.

Parameters:bitmap – a valid wx.Bitmap object.


SetBitmapFocus(bitmap)[source]

Sets the bitmap to display when the button has the focus.

Parameters:bitmap – a valid wx.Bitmap object.



SetBitmapLabel(bitmap, createothers=True)[source]

Sets the bitmap to display normally. This is the only one that is required.

Parameters:
  • bitmap – a valid wx.Bitmap object;

  • createothers – if set to True, then the other bitmaps will be generated on the fly. Currently, only the disabled bitmap is generated.


SetBitmapSelected(bitmap)[source]

Sets the bitmap to display when the button is selected (pressed).

Parameters:bitmap – a valid wx.Bitmap object.

Tree

Table Of Contents

Previous topic

shapedbutton

Next topic

SBitmapTextButton