wSpinCtrl

wSpinCtrl combines wTextCtrl and wSpinButton in one control.

Appearance:
Superclass:wControl
Styles:
StylesDescription
wSpReadOnlyThe value will not be user-editable.
wSpLeftThe text is left aligned (this is the default).
wSpCenterThe text is centered.
wSpRightThe text is right aligned.
wSpArrowKeysThe value wraps at the minimum and maximum.
wSpWrapThe user can use arrow keys to change the value.
Events:wSpinEvent wCommandEvent
wSpinEventDescription
wEvent_SpinPressing an arrow changed the spin button value. This event can be vetoed.
wEvent_SpinUpPressing up/right arrow changed the spin button value. This event can be vetoed.
wEvent_SpinDownPressing down/left arrow changed the spin button value. This event can be vetoed.
wCommandEventDescription
wEvent_TextWhen the text changes.
wEvent_TextEnterWhen pressing Enter key.

Consts

wSpReadOnly = 0x00000800
wSpLeft = 0x00000000
wSpCenter = 0x00000001
wSpRight = 0x00000002
wSpArrowKeys = 1152921504606846976'i64
wSpWrap = 2305843009213693952'i64

Procs

proc getBase(self: wSpinCtrl): int {...}{.inline, raises: [], tags: [].}
Returns the numerical base being currently used, 10 by default.
proc setBase(self: wSpinCtrl; base: int) {...}{.inline, raises: [], tags: [].}
Sets the base to use for the numbers in this control, 10 or 16.
proc getRange(self: wSpinCtrl): Slice[int] {...}{.inline, raises: [], tags: [].}
Gets range of allowable value.
proc setRange(self: wSpinCtrl; min: int; max: int) {...}{.inline, raises: [], tags: [].}
Sets range of allowable values.
proc setRange(self: wSpinCtrl; range: Slice[int]) {...}{.inline, raises: [], tags: [].}
Sets range of allowable values.
proc getMin(self: wSpinCtrl): int {...}{.inline, raises: [], tags: [].}
Gets minimal allowable value.
proc getMax(self: wSpinCtrl): int {...}{.inline, raises: [], tags: [].}
Gets maximal allowable value.
proc getValue(self: wSpinCtrl): int {...}{.inline, raises: [], tags: [].}
Gets the value of the spin control.
proc getText(self: wSpinCtrl): string {...}{.inline, raises: [], tags: [].}
Gets the text of the spin control.
proc setValue(self: wSpinCtrl; value: int) {...}{.raises: [], tags: [].}
Sets the value of the spin control.
proc setValue(self: wSpinCtrl; text: string) {...}{.inline, raises: [], tags: [].}
Sets the value of the spin control.
proc setText(self: wSpinCtrl; text: string) {...}{.inline, raises: [], tags: [].}
Sets the text of the spin control. The same as setValue().
proc setSelection(self: wSpinCtrl; range: Slice[int]) {...}{.inline, raises: [], tags: [].}
Select the text in the text part of the control.
proc getUpdownHandle(self: wSpinCtrl): HANDLE {...}{.inline, raises: [], tags: [].}
Gets the system handle of the updown control.
proc init(self: wSpinCtrl; parent: wWindow; id = wDefaultID; value: string = "0";
         pos = wDefaultPoint; size = wDefaultSize; style: wStyle = wSpLeft) {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError], tags: [RootEffect].}
Initializes a spin control. Value as text.
proc SpinCtrl(parent: wWindow; id = wDefaultID; value: string = "0"; pos = wDefaultPoint;
             size = wDefaultSize; style: wStyle = wSpLeft): wSpinCtrl {...}{.inline,
    discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                        Exception, IndexDefect, wFontError], tags: [RootEffect].}
Constructor.
proc init(self: wSpinCtrl; parent: wWindow; id = wDefaultID; value: int;
         pos = wDefaultPoint; size = wDefaultSize; style: wStyle = wSpLeft) {...}{.raises: [
    wNilAccess, wWindowError, wCursorError, wBrushError, Exception, IndexDefect,
    wFontError], tags: [RootEffect].}
Initializes a spin control. Value as int.
proc SpinCtrl(parent: wWindow; id = wDefaultID; value: int; pos = wDefaultPoint;
             size = wDefaultSize; style: wStyle = wSpLeft): wSpinCtrl {...}{.inline,
    discardable, raises: [wNilAccess, wWindowError, wCursorError, wBrushError,
                        Exception, IndexDefect, wFontError], tags: [RootEffect].}
Constructor.

Methods

method show(self: wSpinCtrl; flag = true) {...}{.inline, raises: [Exception],
                                      tags: [RootEffect].}
Shows or hides the control.
method getDefaultSize(self: wSpinCtrl): wSize {...}{.raises: [], tags: [].}
Returns the default size for the control.
method getBestSize(self: wSpinCtrl): wSize {...}{.raises: [], tags: [].}
Returns the best acceptable minimal size for the control.
method release(self: wSpinCtrl) {...}{.raises: [], tags: [RootEffect].}
Release all the resources during destroying. Used internally.