Phoenix Logo

phoenix_title wx.lib.colourselect.ColourSelect

A subclass of wx.BitmapButton that, when clicked, will display a colour selection dialog.


class_hierarchy Class Hierarchy

Inheritance diagram for class ColourSelect:


method_summary Methods Summary

__init__ Default class constructor.
GetColour Returns the current colour set for the ColourSelect.
GetCustomColours Returns the current set of custom colour values to be shown in the
GetLabel Returns the current text label for the ColourSelect.
GetValue Returns the current colour set for the ColourSelect.
MakeBitmap Creates a bitmap representation of the current selected colour.
OnChange Fires the EVT_COLOURSELECT event, as the user has changed the current colour.
OnClick Handles the wx.EVT_BUTTON event for ColourSelect.
SetBitmap Sets the bitmap representation of the current selected colour to the button.
SetColour Sets the current colour for ColourSelect.
SetCustomColours Sets the list of custom colour values to be shown in colour dialog, if
SetLabel Sets the new text label for wx.ColourSelect.
SetValue Sets the current colour for ColourSelect. Same as

property_summary Properties Summary

Colour Returns the current colour set for the ColourSelect.
CustomColours Returns the current set of custom colour values to be shown in the
Label Returns the current text label for the ColourSelect.
Value Returns the current colour set for the ColourSelect.

api Class API



class ColourSelect(wx.lib.buttons.GenBitmapButton)

A subclass of wx.BitmapButton 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:wx.Colour


GetCustomColours(self)

Returns the current set of custom colour values to be shown in the colour dialog, if supported.

Return type:CustomColourData


GetLabel(self)

Returns the current text label for the ColourSelect.

Return type:string


GetValue(self)

Returns the current colour set for the ColourSelect. Same as GetColour.

Return type:wx.Colour


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 for ColourSelect.

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 for ColourSelect.


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 or wx.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 as SetColour.

Parameters:colour (tuple or string or wx.Colour) – the new colour for ColourSelect.

Properties



Colour

Returns the current colour set for the ColourSelect.

Return type:wx.Colour


CustomColours

Returns the current set of custom colour values to be shown in the colour dialog, if supported.

Return type:CustomColourData


Label

Returns the current text label for the ColourSelect.

Return type:string


Value

Returns the current colour set for the ColourSelect. Same as GetColour.

Return type:wx.Colour