Numeric (leaf, event)

An interactor for integer values. Numeric has an editable displayed number, as well as ``increment'' and ``decrement'' buttons.


Value GP
(Integer)

The currently displayed number.
AllowEmpty
(Boolean, FALSE)

If true, the component supports a distinct ``empty'' state. See Notes.
Min GP
(Integer, FIRST(INTEGER))

The minimum allowed value.
Max GP
(Integer, LAST(INTEGER))

The minimum allowed value.
HideButtons
(Boolean, FALSE)

If true, the numeric interactor appears without increment and decrement buttons.
TabTo
(Symbol)

If given, this is the name of the component to which the keyboard focus wil be transferred when the user types Tab.
FirstFocus
(Boolean, FALSE)

If this Numeric is in a subwindow or TSplit-child, then when that component appears, the keyboard focus will go to this Numeric, and its number field will be selected in replace-mode.

Behavior
The increment button ($+$) increments the number, whereas the decrement button ($-$) decrements it, up to the respective limits. The number field is editable as a single-line TypeIn. Typing Return in the number field checks the number; if it is out of range, it is forced to the nearest acceptable value. Increment, decrement, and Return all generate an event.
Shape
The shape depends on the ShadowSize and Font in effect. When the default shadow and font are used, the size of a Numeric is 76 by 19 pixels.
Notes
GetInteger can be used to retrieve the current value, and PutInteger can be used to set it.
When AllowEmpty is true, emptiness is a special, out-of-band state for the interactor. In this state the increment and decrement functions are disabled. The value of an empty Numeric is reported as FIRST(INTEGER).
Emptiness can be tested explicitly by NumericVBT.IsEmpty, and can be set by NumericVBT.SetEmpty.