BBjInputD::setPlusMinus

Description

In BBj 5.0 and higher, this method specifies the keys used to scan forward and backward through dates in this BBjInputD control.

Syntax

Return Value

Method

void

setPlusMinus(boolean PlusMinus)

Parameters

Variable

Description

PlusMinus

Selects the keys that will be used to scan through dates in this BBjInputD control:

0 = Scan using the default keys (up-arrow and down-arrow)

1 = Scan using alternate keys (+ and -)

Return Value

None.

Remarks

By default, the up arrow and down arrow keys scan forward and backward through dates.

Example

REM Scan through dates with +/- or up-arrow/down-arrow

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=120
TITLE$="BBj Window"

REM Set the current context
mySysGui!.setContext(0)

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

REM Add an InputD control
myInputD! = myWindow!.addInputD(101,50,10,90,30,$080c$,"",$$,0,0)

REM Add a text control
myLabel! = myWindow!.addStaticText(102,50,50,140,30,$$,"")

REM Use +/- instead of up/down?
PlusMinus! = myWindow!.addCheckBox(103,50,70,150,30,"Scan with +/-?")

gosub ShowPlusMinus

DIM EVENT$:TMPL(SYSGUI),GENERIC$:NOTICETPL(0,0)

REM Register the CALLBACK routines
CALLBACK(ON_CHECK_ON,PlusMinusOn,mySysGui!.getContext(),PlusMinus!.getID())
CALLBACK(ON_CHECK_OFF,PlusMinusOff,mySysGui!.getContext(),PlusMinus!.getID())
CALLBACK(ON_CLOSE,APP_CLOSE,mySysGui!.getContext())

REM Process Events
PROCESS_EVENTS

PlusMinusOn:
myInputD!.setPlusMinus(1)
gosub ShowPlusMinus
return

PlusMinusOff:
myInputD!.setPlusMinus(0)
gosub ShowPlusMinus
return

ShowPlusMinus:
msg$ = iff(myInputD!.getPlusMinus(),"+/-","up/down")
myLabel!.setText("Scan with: "+msg$)
return

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

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

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



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.