wxColourPickerCtrl — wx v2.4.2

Search documentation of wx

# View Source wxColourPickerCtrl (wx v2.4.2)

Functions for wxColourPickerCtrl class

This control allows the user to select a colour. The generic implementation is a button which brings up a `wxColourDialog` 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 `wxUSE_COLOURPICKERCTRL` is set to 1 (the default).

Styles

This class supports the following styles:

See: `wxColourDialog`, `wxColourPickerEvent`

This class is derived (and can use functions) from: `wxPickerBase` `wxControl` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxColourPickerCtrl

## Events

Event types emitted from this class: `command_colourpicker_changed`

# Summary

## Types

wxColourPickerCtrl()

## Functions

create(This, Parent, Id)
create/4

Creates a colour picker with the given arguments.

destroy(This)

Destroys the object.

getColour(This)

Returns the currently selected colour.

new()
new(Parent, Id)
new/3

Initializes the object and calls `create/4` with all the parameters.

setColour/2

Sets the currently selected colour.

# Types

Link to this type

# wxColourPickerCtrl()

View Source

    -type wxColourPickerCtrl() :: wx:wx_object().

# Functions

Link to this function

# create(This, Parent, Id)

View Source

    -spec create(This, Parent, Id) -> boolean()
                    when This :: wxColourPickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Link to this function

# create/4

View Source

    -spec create(This, Parent, Id, [Option]) -> boolean()
                    when
                        This :: wxColourPickerCtrl(),
                        Parent :: wxWindow:wxWindow(),
                        Id :: integer(),
                        Option ::
                            {col, wx:wx_colour()} |
                            {pos, {X :: integer(), Y :: integer()}} |
                            {size, {W :: integer(), H :: integer()}} |
                            {style, integer()} |
                            {validator, wx:wx_object()}.

Creates a colour picker with the given arguments.

Return: true if the control was successfully created or false if creation failed.

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxColourPickerCtrl()) -> ok.

Destroys the object.

Link to this function

# getColour(This)

View Source

    -spec getColour(This) -> wx:wx_colour4() when This :: wxColourPickerCtrl().

Returns the currently selected colour.

Link to this function

# new()

View Source

    -spec new() -> wxColourPickerCtrl().

Link to this function

# new(Parent, Id)

View Source

    -spec new(Parent, Id) -> wxColourPickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Link to this function

# new/3

View Source

    -spec new(Parent, Id, [Option]) -> wxColourPickerCtrl()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Id :: integer(),
                     Option ::
                         {col, wx:wx_colour()} |
                         {pos, {X :: integer(), Y :: integer()}} |
                         {size, {W :: integer(), H :: integer()}} |
                         {style, integer()} |
                         {validator, wx:wx_object()}.

Initializes the object and calls `create/4` with all the parameters.

Link to this function

# setColour/2

View Source

    -spec setColour(This, Colname) -> ok when This :: wxColourPickerCtrl(), Colname :: unicode:chardata();
                   (This, Col) -> ok when This :: wxColourPickerCtrl(), Col :: wx:wx_colour().

Sets the currently selected colour.

See `wxColour::Set()` (not implemented in wx).