new Spinbox(parent, optionsopt) → {Spinbox}
Create a new spinbox widget.
Parameters
-
parent
objectParent element.
-
options
object<optional>
Options.
Properties
-
title
string<optional>
'Enter value'Title of the control.
-
dmin
number<optional>
Minimum value.
-
dmax
number<optional>
Maximum value.
-
step
number<optional>
Initial value increment between autorepeat updates.
-
initValue
number<optional>
Initial value.
-
repButton
boolean<optional>
trueUp/Down spin buttons have autorepeat?
-
instantUpdate
boolean<optional>
falseReturn updated value at each autorepeat update?
-
className
string<optional>
Element class name for the widget.
-
title
Returns
-
SpinboxSpinbox widget element.
Source
Methods
_offset(target, direction)
Increment or decrement spinbox value.
Parameters
-
target
objectElement that triggered the action.
-
direction
numberStep direction (-1 or +1).
Source
_prec(step) → {number}
Set spinbox value precision.
Parameters
-
step
numberIncrement value.
Returns
-
numberNumber of decimals.
Source
_sboxRun()
Run one step of the spinbox.
Source
disable()
Disable the spinbox widget.
Source
enable()
Enable the spinbox widget.
Source
step(valopt) → {number}
Return or set the current increment value of the spinbox.
Parameters
-
val
number<optional>
If provided, set the spinbox increment value to that of
val.
Returns
-
numberSpinbox increment value.
Source
value(valopt) → {number}
Return or set the current value of the spinbox.
Parameters
-
val
number<optional>
If provided, set the spinbox value to that of
val.
Returns
-
numberSpinbox value.