wxColourPickerCtrl(3erl)

πŸ’– wxColourPickerCtrl πŸ’–

Erlang Module Definition β€” okay bestie, welcome to the manual page for the wxColourPickerCtrl class. We are keeping every function, tuple, and footer crumb intact, but making it cute. Periodt. ✨

🌸 NAME 🌸

wxColourPickerCtrl β€” functions for the wxColourPickerCtrl class. That's the name, no cap. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

This control lets the user select a colour. Literally its whole main-character job. 🎨

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 gives access to the colour-chooser dialog. It is only available if wxUSE_COLOURPICKERCTRL is set to 1 (the default). Slay. πŸ’…

Styles β€” this class supports the following styles:

The original page doesn't enumerate them right here, so I'm not inventing any, bestie. Leaving it exactly as-is. πŸ™ˆ

See: wxColourDialog, wxColourPickerEvent.

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

wxWidgets docs: wxColourPickerCtrl.

🌈 EVENTS 🌈

  • command_colourpicker_changed β€” event type emitted from this class.

πŸŽ€ DATA TYPES πŸŽ€

wxColourPickerCtrl() = wx:wx_object()

✨ EXPORTS ✨

🐣 new() -> wxColourPickerCtrl()

Zero-argument constructor moment. It just returns a wxColourPickerCtrl(). Iconic.

🐣 new(Parent, Id) -> wxColourPickerCtrl()

Types:

Parent = wxWindow:wxWindow()
Id = integer()

🐣 new(Parent, Id, Options :: [Option]) -> wxColourPickerCtrl()

Types:

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. Bestie, it's handing the whole options list over. 🫢

πŸ› οΈ create(This, Parent, Id) -> boolean()

Types:

This = wxColourPickerCtrl()
Parent = wxWindow:wxWindow()
Id = integer()

πŸ› οΈ create(This, Parent, Id, Options :: [Option]) -> boolean()

Types:

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. No mystery, just boolean realness. πŸ’–

🎨 getColour(This) -> wx:wx_colour4()

Types:

This = wxColourPickerCtrl()

Returns the currently selected colour. Obsessed with a straightforward getter. ✨

πŸ’… setColour/2

  • setColour(This, Colname) -> ok
  • setColour(This, Col) -> ok

Types:

This = wxColourPickerCtrl()
Col = wx:wx_colour()

Sets the currently selected colour.

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

πŸ’€ destroy(This :: wxColourPickerCtrl()) -> ok

Destroys the object. RIP little widget, but make it cute. πŸͺ¦


Cute final sign-off, bestie: shoutout to the wxWidgets team for the source, wx 2.2.2.1 for the version, and the footer date/manual-name energy β€” wxColourPickerCtrl(3erl) β€” if your copy's footer has a date, consider it kissed. Mwah! πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from