ProvideX V8.20 > Language Reference > 2. Directives
51
Format 7: Logical On/Off
CHECK_BOX {ON | OFF} [*]ctl_id[,ERR=stmtref]
Use the CHECK_BOX {ON | OFF} format to make it appear that a check box is
depressed or released; e.g.,
0030 CHECK_BOX OFF 110,ERR=0040
Note: This does not alter its state; i.e., "checked" or "unchecked". Use CHECK_BOX
WRITE to do that.
Format 8: Read Activation Status
CHECK_BOX READ [*]ctl_id,state$[,mode$][,ERR=stmtref]
Use the CHECK_BOX READ format to receive the current state of the check box ("0"=
off and "1"= on). Use the second (optional) string variable to have ProvideX return
the user's method of toggling the check box. Once read, this field is reset to $00$.
Some of the possible values are:
$01$ for MOUSE-CLICK.
$02$ for DOUBLE MOUSE-CLICK.
$0D$ for Enter .
$20$ for SPACEBAR (and keyboard HotKey, as in the example below.
$00$ when the user exits the check box.
Read the user's selection(s) to make them available to your applications. The
ON_OFF$ variable in the example below receives the current on/off state. For
STROKE$ in the example below, ProvideX returns $20$ when the user makes the
selection using either SPACEBAR or the &T hot key Alt -T.
0010 ! CHECK_BOX Example
0020 PRINT 'CS'; LIST
0030 CHECK_BOX 90,@(40,17,25,3)="&Toggle for Status"
0040 LET C_BX=90; LET C_BX'BACKCOLOUR$="LIGHT CYAN"
0050 SETCTL C_BX:READ_BOX
0060 CHECK_BOX GOTO C_BX
0070 PRINT @(40,24),"HotKey=<Alt-T>. Try Mouse and keyboard too. END=<F4>"
0080 GETINPUT:
0080:OBTAIN (0,SIZ=1,ERR=GETINPUT)@(0,0),'CURSOR'("off"),'ME',IN_VAR$,'MN';
0080:LET CT=CTL
0090 IF CT=4 THEN GOTO END
0100 READ_BOX:
0110 CHECK_BOX READ C_BX,ON_OFF$,STROKE$
0120 ! WRITE_BOX
0130 CHECK_BOX WRITE C_BX,ON_OFF$
0140 PRINT @(40,20),"Current Status: ",ON_OFF$
0150 PRINT @(40,21),"Key Stroke : ",HTA(STROKE$)