Package wx :: Class BitmapButton
[frames | no frames]

Type BitmapButton

object --+                    
         |                    
    Object --+                
             |                
    EvtHandler --+            
                 |            
            Window --+        
                     |        
               Control --+    
                         |    
                    Button --+
                             |
                            BitmapButton

Known Subclasses:
ColourSelect, ContextHelpButton, FoldOutMenu

A Button that contains a bitmap. A bitmap button can be supplied with a single bitmap, and wxWidgets 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.

Window Styles

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 label. WIN32 only.
wx.BU_TOP Aligns the label to the top of the button. WIN32 only.
wx.BU_RIGHT Right-justifies the bitmap label. WIN32 only.
wx.BU_BOTTOM Aligns the label to the bottom of the button. WIN32 only.
wx.BU_EXACTFIT Creates the button as small as possible instead of making it of the standard size (which is the default behaviour.)

Events

EVT_BUTTON Sent when the button is clicked.

See Also:

wx.Button, wx.Bitmap

Method Summary
BitmapButton __init__(self, parent, id, bitmap, pos, size, style, validator, name)
Create and show a button with a bitmap for the label.
bool Create(self, parent, id, bitmap, pos, size, style, validator, name)
Acutally create the GUI BitmapButton for 2-phase creation.
Bitmap GetBitmapDisabled(self)
Returns the bitmap for the disabled state.
Bitmap GetBitmapFocus(self)
Returns the bitmap for the focused state.
Bitmap GetBitmapHover(self)
Returns the bitmap used when the mouse is over the button, may be invalid.
Bitmap GetBitmapLabel(self)
Returns the label bitmap (the one passed to the constructor).
Bitmap GetBitmapSelected(self)
Returns the bitmap for the selected state.
int GetMarginX(self)
int GetMarginY(self)
  SetBitmapDisabled(self, bitmap)
Sets the bitmap for the disabled button appearance.
  SetBitmapFocus(self, bitmap)
Sets the bitmap for the button appearance when it has the keyboard focus.
  SetBitmapHover(self, hover)
Sets the bitmap to be shown when the mouse is over the button.
  SetBitmapLabel(self, bitmap)
Sets the bitmap label for the button.
  SetBitmapSelected(self, bitmap)
Sets the bitmap for the selected (depressed) button appearance.
  SetMargins(self, x, y)

Property Summary
  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
  thisown: The membership flag

Instance Method Details

__init__(self, parent, id=-1, bitmap=wxNullBitmap, pos=DefaultPosition, size=DefaultSize, style=BU_AUTODRAW, validator=DefaultValidator, name=ButtonNameStr)
(Constructor)

Create and show a button with a bitmap for the label.

Parameters:
parent
           (type=Window)

id
           (type=int)

bitmap
           (type=Bitmap)

pos
           (type=Point)

size
           (type=Size)

style
           (type=long)

validator
           (type=Validator)

name
           (type=String)

Returns:
BitmapButton
Overrides:
wx.Button.__init__

Create(self, parent, id=-1, bitmap=wxNullBitmap, pos=DefaultPosition, size=DefaultSize, style=BU_AUTODRAW, validator=DefaultValidator, name=ButtonNameStr)

Acutally create the GUI BitmapButton for 2-phase creation.

Parameters:
parent
           (type=Window)

id
           (type=int)

bitmap
           (type=Bitmap)

pos
           (type=Point)

size
           (type=Size)

style
           (type=long)

validator
           (type=Validator)

name
           (type=String)

Returns:
bool
Overrides:
wx.Button.Create

GetBitmapDisabled(self)

Returns the bitmap for the disabled state.

Returns:
Bitmap

GetBitmapFocus(self)

Returns the bitmap for the focused state.

Returns:
Bitmap

GetBitmapHover(self)

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

Returns:
Bitmap

GetBitmapLabel(self)

Returns the label bitmap (the one passed to the constructor).

Returns:
Bitmap

GetBitmapSelected(self)

Returns the bitmap for the selected state.

Returns:
Bitmap

SetBitmapDisabled(self, bitmap)

Sets the bitmap for the disabled button appearance.

Parameters:
bitmap
           (type=Bitmap)

SetBitmapFocus(self, bitmap)

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

Parameters:
bitmap
           (type=Bitmap)

SetBitmapHover(self, hover)

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:
hover
           (type=Bitmap)

SetBitmapLabel(self, bitmap)

Sets the bitmap label for the button. This is the bitmap used for the unselected state, and for all other states if no other bitmaps are provided.

Parameters:
bitmap
           (type=Bitmap)

SetBitmapSelected(self, bitmap)

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

Parameters:
bitmap
           (type=Bitmap)


Property Details

BitmapDisabled

See GetBitmapDisabled and SetBitmapDisabled

Get Method:
GetBitmapDisabled(self)
Set Method:
SetBitmapDisabled(self, bitmap)

BitmapFocus

See GetBitmapFocus and SetBitmapFocus

Get Method:
GetBitmapFocus(self)
Set Method:
SetBitmapFocus(self, bitmap)

BitmapHover

See GetBitmapHover and SetBitmapHover

Get Method:
GetBitmapHover(self)
Set Method:
SetBitmapHover(self, hover)

BitmapLabel

See GetBitmapLabel and SetBitmapLabel

Get Method:
GetBitmapLabel(self)
Set Method:
SetBitmapLabel(self, bitmap)

BitmapSelected

See GetBitmapSelected and SetBitmapSelected

Get Method:
GetBitmapSelected(self)
Set Method:
SetBitmapSelected(self, bitmap)

MarginX

See GetMarginX

Get Method:
GetMarginX(self)

MarginY

See GetMarginY

Get Method:
GetMarginY(self)

thisown

The membership flag


Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:55:09 2009 http://epydoc.sf.net