Package wx :: Package lib :: Module buttons :: Class GenButton

[frames | no frames]

## Type GenButton

    object --+
             |
        Object --+
                 |
        EvtHandler --+
                     |
                Window --+
                         |
                   Control --+
                             |
                     PyControl --+
                                 |
                                GenButton

Known Subclasses:
  `FontSelect`, `GenBitmapButton`, `GenToggleButton`, `ThemedGenButton`

A generic button, and base class for the other generic buttons.

Method Summary
| `__init__(self, parent, id, label, pos, size, style, validator, name)`
| ``AcceptsFocus`(self)` Overridden base class virtual.
| ``DoGetBestSize`(self)` Overridden base class virtual.
| `DrawBezel(self, dc, x1, y1, x2, y2)`
| `DrawFocusIndicator(self, dc, w, h)`
| `DrawLabel(self, dc, width, height, dw, dy)`
| `Enable(self, enable)`
| `GetBackgroundBrush(self, dc)`
| ``GetBezelWidth`(self)` Return the width of the 3D effect
| ``GetDefaultAttributes`(self)` Overridden base class virtual.
| ``GetUseFocusIndicator`(self)` Return focus indicator flag
| ``InitColours`(self)` Calculate a new set of highlight and shadow colours based on the background colour.
| `Notify(self)`
| `OnGainFocus(self, event)`
| `OnKeyDown(self, event)`
| `OnKeyUp(self, event)`
| `OnLeftDown(self, event)`
| `OnLeftUp(self, event)`
| `OnLoseFocus(self, event)`
| `OnMotion(self, event)`
| `OnPaint(self, event)`
| `SetBackgroundColour(self, colour)`
| ``SetBestSize`(self, size)` Given the current font and bezel width settings, calculate and set a good size.
| ``SetBezelWidth`(self, width)` Set the width of the 3D effect
| `SetDefault(self)`
| `SetForegroundColour(self, colour)`
| ``SetInitialSize`(self, size)` Given the current font and bezel width settings, calculate and set a good size.
| ``SetUseFocusIndicator`(self, flag)` Specifiy if a focus indicator (dotted line) should be used
| ``ShouldInheritColours`(self)` Overridden base class virtual.

Property Summary

Class Variable Summary
`int` | `labelDelta` = 1

Instance Method Details

### AcceptsFocus(self)

Overridden base class virtual.

  Overrides:
    `wx.Window.AcceptsFocus`

### DoGetBestSize(self)

Overridden base class virtual. Determines the best size of the button based on the label and bezel size.

  Overrides:
    `wx.PyControl.DoGetBestSize`

### GetBezelWidth(self)

Return the width of the 3D effect

### GetDefaultAttributes(self)

Overridden base class virtual. By default we should use the same font/colour attributes as the native Button.

  Overrides:
    `wx.PyControl.GetDefaultAttributes`

### GetUseFocusIndicator(self)

Return focus indicator flag

### InitColours(self)

Calculate a new set of highlight and shadow colours based on the background colour. Works okay if the colour is dark...

### SetBestSize(self, size=None)

Given the current font and bezel width settings, calculate and set a good size.

  Overrides:
    `wx.Window.SetInitialSize`

### SetBezelWidth(self, width)

Set the width of the 3D effect

### SetInitialSize(self, size=None)

Given the current font and bezel width settings, calculate and set a good size.

  Overrides:
    `wx.Window.SetInitialSize`

### SetUseFocusIndicator(self, flag)

Specifiy if a focus indicator (dotted line) should be used

### ShouldInheritColours(self)

Overridden base class virtual. Buttons usually don't inherit the parent's colours.

  Overrides:
    `wx.Window.ShouldInheritColours`

Class Variable Details

### labelDelta

  Type:
    `int`
  Value:

        1

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:09:53 2007 | http://epydoc.sf.net