User Tools

Site Tools


check.htm
Navigation:  Language Reference > 8 - Controls > Control Declarations >====== CHECK (declare a checkbox control) ====== Previous pageReturn to chapter overviewNext page
CHECK(text) ,AT( ) [,CURSOR( )] [,USE( )] [,DISABLE] [,KEY( )] [,MSG( )] [,HLP( )] [,SKIP]
[,FONT( )] [,ICON( )] [,FULL] [,SCROLL] [,ALRT( )] [,HIDE] [,DROPID( )] [,TIP( )]
[, LEFT ] [,VALUE( )] [,TRN] [,COLOR( )] [,FLAT] [,LAYOUT] [,EXTEND( )]
RIGHT

blk2blue.jpg

CHECK Places a check box on the WINDOW, TOOLBAR, or REPORT.
text A string constant containing the text to display next to the check box (PROP:Text). This may contain an ampersand (&) to indicate the “hot” letter for the check box.
AT Specifies the initial size and location of the control (PROP:AT). If omitted, default values are selected by the runtime library.
CURSOR Specifies a mouse cursor to display when the mouse is positioned over the control (PROP:CURSOR). If omitted, the WINDOW's CURSOR attribute is used, else the Windows default cursor is used. Not valid in a REPORT.
USE The label of a variable to receive the value of the check box (PROP:USE). Zero (0) indicates OFF (un-checked) or one (1) indicates ON (checked) unless the VALUE attribute specifies other values.
DISABLE Specifies the control appears dimmed in the WINDOW or APPLICATION (PROP:DISABLE).
KEY Specifies an integer constant or keycode equate that immediately gives focus to and toggles the box (PROP:KEY). Not valid in a REPORT.
MSG Specifies a string constant containing the text to display in the status bar when the control has focus (PROP:MSG). Not valid in a REPORT.
HLP Specifies a string constant containing the help system identifier for the control (PROP:HLP). Not valid in a REPORT.
SKIP Specifies the control does not receive input focus and may only be accessed with the mouse or accelerator key (PROP:SKIP). Not valid in a REPORT.
FONT Specifies the display font for the control (PROP:FONT).
ICON Specifies an image file or standard icon to display on the button face of a “latching” pushbutton (PROP:ICON). Not valid in a REPORT.
FULL Specifies the control expands to occupy the entire size of the WINDOW or REPORT band for any missing AT attribute width or height parameter (PROP:FULL).
SCROLL Specifies the control scrolls with the window (PROP:SCROLL). Not valid in a REPORT.
ALRT Specifies “hot” keys active for the control (PROP:ALRT).
HIDE Specifies the control does not appear when the WINDOW or APPLICATION is first opened, or the control is not printed in the REPORT (PROP:HIDE). UNHIDE must be used to display or print it.
DROPID Specifies the control may serve as a drop target for drag-and-drop actions (PROP:DROPID). Not valid in a REPORT.
TIP Specifies the text that displays as “balloon help” when the mouse cursor pauses over the control (PROP:ToolTip). Not valid in a REPORT.
LEFT Specifies that the text appears to the left of the check box (PROP:LEFT).
RIGHT Specifies that the text appears to the right of the check box (PROP:RIGHT). This is the default position.
VALUE Specifies the true and false values the USE variable receives when the box is checked by the user (PROPTrueValue and PROP:FalseValue).
TRN Specifies the control transparently displays over the background (PROP:TRN).
COLOR Specifies a background color for the control's text (PROP:COLOR).
FLAT Specifies the button appears flat except when the mouse cursor passes over the control (PROP:FLAT). Requires the ICON attribute. Not valid in a REPORT.
LAYOUT Specifies the control's left-to-right or right-to-left display orientation (PROP:LAYOUT)
STATE3 Specifies the CHECK control supports three states. (ON, OFF and INDETERMINATE). You can specify the value the USE variable receives using PROP:State3Value
READONLY Sets the Checkbox to READONLY (PROP:READONLY)
EXTEND Specifies special document formatting information. This information contains a valid string of attributes that are assigned to a designated REPORT control for a given document type. Valid only in a REPORT.

The CHECK control places a check box on the WINDOW, TOOLBAR, or REPORT at the position and size specified by its AT attribute. It is available for Windows, and Report structures.

The CHECK control can offer either two states (ON or OFF) or three states (ON, OFF and INDETERMINATE).

By default, when the CHECK is unchecked (off) the USE variable receives a value of zero (0); when the CHECK is checked (on), the USE variable receives a value of one (1), and when the CHECK is in indeterminate state the USE variable receives a value of two (2) . The VALUE attribute can be used to change the default ON/OFF values, and set the USE variable to other values. You can also use the runtime properties PROP:TrueValue and PROP:FalseValue.
 
If the STATE3 attribute is enabled then you have a three-state checkbox. You can specify the value the USE variable receives in the Designer or at runtime with PROP:State3Value.


Note: if you designate a STRING variable as the USE variable, you must explicitly assign a VALUE attribute.


Latched Button
A CHECK control that has a value for the ICON attribute appears as a “latched” button with the image displayed on the button face. When the button appears “up” the CHECK is off; when it appears “down” (latched) the CHECK is on.

Events Generated:

EVENT:Selected The control has received input focus.
EVENT:Accepted The control has been toggled by the user.
EVENT:PreAlertKey The user pressed an ALRT attribute hot key.
EVENT:AlertKey The user pressed an ALRT attribute hot key.
EVENT:Drop A successful drag-and-drop to the control.

Example:

MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL

         CHECK('1'),AT(0,0,20,20),USE(C1)

         CHECK('2'),AT(0,20,20,20),USE(C2),VALUE('T','F')

        END

CustRpt  REPORT,AT(1000,1000,6500,9000),THOUS

CustDetail DETAIL,AT(0,0,6500,1000)

           CHECK('1'),AT(0,0,20,20),USE(C1)

           CHECK('2'),AT(20,80,20,20),USE(C2),LEFT

           CHECK('3'),AT(0,100,20,20),USE(C3),FONT('Arial',12)

          END

        END

CODE

OPEN(MDIChild)

ACCEPT

 CASE ACCEPTED()

 OF ?C1

  IF C1 = 1 THEN DO C1Routine.

 OF ?C2

  IF C2 = 'T' THEN DO C2Routine.

 END

END

See Also:

BUTTON

OPTION

RADIO

check.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1