_______________________________________________________
KEYPAD Widget
Provides a graphical keypad presentation from which you can make entries with a mouse, a touchscreen, or a keyboard
_______________________________________________________
Legal Usage Level-0 Widget: Yes
Parent to: None
Child of: PANEL
Example Image
Example Program
See KEYPAD Widget for a program that generates a KEYPAD widget and provides a display similar to that shown above.
Attributes
Remarks
The KEYPAD widget is an enhanced version of the NUMBER widget. KEYPAD provides a graphical keypad presentation from which you can make entries with a mouse, touchscreen, or keyboard. The keys on the keypad provide these functions:
|
·
|
Keys A through F are used when formatting "HEX"
|
|
·
|
Key E is used when formatting "REAL"
|
|
·
|
Keys that do not apply to the current format are grayed and made non-sensitive. For example, if you choose the "OCTAL" format, the only active numbered keys available will be 0 through 7.
|
|
·
|
ENT provides a return key
|
|
·
|
- provides negative numbers or exponents
|
|
·
|
CLR clears digits from the text cursor to the end
|
|
·
|
DEL deletes the current selection, either all highlighted characters or the character immediately under the cursor
|
|
·
|
INS toggles to the insert mode.
|
Additional attributes for the KEYPAD widget are KEY BACKGROUND and KEY PEN to set key colors, and SHOW EDIT which allows you to turn off the edit box on the KEYPAD. The KEYPAD widget requires that a number be entered in an acceptable format, so you cannot enter an incorrect character.
The KEYPAD 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, LONG INTEGER, BINARY, OCTAL, and HEX.
The following FORMAT LENGTH attribute gives a default field of 4 hexadecimal 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 REAL RESOLUTION) and the format for REAL numbers (using REAL NOTATION which can be set to FIXED, SCIENTIFIC, or ENGINEERING).
The KEYPAD widget supports a RETURN event, which occurs when the user presses the Enter key to enter a number and a DONE event, which occurs when the user changes input focus to another window.
Events
Events for the KEYPAD 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 you press the Return key or the Enter key.
SYSTEM MENU
This event is generated when the operator selects items from the SYSTEM MENU.