******************* wx.ColourPickerCtrl ******************* Inheritance diagram for `wx.ColourPickerCtrl`: | .. inheritance-diagram:: wx.ColourPickerCtrl | Description =========== This control allows the user to select a colour. The generic implementation is a button which brings up a `wx.ColourDialog `_ when clicked. Native implementation may differ but this is usually a (small) widget which give access to the colour-chooser dialog. It is only available if ``wx.USE_COLOURPICKERCTRL`` is set to 1 (the default). .. seealso:: `wx.ColourDialog `_, `wx.ColourPickerEvent <../Events/wx.ColourPickerEvent.html>`_ Derived From ^^^^^^^^^^^^^ * `wx.PickerBase `_ * `wx.Control `_ * `wx.Window `_ * `wx.EvtHandler `_ * `wx.Object `_ Window Styles ^^^^^^^^^^^^^ ================================================== ================================================== Window Style Description ================================================== ================================================== ``wx.CLRP_DEFAULT_STYLE`` The default style: 0. ``wx.CLRP_USE_TEXTCTRL`` Creates a text control to the left of the picker button which is completely managed by the `wx.ColourPickerCtrl` and which can be used by the user to specify a colour (see `SetColour <#SetColour>`_). The text control is automatically synchronized with button's value. ``wx.CLRP_SHOW_LABEL`` Shows the colour in HTML form (AABBCC) as colour button label (instead of no label at all). ================================================== ================================================== Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_COLOURPICKER_CHANGED(id, func) The user changed the colour selected in the control either using the button or using text control (see ``wx.CLRP_USE_TEXTCTRL``; note that in this case the event is fired only if the user's input is valid, i.e. recognizable). ================================================== ================================================== | Control Appearance ^^^^^^^^^^^^^^^^^^ | .. figure:: ../images/wxWidgets/wxmsw/colourpickerctrl.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: ../images/wxWidgets/wxmac/colourpickerctrl.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: ../images/wxWidgets/wxgtk/colourpickerctrl.png :alt: wxGTK :figclass: floatcenter **wxGTK** | Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetColour <#GetColour>`_ * `SetColour <#SetColour>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Colour <#Colour>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(parent, id=-1, col=wx.BLACK, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLRP_DEFAULT_STYLE, validator=wx.DefaultValidator, name=wx.ColourPickerCtrlNameStr) This control allows the user to select a colour. The generic implementation is a button which brings up a `wx.ColourDialog `_ when clicked. Native implementations may differ but this is usually a (small) widget which give access to the colour-chooser dialog. **Parameters:** * `parent` (`wx.Window `_) * `id` (int) * `col` (`wx.Colour `_) * `pos` (`wx.Point `_) * `size` (`wx.Size `_) * `style` (long) * `validator` (`wx.Validator `_) * `name` (string) | **Returns:** `wx.ColourPickerCtrl `_ -------- .. method:: GetColour() Returns the currently selected colour. | **Returns:** `wx.Colour `_ -------- .. method:: SetColour(col) Sets the currently selected colour. **Parameters:** * `col` (`wx.Colour `_) .. seealso:: `wx.Colour.Set `_ -------- Properties ^^^^^^^^^^ .. attribute:: Colour See `GetColour <#GetColour>`_ and `SetColour <#SetColour>`_