wxSpinButton(3)

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

🌈 NAME 🌈

okay so bestie, welcome to the Erlang module definition for wxSpinButton(3) πŸ’–. wxSpinButton is literally a widget with two small up and down (or left and right) arrow buttons. that's the whole vibe. ✨

🌸 DESCRIPTION 🌸

you'll often see this lil guy next to a text control, just incrementing and decrementing a value like it's the main character 🫢. but listen: portable programs should try to use wxSpinCtrl instead, because wxSpinButton is not implemented for all platforms, but wxSpinCtrl is β€” and on those platforms it degenerates to a simple wxTextCtrl. iconic, honestly. πŸ’…

note: the range supported by this control (and wxSpinCtrl) depends on the platform, but it's at least -0x8000 to 0x7fff. under GTK and Win32 with a sufficiently new version of comctrl32.dll (at least 4.71 is required, 5.80 is recommended), the full 32 bit range is supported. periodt. πŸ’€βœ¨

πŸŽ€ Styles πŸŽ€

this class supports the following styles, bestie:

  • wxSP_HORIZONTAL β€” specifies a horizontal spin button (note that this style is not supported in wxGTK πŸ‘€).
  • wxSP_VERTICAL β€” specifies a vertical spin button.
  • wxSP_ARROW_KEYS β€” the user can use arrow keys to change the value.
  • wxSP_WRAP β€” the value wraps at the minimum and maximum.

See: wxSpinCtrl

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

  • wxControl
  • wxWindow
  • wxEvtHandler

wxWidgets docs: wxSpinButton

πŸ¦‹ Events πŸ¦‹

event types emitted from this class:

  • spin
  • spin_up
  • spin_down

🌟 DATA TYPES 🌟

wxSpinButton() :: wx:wx_object().

πŸ’– FUNCTIONS πŸ’–

✨ create/3 ✨

create(This, Parent, [Option]) -> boolean()
                when
                    This :: wxSpinButton(),
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

scrollbar creation function called by the spin button constructor. see new/2 for details. πŸ’…

πŸ’€ destroy/1 πŸ’€

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

destroys the object. literally. πŸ’€

πŸ”’ getMax/1 πŸ”’

getMax(This) -> integer() when This :: wxSpinButton().

returns the maximum permissible value. See: setRange/3 ✨

πŸ”½ getMin/1 πŸ”½

getMin(This) -> integer() when This :: wxSpinButton().

returns the minimum permissible value. See: setRange/3 ✨

🎚️ getValue/1 🎚️

getValue(This) -> integer() when This :: wxSpinButton().

returns the current spin button value. See: setValue/2 ✨

🐣 new/0 🐣

new() -> wxSpinButton().

default constructor. no cap. πŸ’–

🌟 new/2 🌟

new(Parent, [Option]) -> wxSpinButton()
                when
                    Parent :: wxWindow:wxWindow(),
                    Option ::
                        {id, integer()} |
                        {pos, {X :: integer(), Y :: integer()}} |
                        {size, {W :: integer(), H :: integer()}} |
                        {style, integer()}.

constructor, creating and showing a spin button. See: create/3 ✨

πŸ“ setRange/3 πŸ“

setRange(This, Min, Max) -> ok
                 when
                     This :: wxSpinButton(),
                     Min :: integer(),
                     Max :: integer().

sets the range of the spin button. in portable code, min should be less than or equal to max. in wxMSW it is possible to specify minimum greater than maximum and the native control supports the same range as if they were reversed, but swaps the meaning of up and down arrows, however this dubious feature is not supported on other platforms. πŸ‘€

See:

  • getMin/1
  • getMax/1

🎯 setValue/2 🎯

setValue(This, Value) -> ok
                 when This :: wxSpinButton(), Value :: integer().

sets the value of the spin button. periodt. πŸ’…


and that's the tea, bestie. this page was brought to you by Ericsson AB, wx 2.6, wxSpinButton(3) πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from