This is the main class implementation of AquaButton.
__init__ | Default class constructor. |
AcceptsFocus | Can this window be given focus by mouse click? .. |
DoGetBestSize | Overridden base class virtual. |
Enable | Enables/disables the button. |
GetBackgroundColour | Returns the button colour when the mouse is not hovering on the button. |
GetDefaultAttributes | Overridden base class virtual. |
GetDisabledColor | Returns the button colour when it is disabled. |
GetDisabledColour | Returns the button colour when it is disabled. |
GetForegroundColour | Returns the text colour for AquaButton. |
GetHoverColor | Returns the button colour when the mouse is hovering on the button. |
GetHoverColour | Returns the button colour when the mouse is hovering on the button. |
GetPath | Returns a rounded wx.GraphicsPath rectangle. |
GetPulseOnFocus | Returns whether the pulsing effect is active. |
Invalidate | Invalidate the saved bitmap and refresh the button. |
LightColour | Return light contrast of colour. |
Notify | Actually sends a wx.EVT_BUTTON event to the listener (if any). |
OnGainFocus | Handles the wx.EVT_SET_FOCUS event for AquaButton. |
OnKeyDown | Handles the wx.EVT_KEY_DOWN event for AquaButton. |
OnKeyUp | Handles the wx.EVT_KEY_UP event for AquaButton. |
OnLeftDown | Handles the wx.EVT_LEFT_DOWN event for AquaButton. |
OnLeftUp | Handles the wx.EVT_LEFT_UP event for AquaButton. |
OnLoseFocus | Handles the wx.EVT_KILL_FOCUS event for AquaButton. |
OnMouseEnter | Handles the wx.EVT_ENTER_WINDOW event for AquaButton. |
OnMouseLeave | Handles the wx.EVT_LEAVE_WINDOW event for AquaButton. |
OnPaint | Handles the wx.EVT_PAINT event for AquaButton. |
OnPulseTimer | Handles the wx.EVT_TIMER event for AquaButton. |
OnSize | Handles the wx.EVT_SIZE event for AquaButton. |
SetBackgroundColor | Sets the AquaButton background colour. |
SetBackgroundColour | Sets the AquaButton background colour. |
SetBestSize | Given the current font and bezel width settings, calculate and set a good size. |
SetBitmapLabel | Sets the bitmap label for the button. |
SetDefault | This sets the AquaButton to be the default item for the panel or dialog box. |
SetDisabledColor | Sets the button colour when it is disabled. |
SetDisabledColour | Sets the button colour when it is disabled. |
SetForegroundColour | Sets the AquaButton foreground (text) colour. |
SetHoverColor | Sets the button colour when the mouse is hovering on the button. |
SetHoverColour | Sets the button colour when the mouse is hovering on the button. |
SetInitialSize | Given the current font and bezel width settings, calculate and set a good size. |
SetPulseOnFocus | Sets whether to enable the pulsing effect on gaining focus or not. |
ShouldInheritColours | Overridden base class virtual. |
This is the main class implementation of AquaButton.
Default class constructor.
Parameters: |
|
---|
Can this window be given focus by mouse click?
Note
Overridden from wx.PyControl.
Overridden base class virtual. Determines the best size of the button based on the label and bezel size.
Returns: | An instance of wx.Size. |
---|
Note
Overridden from wx.PyControl.
Enables/disables the button.
Parameters: | enable (bool) – True to enable the button, False to disable it. |
---|
Note
Overridden from wx.PyControl.
Returns the button colour when the mouse is not hovering on the button.
Returns: | An instance of wx.Colour. |
---|
Note
Overridden from wx.PyControl.
Overridden base class virtual. By default we should use the same font/colour attributes as the native wx.Button.
Returns: | an instance of wx.VisualAttributes. |
---|
Note
Overridden from wx.PyControl.
Returns the button colour when it is disabled.
Returns: | An instance of wx.Colour. |
---|
Returns the button colour when it is disabled.
Returns: | An instance of wx.Colour. |
---|
Returns the text colour for AquaButton.
Returns: | An instance of wx.Colour. |
---|
Note
Overridden from wx.PyControl.
Returns the button colour when the mouse is hovering on the button.
Returns: | An instance of wx.Colour. |
---|
Returns the button colour when the mouse is hovering on the button.
Returns: | An instance of wx.Colour. |
---|
Returns a rounded wx.GraphicsPath rectangle.
Parameters: |
|
---|---|
Returns: | A rounded rectangle, an instance of wx.GraphicsPath. |
Returns whether the pulsing effect is active.
Returns: | True if the pulsing effect is active, False otherwise. |
---|
Invalidate the saved bitmap and refresh the button.
Return light contrast of colour. The colour returned is from the scale of colour ==> white.
Parameters: |
|
---|---|
Returns: | A light contrast of the input colour, an instance of wx.Colour. |
Actually sends a wx.EVT_BUTTON event to the listener (if any).
Handles the wx.EVT_SET_FOCUS event for AquaButton.
Parameters: | event – a wx.FocusEvent event to be processed. |
---|
Handles the wx.EVT_KEY_DOWN event for AquaButton.
Parameters: | event – a wx.KeyEvent event to be processed. |
---|
Handles the wx.EVT_KEY_UP event for AquaButton.
Parameters: | event – a wx.KeyEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_DOWN event for AquaButton.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_UP event for AquaButton.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_KILL_FOCUS event for AquaButton.
Parameters: | event – a wx.FocusEvent event to be processed. |
---|
Handles the wx.EVT_ENTER_WINDOW event for AquaButton.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_LEAVE_WINDOW event for AquaButton.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_PAINT event for AquaButton.
Parameters: | event – a wx.PaintEvent event to be processed. |
---|
Handles the wx.EVT_TIMER event for AquaButton.
Parameters: | event – a wx.TimerEvent event to be processed. |
---|
Note
This method is only invoked when pulseOnFocus is True.
Handles the wx.EVT_SIZE event for AquaButton.
Parameters: | event – a wx.SizeEvent event to be processed. |
---|
Sets the AquaButton background colour.
Parameters: | colour – a valid wx.Colour object. |
---|
Note
Overridden from wx.PyControl.
Sets the AquaButton background colour.
Parameters: | colour – a valid wx.Colour object. |
---|
Note
Overridden from wx.PyControl.
Given the current font and bezel width settings, calculate and set a good size.
Parameters: | size – an instance of wx.Size or None, in which case the wxWidgets wx.DefaultSize is used instead. |
---|
Sets the bitmap label for the button.
Parameters: | bitmap – the bitmap label to set, an instance of wx.Bitmap. |
---|
This sets the AquaButton to be the default item for the panel or dialog box.
Note
Under Windows, only dialog box buttons respond to this function. As normal under Windows and Motif, pressing return causes the default button to be depressed when the return key is pressed. See also wx.Window.SetFocus which sets the keyboard focus for windows and text panel items, and wx.TopLevelWindow.SetDefaultItem.
Note
Note that under Motif, calling this function immediately after creation of a button and before the creation of other buttons will cause misalignment of the row of buttons, since default buttons are larger. To get around this, call SetDefault after you have created a row of buttons: wxPython will then set the size of all buttons currently on the panel to the same size.
Sets the button colour when it is disabled.
Parameters: | colour – a valid wx.Colour object. |
---|
Sets the button colour when it is disabled.
Parameters: | colour – a valid wx.Colour object. |
---|
Sets the AquaButton foreground (text) colour.
Parameters: | colour – a valid wx.Colour object. |
---|
Note
Overridden from wx.PyControl.
Sets the button colour when the mouse is hovering on the button.
Parameters: | colour – a valid wx.Colour object. |
---|
Sets the button colour when the mouse is hovering on the button.
Parameters: | colour – a valid wx.Colour object. |
---|
Given the current font and bezel width settings, calculate and set a good size.
Parameters: | size – an instance of wx.Size or None, in which case the wxWidgets wx.DefaultSize is used instead. |
---|
Sets whether to enable the pulsing effect on gaining focus or not.
Parameters: | pulse (bool) – True to enable pulsing when the AquaButton gains focus, False to disable this effect. |
---|
Overridden base class virtual. Buttons usually don’t inherit the parent’s colours.
Note
Overridden from wx.PyControl.