Package wx :: Package lib :: Package agw :: Module aquabutton :: Class AquaButton

[frames | no frames]

## Type AquaButton

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

This is the main class implementation of L{AquaButton}.

Method Summary
| ``__init__`(self, parent, id, bitmap, label, pos, size, style, validator, name)` Default class constructor.
| ``AcceptsFocus`(self)` Overridden base class virtual.
| ``DoGetBestSize`(self)` Overridden base class virtual.
| ``Enable`(self, enable)` Enables/disables the button.
| ``GetBackgroundColour`(self)` Returns the button colour when the mouse is not hovering on the button.
| ``GetDefaultAttributes`(self)` Overridden base class virtual.
| ``GetForegroundColour`(self)` Returns the text colour for L{AquaButton}.
| ``GetHoverColor`(self)` Returns the button colour when the mouse is hovering on the button.
| ``GetHoverColour`(self)` Returns the button colour when the mouse is hovering on the button.
| ``GetPath`(self, gc, rc, r)` Returns a rounded GraphicsPath.
| ``GetPulseOnFocus`(self)` Returns whether the pulsing effect is active.
| ``Invalidate`(self)` Invalidate the saved bitmap and refresh the button.
| ``LightColour`(self, color, percent)` Return light contrast of color.
| ``Notify`(self)` Actually sends a wx.EVT_BUTTON event to the listener (if any).
| ``OnGainFocus`(self, event)` Handles the wx.EVT_SET_FOCUS event for L{AquaButton}.
| ``OnKeyDown`(self, event)` Handles the wx.EVT_KEY_DOWN event for L{AquaButton}.
| ``OnKeyUp`(self, event)` Handles the wx.EVT_KEY_UP event for L{AquaButton}.
| ``OnLeftDown`(self, event)` Handles the wx.EVT_LEFT_DOWN event for L{AquaButton}.
| ``OnLeftUp`(self, event)` Handles the wx.EVT_LEFT_UP event for L{AquaButton}.
| ``OnLoseFocus`(self, event)` Handles the wx.EVT_KILL_FOCUS event for L{AquaButton}.
| ``OnMouseEnter`(self, event)` Handles the wx.EVT_ENTER_WINDOW event for L{AquaButton}.
| ``OnMouseLeave`(self, event)` Handles the wx.EVT_LEAVE_WINDOW event for L{AquaButton}.
| ``OnPaint`(self, event)` Handles the wx.EVT_PAINT event for L{AquaButton}.
| ``OnPulseTimer`(self, event)` Handles the wx.EVT_TIMER event for L{AquaButton} (only when pulseOnFocus is True).
| ``OnSize`(self, event)` Handles the wx.EVT_SIZE event for L{AquaButton}.
| ``SetBackgroundColor`(self, colour)` Sets the button colour when the mouse is not hovering on the button.
| ``SetBackgroundColour`(self, colour)` Sets the button colour when the mouse is not hovering on the button.
| ``SetBestSize`(self, size)` Given the current font and bezel width settings, calculate and set a good size.
| ``SetDefault`(self)` Sets the default button.
| ``SetForegroundColour`(self, colour)` Sets the text colour for L{AquaButton}.
| ``SetHoverColor`(self, colour)` Sets the button colour when the mouse is hovering on the button.
| ``SetHoverColour`(self, colour)` Sets the button colour when the mouse is hovering on the button.
| ``SetInitialSize`(self, size)` Given the current font and bezel width settings, calculate and set a good size.
| ``SetPulseOnFocus`(self, pulse)` Whether to enable the pulsing effect on gaining focus or not.
| ``ShouldInheritColours`(self)` Overridden base class virtual.

Property Summary

Instance Method Details

### __init__(self, parent, id=-1, bitmap=None, label='', pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=2097152, validator=<wx._core.Validator; proxy of <Swig Object of type 'wxVal..., name='aquabutton')
(Constructor)

Default class constructor.

@param parent: the L{AquaButton} parent. @param id: the button id; @param bitmap: the button bitmap (if any); @param label: the button text label; @param pos: the button position; @param size: the button size; @param style: the button style (unused); @param validator: the validator associated to the button; @param name: the button name.

  Overrides:
    `wx.PyControl.__init__`

### 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`

### Enable(self, enable=True)

Enables/disables the button.

  Overrides:
    `wx.Window.Enable`

### GetBackgroundColour(self)

Returns the button colour when the mouse is not hovering on the button.

  Overrides:
    `wx.Window.GetBackgroundColour`

### GetDefaultAttributes(self)

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

  Overrides:
    `wx.PyControl.GetDefaultAttributes`

### GetForegroundColour(self)

Returns the text colour for L{AquaButton}.

  Overrides:
    `wx.Window.GetForegroundColour`

### GetHoverColor(self)

Returns the button colour when the mouse is hovering on the button.

### GetHoverColour(self)

Returns the button colour when the mouse is hovering on the button.

### GetPath(self, gc, rc, r)

Returns a rounded GraphicsPath.

### GetPulseOnFocus(self)

Returns whether the pulsing effect is active.

### Invalidate(self)

Invalidate the saved bitmap and refresh the button.

### LightColour(self, color, percent)

Return light contrast of color. The color returned is from the scale of color -> white. The percent determines how light the color will be. Percent = 100 return white, percent = 0 returns color.

### Notify(self)

Actually sends a wx.EVT_BUTTON event to the listener (if any).

### OnGainFocus(self, event)

Handles the wx.EVT_SET_FOCUS event for L{AquaButton}.

### OnKeyDown(self, event)

Handles the wx.EVT_KEY_DOWN event for L{AquaButton}.

### OnKeyUp(self, event)

Handles the wx.EVT_KEY_UP event for L{AquaButton}.

### OnLeftDown(self, event)

Handles the wx.EVT_LEFT_DOWN event for L{AquaButton}.

### OnLeftUp(self, event)

Handles the wx.EVT_LEFT_UP event for L{AquaButton}.

### OnLoseFocus(self, event)

Handles the wx.EVT_KILL_FOCUS event for L{AquaButton}.

### OnMouseEnter(self, event)

Handles the wx.EVT_ENTER_WINDOW event for L{AquaButton}.

### OnMouseLeave(self, event)

Handles the wx.EVT_LEAVE_WINDOW event for L{AquaButton}.

### OnPaint(self, event)

Handles the wx.EVT_PAINT event for L{AquaButton}.

### OnPulseTimer(self, event)

Handles the wx.EVT_TIMER event for L{AquaButton} (only when pulseOnFocus is True).

### OnSize(self, event)

Handles the wx.EVT_SIZE event for L{AquaButton}.

### SetBackgroundColor(self, colour)

Sets the button colour when the mouse is not hovering on the button.

  Overrides:
    `wx.Window.SetBackgroundColour`

### SetBackgroundColour(self, colour)

Sets the button colour when the mouse is not hovering on the button.

  Overrides:
    `wx.Window.SetBackgroundColour`

### SetBestSize(self, size=None)

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

  Overrides:
    `wx.Window.SetInitialSize`

### SetDefault(self)

Sets the default button.

### SetForegroundColour(self, colour)

Sets the text colour for L{AquaButton}.

  Overrides:
    `wx.Window.SetForegroundColour`

### SetHoverColor(self, colour)

Sets the button colour when the mouse is hovering on the button.

### SetHoverColour(self, colour)

Sets the button colour when the mouse is hovering on the button.

### SetInitialSize(self, size=None)

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

  Overrides:
    `wx.Window.SetInitialSize`

### SetPulseOnFocus(self, pulse)

Whether to enable the pulsing effect on gaining focus or not.

### ShouldInheritColours(self)

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

  Overrides:
    `wx.Window.ShouldInheritColours`

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:51:57 2009 | http://epydoc.sf.net