wxColourDialog — wx v2.4.3

Search documentation of wx

# View Source wxColourDialog (wx v2.4.3)

This class represents the colour chooser dialog.

Starting from wxWidgets 3.1.3 and currently in the MSW port only, this dialog generates wxEVT_COLOUR_CHANGED events while it is being shown, i.e. from inside its `wxDialog:showModal/1` method, that notify the program about the change of the currently selected colour and allow it to e.g. preview the effect of selecting this colour. Note that if you react to this event, you should also correctly revert to the previously selected colour if the dialog is cancelled by the user.

Example of using this class with dynamic feedback for the selected colour:

See:

- Overview cmndlg

- `wx_color()`

- `wxColourData`

- ?wxGetColourFromUser()

This class is derived, and can use functions, from:

- `wxDialog`

- `wxTopLevelWindow`

- `wxWindow`

- `wxEvtHandler`

wxWidgets docs: wxColourDialog

# Summary

## Types

wxColourDialog()

## Functions

create(This, Parent)

Equivalent to `create(This, Parent, [])`.

create/3

Same as `new/2`.

destroy(This)

Destroys the object

getColourData(This)

Returns the colour data associated with the colour dialog.

new()
new(Parent)

Equivalent to `new(Parent, [])`.

new/2

Constructor.

# Types

Link to this type

# wxColourDialog()

View Source

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

# Functions

Link to this function

# create(This, Parent)

View Source

    -spec create(This, Parent) -> boolean() when This :: wxColourDialog(), Parent :: wxWindow:wxWindow().

Equivalent to `create(This, Parent, [])`.

Link to this function

# create/3

View Source

    -spec create(This, Parent, [Option]) -> boolean()
                    when
                        This :: wxColourDialog(),
                        Parent :: wxWindow:wxWindow(),
                        Option :: {data, wxColourData:wxColourData()}.

Same as `new/2`.

Link to this function

# destroy(This)

View Source

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

Destroys the object

Link to this function

# getColourData(This)

View Source

    -spec getColourData(This) -> wxColourData:wxColourData() when This :: wxColourDialog().

Returns the colour data associated with the colour dialog.

Link to this function

# new()

View Source

    -spec new() -> wxColourDialog().

Link to this function

# new(Parent)

View Source

    -spec new(Parent) -> wxColourDialog() when Parent :: wxWindow:wxWindow().

Equivalent to `new(Parent, [])`.

Link to this function

# new/2

View Source

    -spec new(Parent, [Option]) -> wxColourDialog()
                 when Parent :: wxWindow:wxWindow(), Option :: {data, wxColourData:wxColourData()}.

Constructor.

Pass a parent window, and optionally a pointer to a block of colour data, which will be copied to the colour dialog's colour data.

Custom colours from colour data object will be used in the dialog's colour palette. Invalid entries in custom colours list will be ignored on some platforms(GTK) or replaced with white colour on platforms where custom colours palette has fixed size (MSW).

See: `wxColourData`