INPUTN Mnemonic - Create Numeric Edit (INPUTN) Control

Syntax

'INPUTN'(id,x,y,w,h,flags$,mask$,irules$,restore,val)

Description

For BBj-specific information, see the INPUTN Mnemonic - Create Numeric Edit Control BBj .

The 'INPUTN' mnemonic creates a graphical edit control that accepts user input in a manner similar to the INPUTN verb. Unlike the INPUTN verb, however, the 'INPUTN' mnemonic generates an edit mask from the output mask and allows the user to remove and reassert focus. The 'INPUTN' mnemonic does not provide numeric verification.

Parameter Description
id INPUTN control ID.
x Horizontal position of the upper-left corner of the INPUTN control.
y Vertical position of the upper-left corner of the INPUTN control.
w Width of the INPUTN control.
h Height of the INPUTN control. To create a standard size control, set the h parameter to 0.
title Title of the control.
flags Control flags, as follows:
FlagDescription
$0001$Sets the control to be initially disabled.
$0002$Passes the Enter key to the parent window.
$0004$Passes the Tab key to the parent window.
$0008$Prompts non-mouse events on the control to highlight the control text.
$0010$Sets the control to be initially invisible.
$0800$Draws a recessed client edge around the control.
$0200$Defines the edit text as read-only (Visual PRO/5 Rev. 3.12 or later).
$1000$Draws a raised edge around the control.
mask$

Output mask. Uses standard PRO/5 numeric mask conventions and provides a check for the data.

If the "0" mask is used and SETOPTS byte 2, bit $80$ is set, it will not be possible to insert values. Either disable the SETOPTS bit or use the "#" mask.

irules$ Input rules. If null, the value in STBL("!IRULES") is used as a default. The mask$ is used to generated the edit mask, which uses "#", "0", and "." mask characters.
Flag BitEffect on Input if Bit is Set
$02$Causes commas and numeric characters to be copied when generating the edit mask from mask$.
$04$Accepts the decimal point replacement character for data entry defined by SETOPTS(6,1).
$80$Causes the system to beep upon entry of invalid data.
$10$Allows only non-negative numbers in the InputN control.
restore Restore value.
val Default value.

Display vs. Edit Mode

When an INPUTN control has focus, it is considered to be in the "Edit" mode. If it does not have focus, it is considered to be in the "Display" mode.

If the control has an associated mask, the content of the control may change as the control changes from Edit to Display mode. Mask characters such as '$', '.', and (' and ') are visible in Display mode but are not visible in Edit mode. Therefore, making a selection within the control can be a two-step process.

If the control does not have focus, the focus must first be set by either clicking on the control or tabbing to the control. Once in focus, the control's contents are properly formatted for editing. At this point, the caret is always placed before the left-most digit for editing. The contents can then be selected by using the mouse or keyboard.

The 'INPUTN' control is displayed in the x,y,w,h position in current units. It displays val as the initial value using mask$. Unless the right-most entry ($01$) flag is set, the caret is set to the far left. If the "revertoinpute" flag ($0020$) is set, and the first character entered is non-numeric, input proceeds as in the 'INPUTE' mnemonic.

Upon entry of numeric data (digits, ".", "+", and "-"), the initial value is replaced with the new data. With each numeric keystroke, the value is calculated and redisplayed using the input mask. The "+" and "-" symbols determine the number's sign and may be entered at any time. The effect is a calculator-style numeric entry.

The backspace key may be used to correct typing errors. If at any time the restore command is issued (see the STBL("!EDIT") information in the User's Reference Guide), the value of the restore$ parameter is displayed and may be accepted or edited.

Upon completion of the entry, the entered value is saved in val and displayed using mask$. If no entry occurs, val remains unchanged, and the original value is displayed using mask$.

INPUTN Clipboard Operations

The INPUTN control processes the standard Ctrl+X (Cut), Ctrl+C (Copy), and Ctrl+V (Paste) clipboard functions. When copying to the clipboard, only the text returned by retrieving the title is copied. The INPUTN control is the edit control used in the grid control and allows for copy and paste operations between INPUTN controls. If the text pasted into an INPUTN control does not mask correctly, the application generates an Error Code Notify event.

INPUTN SENDMSG() Functions

The following describes the parameters INPUTN SENDMSG() functions:

Parameter

Description

sysgui

Valid SYSGUI channel.

id

Object ID.

function

Specific function, described in the SENDMSG() function documentation.

int

Four-byte integer that contains an argument for a given function.

string$

String argument for a given function.

context

Context that contains the specified ID. This parameter is only necessary for objects that do not pertain to the current context.

The returned value indicates the success or failure of the operation: $01$ indicates success, while $00$ indicates failure. The error can be requested or is sent via the Notify event. The INPUTN SENDMSG() functions are described in the SENDMSG() documentation.

See Also

Mnemonics - Alphabetical Listing

Mnemonics - Group Listing