wxCheckBox(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

πŸ’– wxCheckBox πŸ’–

okay bestie, welcome to wxCheckBox, the Erlang module definition for everyone's favourite little box that you click. A checkbox is a labelled box which by default is either on (checkmark is visible) or off (no checkmark). that's it, that's the whole vibe. βœ…


✨ DESCRIPTION ✨

Optionally (when the wxCHK_3STATE style flag is set) it can have a third state, called the mixed or undetermined state. Often this is used as a "Does Not Apply" state. like, the checkbox is out here having main character energy with three whole states. πŸ’…

πŸŽ€ Styles πŸŽ€

This class supports the following styles:

  • wxCHK_2STATE β€” Create a 2-state checkbox. This is the default. the classic, the icon, the original. πŸ’–
  • wxCHK_3STATE β€” Create a 3-state checkbox. Not implemented in wxGTK1. so if you're on wxGTK1, bestie, this one is not for you 😭
  • wxCHK_ALLOW_3RD_STATE_FOR_USER β€” By default a user can't set a 3-state checkbox to the third state. It can only be done from code. Using this flags allows the user to set the checkbox to the third state by clicking. so like, the user is finally trusted with the third state. slay. πŸ”₯
  • wxALIGN_RIGHT β€” Makes the text appear on the left of the checkbox. yes, the name says right, the text goes left. it's giving chaos but we love it. πŸ™ˆ

See:

  • wxRadioButton
  • wxCommandEvent

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

  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxCheckBox

πŸ¦‹ Events πŸ¦‹

Event types emitted from this class:

  • command_checkbox_clicked

🌈 DATA TYPES 🌈

wxCheckBox() :: wx:wx_object().

πŸ‘‘ FUNCTIONS πŸ‘‘

create(This, Parent, Id, Label, [Option]) -> boolean()

create(This, Parent, Id, Label, [Option]) -> boolean()
                when
                    This :: wxCheckBox(),
                    Parent :: wxWindow:wxWindow(),
                    Id :: integer(),
                    Label :: unicode:chardata(),
                    Option ::
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()} |
                        {validator, wx:wx_object()}.

Creates the checkbox for two-step construction. literally building it in two steps like a little DIY project πŸ› οΈβœ¨

See new/4 for details.


destroy(This :: wxCheckBox()) -> ok.

Destroys the object. bye bestie, gone, reduced to atoms πŸ’€


get3StateValue(This) -> wx:wx_enum() when This :: wxCheckBox().

Gets the state of a 3-state checkbox.

Asserts when the function is used with a 2-state checkbox. so do NOT come for this function with a 2-state checkbox, it will be mad 😀

getValue(This) -> boolean() when This :: wxCheckBox().

Gets the state of a 2-state checkbox.

Return: Returns true if it is checked, false otherwise. simple. clean. iconic. ✨


is3State(This) -> boolean() when This :: wxCheckBox().

Returns whether or not the checkbox is a 3-state checkbox.

Return: true if this checkbox is a 3-state checkbox, false if it's a 2-state checkbox. a little vibe check on your checkbox 🫢


is3rdStateAllowedForUser(This) -> boolean() when This :: wxCheckBox().

Returns whether or not the user can set the checkbox to the third state.

Return: true if the user can set the third state of this checkbox, false if it can only be set programmatically or if it's a 2-state checkbox. is the user allowed to touch the third state? only this function knows πŸ’…


isChecked(This) -> boolean() when This :: wxCheckBox().

This is just a maybe more readable synonym for getValue/1: just as the latter, it returns true if the checkbox is checked and false otherwise. same thing, cuter name, no cap. πŸ’–


new() -> wxCheckBox().

Default constructor. the blank slate, the fresh start, the checklist not yet checked 🌸

See: create/5


new(Parent, Id, Label, [Option]) -> wxCheckBox()

new(Parent, Id, Label, [Option]) -> wxCheckBox()
             when
                 Parent :: wxWindow:wxWindow(),
                 Id :: integer(),
                 Label :: unicode:chardata(),
                 Option ::
                     {pos, {X :: integer(), Y :: integer()}} |
                     {size, {W :: integer(), H :: integer()}} |
                     {style, integer()} |
                     {validator, wx:wx_object()}.

Constructor, creating and showing a checkbox. creates it AND shows it, one step, no crumbs left behind πŸ”₯

See: create/5


set3StateValue(This, State) -> ok

set3StateValue(This, State) -> ok
                        when This :: wxCheckBox(), State ::
wx:wx_enum().

Sets the checkbox to the given state.

This does not cause a wxEVT_CHECKBOX event to get emitted. so don't sit there waiting for an event that is never coming, bestie 😭

Asserts when the checkbox is a 2-state checkbox and setting the state to wxCHK_UNDETERMINED. yeah it will absolutely throw hands over this one.

setValue(This, State) -> ok

setValue(This, State) -> ok
                  when This :: wxCheckBox(), State :: boolean().

Sets the checkbox to the given state.

This does not cause a wxEVT_CHECKBOX event to get emitted. same deal, no event, don't @ me πŸ™ˆ


and that's the whole page, periodt. πŸ’œ this lil beauty ships with Ericsson AB, version wx 2.6, and it's out here doing its thing under the wxCheckBox(3) name. stan a checkbox that simply works. πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from