wxSpinCtrl(3)
π wxSpinCtrl π
okay so bestie, welcome to the wxSpinCtrl(3) manual page, and yes it's the Erlang Module Definition version. wxSpinCtrl is that iconic combo control: it combines wxTextCtrl and wxSpinButton in one control. one control, two vibes, zero need to pick a favorite. π
β¨ NAME β¨
wxSpinCtrl β combines wxTextCtrl and wxSpinButton in one control. periodt.
π¦ DESCRIPTION π¦
π¨ Styles π¨
This class supports the following styles, and you're gonna wanna know them all, fr fr:
wxSP_ARROW_KEYSβ the user can use arrow keys to change the value. keyboard main character energy.wxSP_WRAPβ the value wraps at the minimum and maximum. it's giving circular.wxTE_PROCESS_ENTERβ indicates that the control should generatewxEVT_TEXT_ENTERevents. Using this style will prevent the user from using the Enter key for dialog navigation (e.g. activating the default button in the dialog) under MSW. so yes, it can lowkey steal your Enter key on MSW; that's the tradeoff.wxALIGN_LEFTβ same aswxTE_LEFTforwxTextCtrl: the text is left aligned (this is the default). left-aligned default, as expected.wxALIGN_CENTRE_HORIZONTALβ same aswxTE_CENTREforwxTextCtrl: the text is centered. centered slay.wxALIGN_RIGHTβ same aswxTE_RIGHTforwxTextCtrl: the text is right aligned. right-aligned, no further notes.
See:
wxSpinButtonwxControl
This class is derived, and can use functions, from:
wxControlwxWindowwxEvtHandler
wxWidgets docs: wxSpinCtrl β that's where the official docs live.
π Events π
Event types emitted from this class:
command_spinctrl_updated
π§Έ DATA TYPES π§Έ
wxSpinCtrl() :: wx:wx_object().
π FUNCTIONS π
π create/3 π
create(This, Parent, [Option]) -> boolean()
when
This :: wxSpinCtrl(),
Parent :: wxWindow:wxWindow(),
Option ::
{id, integer()} |
{value, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{min, integer()} |
{max, integer()} |
{initial, integer()}.
Creation function called by the spin control constructor.
See new/2 for details.
π§Ό destroy/1 π§Ό
destroy(This :: wxSpinCtrl()) -> ok.
Destroys the object. bye bye, bestie. π
π getMax/1 π
getMax(This) -> integer() when This :: wxSpinCtrl().
Gets maximal allowable value.
π getMin/1 π
getMin(This) -> integer() when This :: wxSpinCtrl().
Gets minimal allowable value.
π’ getValue/1 π’
getValue(This) -> integer() when This :: wxSpinCtrl().
Gets the value of the spin control.
π£ new/0 π£
new() -> wxSpinCtrl().
Default constructor. baby spin control, no parent yet.
πΈ new/2 πΈ
new(Parent, [Option]) -> wxSpinCtrl()
when
Parent :: wxWindow:wxWindow(),
Option ::
{id, integer()} |
{value, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{min, integer()} |
{max, integer()} |
{initial, integer()}.
Constructor, creating and showing a spin control.
If value is non-empty, it will be shown in the text entry part of the control and if it has numeric value, the initial numeric value of the control, as returned by getValue/1 will also be determined by it instead of by initial. Hence, it only makes sense to specify initial if value is an empty string or is not convertible to a number, otherwise initial is simply ignored and the number specified by value is used.
See: create/3
π¦ setRange/3 π¦
setRange(This, MinVal, MaxVal) -> ok
when
This :: wxSpinCtrl(),
MinVal :: integer(),
MaxVal :: integer().
Sets range of allowable values.
Notice that calling this method may change the value of the control if it's not inside the new valid range, e.g. it will become minVal if it is less than it now. However no wxEVT_SPINCTRL event is generated, even if the value does change.
Note: Setting a range including negative values is silently ignored if current base is set to 16.
βοΈ setSelection/3 βοΈ
setSelection(This, From, To) -> ok
when
This :: wxSpinCtrl(),
From :: integer(),
To :: integer().
Select the text in the text part of the control between positions from (inclusive) and to (exclusive).
This is similar to wxTextCtrl:setSelection/3.
Note: this is currently only implemented for Windows and generic versions of the control.
ποΈ setValue/2 ποΈ
setValue(This, Value) -> ok
when This :: wxSpinCtrl(), Value :: integer();
(This, Text) -> ok
when This :: wxSpinCtrl(), Text :: unicode:chardata().
Sets the value of the spin control.
It is recommended to use the overload taking an integer value instead.
Notice that, unlike wxTextCtrl:setValue/2, but like most of the other setter methods in wxWidgets, calling this method does not generate any events as events are only generated for the user actions.
that's the whole page, bestie. no cap, every style, function, note, and reference is here. π
cute sign-off: brought to you by Ericsson AB, wx 2.6, and the wxSpinCtrl(3) manual page. the footer doesn't give a separate date, so we're not inventing one β just sending love from the version that says wx 2.6. π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms