BBjWindow::addInputN

Description

Creates an edit control in the BBjWindow that accepts numeric values.

Syntax

Return Value

Method

BBjInputN

addInputN()

BBjInputN

addInputN(int ID, number x, number y, number w, number h)

BBjInputN

addInputN(int ID, number x, number y, number w, number h, string flags, string mask, string rules, float restore, float value)

BBjInputN

addInputN(int ID)

BBjInputN

addInputN(int ID, number x, number y, number w, number h, string flags)

BBjInputN

addInputN(int ID, number x, number y, number w, number h, string flags, string mask)

BBjInputN

addInputN(int ID, number x, number y, number w, number h, string flags, string mask, string rules)

BBjInputN

addInputN(int ID, string flags)

BBjInputN

addInputN(int ID, string flags, string mask)

BBjInputN

addInputN(int ID, string flags, string mask, string rules)

BBjInputN

addInputN(int ID, string flags, string mask, string rules, int restore, int value)

BBjInputN

addInputN(string flags)

BBjInputN

addInputN(string flags, string mask)

BBjInputN

addInputN(string flags, string mask, string rules)

BBjInputN

addInputN(string flags, string mask, string rules, int restore, int value)

Parameters

Variable

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.

flags

Control flags, as follows:

Flag Description
$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.
$0020$ Designates the control to be part of a keyboard navigation group.
$0800$ Draws a recessed client edge around the control.

mask

Output mask. 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.

rules

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 Bit

Effect 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).

$10$ 

Disallow negative values.

$80$

Causes the system to beep upon entry of invalid data.

restore

Restore value.

value

Default value.

Return Value

This method returns the created BBjInputN object.

Remarks

Accepts user input in a manner similar to the INPUTN verb.

If the ID parameter is not specified, a control ID is assigned dynamically using getAvailableControlID().

If the x, y, width, and height parameters are not specified, they're all initialized to 0. This is typically for use with DWC windows that dynamically arrange their contents (window creation flag $00100000$).

Example

rem 'Add a INPUTN control to a window

rem 'Obtain the instance of the BBjAPI object
let myAPI! = BBjAPI()

rem 'Open the SysGui device
SYSGUI = UNT
OPEN (SYSGUI) "X0"

rem 'Obtain the instance of the BBjSysGui object
let mySysGui! = myAPI!.getSysGui()

rem 'Set addWindow param values
X = 10
Y = 10
WIDTH = 200
HEIGHT = 200
TITLE$="BBj Window"

rem 'Set the current context
mySysGui!.setContext(0)

rem 'Create a window
myWindow! = mySysGui!.addWindow(X,Y,WIDTH,HEIGHT,TITLE$)

rem 'Add an INPUTN control that limits input to 10 characters, and inserting
rem 'the value 1 when the user hits the restore key (normally ESCAPE)
myInputN! = myWindow!.addInputN(101,50,100,90,30,$0804$,"##,###,###.00",$$,1,0)

rem 'Register the CALLBACK routines
CALLBACK(ON_EDIT_MODIFY,INPUTN_MODIFIED,mySysGui!.getContext(),myInputN!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

rem 'Process Events
process_events

rem 'Callback routine called when the contents of the INPUTN control are modified
INPUTN_MODIFIED:
    rem 'Display a message with the INPUTN control contents
    MESSAGE$="The INPUTN contents are: " + STR(myInputN!.getText())
    let X = MSGBOX(MESSAGE$)
return

rem 'Callback routine called when the user closes the application window
APP_CLOSE:
release

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

'INPUTN' Mnemonic

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.