BBjWindow::addInputNSpinner

Description

In BBj 7.0 and higher, this method creates a BBjInputNSpinner on the BBjWindow.

Syntax

Return Value

Method

BBjInputNSpinner

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

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, int min, int max)

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, string flags$)

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, float min, float max)

BBjInputNSpinner

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

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, float min, float max)

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, string rules$)

BBjInputNSpinner

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

BBjInputNSpinner

addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, string rules$, float restore, float value, float min, float max)

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 Description

$02$ 

Causes commas and numeric characters to be copied when generating the edit mask from mask$.

$80$

Causes the system to beep upon entry of invalid data.

$04$ 

Accepts the decimal point replacement character for data entry defined by SETOPTS(6,1).

restore

Restore value.

val

Default value.

min

The minimum value to which the spinner may spin

max

The maximum value to which the spinner may spin

Return Value

Returns the created object.

Remarks

A BBjInputNSpinner adds spinner functionality to a standard BBjInputN control.

Example

Copy

BBjWindow::addInputNSpinner 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
RETURN

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjInputNSpinner

BBjInputN

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