_______________________________________________________
NUMBER Widget
Provides an input/output environment for building and formatting numbers
_______________________________________________________
Legal Usage Level-0 Widget: Yes
Parent to: None
Child of: PANEL
Example Image
Example Program
See NUMBER Widget for a program that provides a display similar to that shown above.
NOTE
Attributes
Remarks
The NUMBER widget provides an input/output environment for building and formatting numbers.
The NUMBER widget enforces that a number be entered in an acceptable format, so you cannot enter an incorrect character. The NUMBER widget also provides the ability to translate numbers entered in binary, octal, or hex directly into BASIC numeric variables using the FORMAT attribute.
FORMAT can have values of REAL, SHORT INTEGER, BINARY, OCTAL, and HEX. In the following example, the FORMAT LENGTH attribute gives a default field of 4 hex digits for the user to enter.
CONTROL @Num;SET ("FORMAT":"HEX","FORMAT LENGTH":4)
You can specify a round-off INCREMENT and, for REAL numbers, the number of fractional digits displayed (using the REAL RESOLUTION attribute) and the format for REAL numbers (using the REAL NOTATION attribute which can be set to FIXED, SCIENTIFIC, or ENGINEERING).
Input is restricted to valid numbers within the limits, formats, and increments that have been specified. Once a number is entered or the view panel loses its focus, this display is reformatted to the current format increment. MINIMUM, MAXIMUM, REAL NOTATION, and REAL RESOLUTION are verified. If you exceed MINIMUM or MAXIMUM, the previous value is restored.
Events
Events for the NUMBER widget are:
DONE
This event is generated when the widget loses focus and CHECK FOR DONE is set.
INVALID NUMBER
This event is generated when an entry causes the current display to be unable to build a number in the current "FORMAT". This event also occurs when "DONE" or "RETURN" generates a number outside "MINIMUM" or "MAXIMUM".
KEYSTROKE
Occurs when you enter a character that could change the display.
RETURN
Occurs when the Return key or Enter key is pressed.
SYSTEM MENU
This event is generated when the operator selects items from the SYSTEM MENU.