
BBjWindow::addInputNSpinner
Description
In BBj 7.0 and higher, this method creates a BBjInputNSpinner on the BBjWindow.
Syntax
Return Value |
Method |
---|---|
addInputNSpinner(int ID, int x, int y, int w, int h) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, int min, int max) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, float min, float max) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, float min, float max) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, string rules$) |
|
addInputNSpinner(int ID, int x, int y, int w, int h, string flags$, string mask$, string rules$, float restore, float value) |
|
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:
|
||||||||||||||||
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.
|
||||||||||||||||
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
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
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.