wx.lib.colourselect.ColourSelect¶
A subclass of wx.lib.buttons.GenBitmapButton
that,
when clicked, will display a colour selection dialog.
Class Hierarchy¶
Known Superclasses¶
wx.lib.buttons.GenBitmapButton
Methods Summary¶
Default class constructor. |
|
Returns the current colour set for the |
|
Returns the current set of custom colour values to be shown in the |
|
Returns the current text label for the |
|
Returns the current colour set for the |
|
Creates a bitmap representation of the current selected colour. |
|
Fires the |
|
Handles the |
|
Sets the bitmap representation of the current selected colour to the button. |
|
Sets the current colour for |
|
Sets the list of custom colour values to be shown in colour dialog, if |
|
Sets the new text label for |
|
Sets the current colour for |
Properties Summary¶
Returns the current colour set for the |
|
Returns the current set of custom colour values to be shown in the |
|
Returns the current text label for the |
|
Returns the current colour set for the |
Class API¶
- class ColourSelect(wx.lib.buttons.GenBitmapButton)¶
A subclass of
wx.lib.buttons.GenBitmapButton
that, when clicked, will display a colour selection dialog.
Methods¶
- __init__(self, parent, id=wx.ID_ANY, label='', colour=wx.BLACK, pos=wx.DefaultPosition, size=wx.DefaultSize, callback=None, style=0)¶
Default class constructor.
- Parameters:
parent (wx.Window) – parent window. Must not be
None
;id (integer) – window identifier. A value of -1 indicates a default value;
label (string) – the button text label;
wx.Colour – a valid
wx.Colour
instance, which will be the default initial colour for this button;pos (tuple or
wx.Point
) – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;size (tuple or
wx.Size
) – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;callback (PyObject) – a callable method/function that will be called every time the user chooses a new colour;
style (integer) – the button style.
- GetColour(self)¶
Returns the current colour set for the
ColourSelect
.- Return type:
- GetCustomColours(self)¶
Returns the current set of custom colour values to be shown in the colour dialog, if supported.
- Return type:
- GetLabel(self)¶
Returns the current text label for the
ColourSelect
.- Return type:
string
- GetValue(self)¶
Returns the current colour set for the
ColourSelect
. Same asGetColour
.- Return type:
- MakeBitmap(self)¶
Creates a bitmap representation of the current selected colour.
- OnChange(self)¶
Fires the
EVT_COLOURSELECT
event, as the user has changed the current colour.
- OnClick(self, event)¶
Handles the
wx.EVT_BUTTON
event forColourSelect
.- Parameters:
event – a
wx.CommandEvent
event to be processed.
- SetBitmap(self, bmp)¶
Sets the bitmap representation of the current selected colour to the button.
- Parameters:
bmp (wx.Bitmap) – the new bitmap.
- SetColour(self, colour)¶
Sets the current colour for
ColourSelect
.- Parameters:
colour (tuple or string or
wx.Colour
) – the new colour forColourSelect
.
- SetCustomColours(self, colours)¶
Sets the list of custom colour values to be shown in colour dialog, if supported.
- Parameters:
colours – An instance of
CustomColourData
or a 16
element list of
None
orwx.Colour
values.
- SetLabel(self, label)¶
Sets the new text label for
wx.ColourSelect
.- Parameters:
label (string) – the new text label for
ColourSelect
.
- SetValue(self, colour)¶
Sets the current colour for
ColourSelect
. Same asSetColour
.- Parameters:
colour (tuple or string or
wx.Colour
) – the new colour forColourSelect
.
Properties¶
- Colour¶
Returns the current colour set for the
ColourSelect
.- Return type:
- CustomColours¶
Returns the current set of custom colour values to be shown in the colour dialog, if supported.
- Return type:
- Label¶
Returns the current text label for the
ColourSelect
.- Return type:
string
- Value¶
Returns the current colour set for the
ColourSelect
. Same asGetColour
.- Return type: