A generic button, and base class for the other generic buttons.
wx.lib.analogclock.lib_setup.fontselect.FontSelect
, wx.lib.buttons.GenBitmapButton
, wx.lib.buttons.GenToggleButton
, wx.lib.buttons.ThemedGenButton
__init__ |
Default class constructor. |
AcceptsFocus |
Can this window be given focus by mouse click? |
DoGetBestSize |
Overridden base class virtual. Determines the best size of the |
DrawBezel |
|
DrawFocusIndicator |
|
DrawLabel |
|
Enable |
Enables/disables the button. |
GetBackgroundBrush |
Returns the current wx.Brush to be used to draw the button background. |
GetBezelWidth |
Returns the width of the 3D effect, in pixels. |
GetDefaultAttributes |
Overridden base class virtual. By default we should use |
GetUseFocusIndicator |
Returns the focus indicator flag, specifying if a focus indicator |
InitColours |
Calculate a new set of highlight and shadow colours based on |
InitOtherEvents |
Override this method in a subclass to initialize any other events that |
Notify |
Actually sends a wx.EVT_BUTTON event to the listener (if any). |
OnGainFocus |
Handles the wx.EVT_SET_FOCUS event for GenButton . |
OnKeyDown |
Handles the wx.EVT_KEY_DOWN event for GenButton . |
OnKeyUp |
Handles the wx.EVT_KEY_UP event for GenButton . |
OnLeftDown |
Handles the wx.EVT_LEFT_DOWN event for GenButton . |
OnLeftUp |
Handles the wx.EVT_LEFT_UP event for GenButton . |
OnLoseFocus |
Handles the wx.EVT_KILL_FOCUS event for GenButton . |
OnMotion |
Handles the wx.EVT_MOTION event for GenButton . |
OnPaint |
Handles the wx.EVT_PAINT event for GenButton . |
OnSize |
Handles the wx.EVT_SIZE event for GenButton . |
SetBackgroundColour |
Sets the GenButton background colour. |
SetBezelWidth |
Sets the width of the 3D effect. |
SetDefault |
This sets the GenButton to be the default item for |
SetForegroundColour |
Sets the wx.GenButton foreground colour. |
SetInitialSize |
Given the current font and bezel width settings, calculate |
SetUseFocusIndicator |
Specifies if a focus indicator (dotted line) should be used. |
ShouldInheritColours |
Overridden base class virtual. Buttons usually don’t inherit |
A generic button, and base class for the other generic buttons.
Default class constructor.
Parameters: |
|
---|
See also
wx.Button
for a list of valid window styles.
Can this window be given focus by mouse click?
Note
Overridden from wx.Control
.
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.Control
.
Enables/disables the button.
Parameters: | enable (bool) – True to enable the button, False to disable it. |
---|
Note
Overridden from wx.Control
.
Returns the current wx.Brush
to be used to draw the button background.
Parameters: | dc (wx.DC) – the device context used to draw the button background. |
---|
Returns the width of the 3D effect, in pixels.
Return type: | integer |
---|
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.Control
.
Returns the focus indicator flag, specifying if a focus indicator (dotted line) is being used.
Return type: | bool |
---|
Calculate a new set of highlight and shadow colours based on the background colour. Works okay if the colour is dark...
Override this method in a subclass to initialize any other events that
need to be bound. Added so __init__
doesn’t need to be
overriden, which is complicated with multiple inheritance.
Actually sends a wx.EVT_BUTTON
event to the listener (if any).
Handles the wx.EVT_SET_FOCUS
event for GenButton
.
Parameters: | event – a wx.FocusEvent event to be processed. |
---|
Handles the wx.EVT_KEY_DOWN
event for GenButton
.
Parameters: | event – a wx.KeyEvent event to be processed. |
---|
Handles the wx.EVT_KEY_UP
event for GenButton
.
Parameters: | event – a wx.KeyEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_DOWN
event for GenButton
.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_LEFT_UP
event for GenButton
.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_KILL_FOCUS
event for GenButton
.
Parameters: | event – a wx.FocusEvent event to be processed. |
---|
Handles the wx.EVT_MOTION
event for GenButton
.
Parameters: | event – a wx.MouseEvent event to be processed. |
---|
Handles the wx.EVT_PAINT
event for GenButton
.
Parameters: | event – a wx.PaintEvent event to be processed. |
---|
Handles the wx.EVT_SIZE
event for GenButton
.
Parameters: | event – a wx.SizeEvent event to be processed. |
---|
Sets the GenButton
background colour.
Parameters: | colour – a valid wx.Colour object. |
---|
Note
Overridden from wx.Control
.
Sets the width of the 3D effect.
Parameters: | width (integer) – the 3D border width, in pixels. |
---|
This sets the GenButton
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 wx.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 wx.GenButton
foreground colour.
Parameters: | colour – a valid wx.Colour object. |
---|
Note
Overridden from wx.Control
.
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 wxPython
wx.DefaultSize is used instead. |
---|
Specifies if a focus indicator (dotted line) should be used.
Parameters: | flag (bool) – True to draw a focus ring, False otherwise. |
---|
Overridden base class virtual. Buttons usually don’t inherit the parent’s colours.
Note
Overridden from wx.Control
.