BBjWindow::addInputE

Description

Creates a masked edit control in the BBjWindow.

Syntax

Return Value

Method

BBjInputE

addInputE(int ID, int x, int y, int w, int h)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, int len)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, int len, string pad)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, int len, string pad, string val)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, int len, string pad, int initPos, string restore, string val)

BBjInputE

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

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, string mask, string pad)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, string mask, string pad, string val)

BBjInputE

addInputE(int ID, int x, int y, int w, int h, string flags, string mask, string pad, int initPos, string restore, string val)

Parameters

Variable

Description

ID

INPUTE control ID.

x

Horizontal position of the upper-left corner of the INPUTE control.

y

Vertical position of the upper-left corner of the INPUTE control.

w

Width of the INPUTE control.

h

Height of the INPUTE control. To create a standard size control, set the h parameter to 0.

flags

Control flags, as follows:

 

Flag   

Description

 

$0000$

Left justifies text (default).

 

$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 akeyboard navigation group.

 

$0800$

Draws a recessed client edge around the control.

 

$1000$

Draws a raised edge around the control.

 

$4000$

Centers text.

 

$8000$

Right justifies text.

mask

The following defines the input mask characters for the mask$ parameter:

 

X

a

A

0

U

z

Z

Any printable character.

Any alphabetic character.

Any alphabetic character. Converts lower-case alphabetic characters to upper case.

Any digit.

Any digit, alphabetic, space, or punctuation character. Converts lower-case alphabetic characters to upper case.

Any digit or alphabetic character.

Any digit or alphabetic character. Converts lower-case alphabetic characters to upper case.

len

Length of the returned string.

pad

Input pad character.

val

Default value.

initPos

Beginning of the input region.

restore

Restore value.

Return Value

This method returns the created BBjInputE object.

Remarks

Accepts user input in a manner similar to the INPUTE verb, but does not provide string verification.

Example

REM Add a INPUTE 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 INPUTE control that accepts only alphabetic characters and converts
REM all to upper case, limiting input to 10 characters, and inserting
REM the value "STANDARD" when the user hits the restore key (normally ESCAPE)
myInputE! = myWindow!.addInputE(101,50,100,90,30,$0804$,"AAAAAAAAAA","",1,"STANDARD","")

REM Register the CALLBACK routines
CALLBACK(ON_EDIT_MODIFY,INPUTE_MODIFIED,mySysGui!.getContext(),myInputE!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

REM Callback routine called when the contents of the INPUTE control are modified
INPUTE_MODIFIED:
REM Display a message with the INPUTE control contents
MESSAGE$="The INPUTE contents are: " + STR(myInputE!.getText())
LET X=MSGBOX(MESSAGE$)
RETURN

REM Callback routine called when the user closes the application window
APP_CLOSE:
RELEASE
RETURN

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

`INPUTE' Mnemonic

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