Module GradientButton :: Class GradientButton
[hide private]
[frames] | no frames]

Class GradientButton

source code

     object --+                    
              |                    
wx._core.Object --+                
                  |                
wx._core.EvtHandler --+            
                      |            
        wx._core.Window --+        
                          |        
           wx._core.Control --+    
                              |    
         wx._controls.PyControl --+
                                  |
                                 GradientButton

This is the main class implementation of GradientButton.

Instance Methods [hide private]
EvtHandler
__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 'wxValidato..., name='gradientbutton')
Default class constructor.
source code
 
LightColour(self, color, percent)
Return light contrast of color.
source code
 
OnSize(self, event)
Handles the wx.EVT_SIZE event for GradientButton.
source code
 
OnLeftDown(self, event)
Handles the wx.EVT_LEFT_DOWN event for GradientButton.
source code
 
OnLeftUp(self, event)
Handles the wx.EVT_LEFT_UP event for GradientButton.
source code
 
OnMouseEnter(self, event)
Handles the wx.EVT_ENTER_WINDOW event for GradientButton.
source code
 
OnMouseLeave(self, event)
Handles the wx.EVT_LEAVE_WINDOW event for GradientButton.
source code
 
OnGainFocus(self, event)
Handles the wx.EVT_SET_FOCUS event for GradientButton.
source code
 
OnLoseFocus(self, event)
Handles the wx.EVT_KILL_FOCUS event for GradientButton.
source code
 
OnKeyDown(self, event)
Handles the wx.EVT_KEY_DOWN event for GradientButton.
source code
 
OnKeyUp(self, event)
Handles the wx.EVT_KEY_UP event for GradientButton.
source code
 
OnPaint(self, event)
Handles the wx.EVT_PAINT event for GradientButton.
source code
 
GetPath(self, gc, rc, r)
Returns a rounded GraphicsPath.
source code
 
SetInitialSize(self, size=None)
Given the current font and bezel width settings, calculate and set a good size.
source code
 
SetBestSize(self, size=None)
Given the current font and bezel width settings, calculate and set a good size.
source code
bool
AcceptsFocus(self)
Overridden base class virtual.
source code
VisualAttributes
GetDefaultAttributes(self)
Overridden base class virtual.
source code
bool
ShouldInheritColours(self)
Overridden base class virtual.
source code
 
Enable(self, enable=True)
Enables/disables the button.
source code
 
SetTopStartColour(self, colour)
Sets the top start colour for the gradient shading.
source code
 
GetTopStartColour(self)
Returns the top start colour for the gradient shading.
source code
 
SetTopEndColour(self, colour)
Sets the top end colour for the gradient shading.
source code
 
GetTopEndColour(self)
Returns the top end colour for the gradient shading.
source code
 
SetBottomStartColour(self, colour)
Sets the top bottom colour for the gradient shading.
source code
 
GetBottomStartColour(self)
Returns the bottom start colour for the gradient shading.
source code
 
SetBottomEndColour(self, colour)
Sets the bottom end colour for the gradient shading.
source code
 
GetBottomEndColour(self)
Returns the bottom end colour for the gradient shading.
source code
 
SetPressedTopColour(self, colour)
Sets the pressed top start colour for the gradient shading.
source code
 
GetPressedTopColour(self)
Returns the pressed top start colour for the gradient shading.
source code
 
SetPressedBottomColour(self, colour)
Sets the pressed bottom start colour for the gradient shading.
source code
 
GetPressedBottomColour(self)
Returns the pressed bottom start colour for the gradient shading.
source code
 
SetForegroundColour(self, colour)
Sets the GradientButton foreground (text) colour.
source code
Size
DoGetBestSize(self)
Overridden base class virtual.
source code
 
SetDefault(self)
Sets the default button.
source code
 
Notify(self)
Actually sends a wx.EVT_BUTTON event to the listener (if any).
source code

Inherited from wx._controls.PyControl: DoEraseBackground, DoGetClientSize, DoGetPosition, DoGetSize, DoGetVirtualSize, DoMoveWindow, DoSetClientSize, DoSetSize, DoSetVirtualSize, OnInternalIdle, __repr__, base_AcceptsFocus, base_AcceptsFocusFromKeyboard, base_AddChild, base_DoGetBestSize, base_DoGetClientSize, base_DoGetPosition, base_DoGetSize, base_DoGetVirtualSize, base_DoMoveWindow, base_DoSetClientSize, base_DoSetSize, base_DoSetVirtualSize, base_GetDefaultAttributes, base_GetMaxSize, base_InitDialog, base_OnInternalIdle, base_RemoveChild, base_ShouldInheritColours, base_TransferDataFromWindow, base_TransferDataToWindow, base_Validate

Inherited from wx._controls.PyControl (private): _setCallbackInfo

Inherited from wx._core.Control: Command, Create, GetAlignment, GetLabelText

Inherited from wx._core.Window: AcceptsFocusFromKeyboard, AddChild, AdjustForLayoutDirection, AssociateHandle, CacheBestSize, CanSetTransparent, CaptureMouse, Center, CenterOnParent, Centre, CentreOnParent, ClearBackground, ClientToScreen, ClientToScreenXY, ClientToWindowSize, Close, ConvertDialogPointToPixels, ConvertDialogSizeToPixels, ConvertPixelPointToDialog, ConvertPixelSizeToDialog, DLG_PNT, DLG_SZE, Destroy, DestroyChildren, Disable, DissociateHandle, DragAcceptFiles, FindWindowById, FindWindowByLabel, FindWindowByName, Fit, FitInside, Freeze, GetAcceleratorTable, GetAdjustedBestSize, GetAutoLayout, GetBackgroundColour, GetBackgroundStyle, GetBestFittingSize, GetBestSize, GetBestSizeTuple, GetBestVirtualSize, GetBorder, GetCaret, GetCharHeight, GetCharWidth, GetChildren, GetClientAreaOrigin, GetClientRect, GetClientSize, GetClientSizeTuple, GetConstraints, GetContainingSizer, GetCursor, GetDropTarget, GetEffectiveMinSize, GetEventHandler, GetExtraStyle, GetFont, GetForegroundColour, GetFullTextExtent, GetGrandParent, GetGtkWidget, GetHandle, GetHelpText, GetHelpTextAtPoint, GetId, GetLabel, GetLayoutDirection, GetMaxHeight, GetMaxSize, GetMaxWidth, GetMinHeight, GetMinSize, GetMinWidth, GetName, GetParent, GetPosition, GetPositionTuple, GetRect, GetScreenPosition, GetScreenPositionTuple, GetScreenRect, GetScrollPos, GetScrollRange, GetScrollThumb, GetSize, GetSizeTuple, GetSizer, GetTextExtent, GetThemeEnabled, GetToolTip, GetTopLevelParent, GetUpdateClientRect, GetUpdateRegion, GetValidator, GetVirtualSize, GetVirtualSizeTuple, GetWindowBorderSize, GetWindowStyle, GetWindowStyleFlag, GetWindowVariant, HasCapture, HasFlag, HasMultiplePages, HasScrollbar, HasTransparentBackground, Hide, HitTest, HitTestXY, InheritAttributes, InheritsBackgroundColour, InitDialog, InvalidateBestSize, IsBeingDeleted, IsDoubleBuffered, IsEnabled, IsExposed, IsExposedPoint, IsExposedRect, IsFrozen, IsRetained, IsShown, IsShownOnScreen, IsTopLevel, Layout, LineDown, LineUp, Lower, MakeModal, Move, MoveAfterInTabOrder, MoveBeforeInTabOrder, MoveXY, Navigate, PageDown, PageUp, PopEventHandler, PopupMenu, PopupMenuXY, PostCreate, PrepareDC, PushEventHandler, Raise, Refresh, RefreshRect, RegisterHotKey, ReleaseMouse, RemoveChild, RemoveEventHandler, Reparent, ScreenToClient, ScreenToClientXY, ScrollLines, ScrollPages, ScrollWindow, SendSizeEvent, SetAcceleratorTable, SetAutoLayout, SetBackgroundColour, SetBackgroundStyle, SetBestFittingSize, SetCaret, SetClientRect, SetClientSize, SetClientSizeWH, SetConstraints, SetContainingSizer, SetCursor, SetDimensions, SetDoubleBuffered, SetDropTarget, SetEventHandler, SetExtraStyle, SetFocus, SetFocusFromKbd, SetFont, SetHelpText, SetHelpTextForId, SetId, SetLabel, SetLayoutDirection, SetMaxSize, SetMinSize, SetName, SetOwnBackgroundColour, SetOwnFont, SetOwnForegroundColour, SetPosition, SetRect, SetScrollPos, SetScrollbar, SetSize, SetSizeHints, SetSizeHintsSz, SetSizeWH, SetSizer, SetSizerAndFit, SetThemeEnabled, SetToolTip, SetToolTipString, SetTransparent, SetValidator, SetVirtualSize, SetVirtualSizeHints, SetVirtualSizeHintsSz, SetVirtualSizeWH, SetWindowStyle, SetWindowStyleFlag, SetWindowVariant, Show, Thaw, ToggleWindowStyle, TransferDataFromWindow, TransferDataToWindow, UnregisterHotKey, Update, UpdateWindowUI, UseBgCol, Validate, WarpPointer, WindowToClientSize

Inherited from wx._core.EvtHandler: AddPendingEvent, Bind, Connect, Disconnect, GetEvtHandlerEnabled, GetNextHandler, GetPreviousHandler, ProcessEvent, ProcessPendingEvents, SetEvtHandlerEnabled, SetNextHandler, SetPreviousHandler, Unbind

Inherited from wx._core.EvtHandler (private): _setOORInfo

Inherited from wx._core.Object: GetClassName, IsSameAs

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Static Methods [hide private]

Inherited from wx._core.Control: GetClassDefaultAttributes

Inherited from wx._core.Window: FindFocus, GetCapture, NewControlId, NextControlId, PrevControlId

Properties [hide private]

Inherited from wx._controls.PyControl: thisown

Inherited from wx._core.Control: Alignment, LabelText

Inherited from wx._core.Window: AcceleratorTable, AutoLayout, BackgroundColour, BackgroundStyle, BestSize, BestVirtualSize, Border, Caret, CharHeight, CharWidth, Children, ClientAreaOrigin, ClientRect, ClientSize, Constraints, ContainingSizer, Cursor, DefaultAttributes, DropTarget, EffectiveMinSize, Enabled, EventHandler, ExtraStyle, Font, ForegroundColour, GrandParent, GtkWidget, Handle, HelpText, Id, Label, LayoutDirection, MaxHeight, MaxSize, MaxWidth, MinHeight, MinSize, MinWidth, Name, Parent, Position, Rect, ScreenPosition, ScreenRect, Shown, Size, Sizer, ThemeEnabled, ToolTip, TopLevel, TopLevelParent, UpdateClientRect, UpdateRegion, Validator, VirtualSize, WindowStyle, WindowStyleFlag, WindowVariant

Inherited from wx._core.EvtHandler: EvtHandlerEnabled, NextHandler, PreviousHandler

Inherited from wx._core.Object: ClassName

Inherited from object: __class__

Method Details [hide private]

__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 'wxValidato..., name='gradientbutton')
(Constructor)

source code 

Default class constructor.

Parameters:
  • parent - the AquaButton parent.
  • id - the button id;
  • bitmap - the button bitmap (if any);
  • label - the button text label;
  • pos - the button position;
  • size - the button size;
  • style - the button style (unused);
  • validator - the validator associated to the button;
  • name - the button name.
Returns: EvtHandler
Overrides: object.__init__

LightColour(self, color, percent)

source code 

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.

OnPaint(self, event)

source code 

Handles the wx.EVT_PAINT event for GradientButton.

Overrides: wx._core.Window.OnPaint

SetInitialSize(self, size=None)

source code 

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

Overrides: wx._core.Window.SetInitialSize

SetBestSize(self, size=None)

source code 

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

Overrides: wx._controls.PyControl.SetBestSize

AcceptsFocus(self)

source code 

Overridden base class virtual.

Returns: bool
Overrides: wx._core.Window.AcceptsFocus

GetDefaultAttributes(self)

source code 

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

Returns: VisualAttributes
Overrides: wx._core.Window.GetDefaultAttributes

ShouldInheritColours(self)

source code 

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

Returns: bool
Overrides: wx._core.Window.ShouldInheritColours

Enable(self, enable=True)

source code 

Enables/disables the button.

Overrides: wx._core.Window.Enable

SetForegroundColour(self, colour)

source code 

Sets the GradientButton foreground (text) colour.

Overrides: wx._core.Window.SetForegroundColour

DoGetBestSize(self)

source code 

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

Returns: Size
Overrides: wx._controls.PyControl.DoGetBestSize