xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

@...GET CHECKBOX

Creates a Get object as check box and displays it to the screen.

Syntax

@ <nRow>, <nCol> ;
      GET <lLogicVar> ;
 CHECKBOX ;
 [CAPTION <cCaption>] ;
 [MESSAGE <cMessage>] ;
    [WHEN <lWhen>] ;
   [VALID <lValid>] ;
   [COLOR <cColor>] ;
   [FOCUS <bFocus>] ;
   [STATE <bState>] ;
   [STYLE <cStyle>] ;
    [SEND <msg>] ;
 [GUISEND <guimsg>]

Arguments

@ <nRow>, <nCol>
The parameters are numeric values specifying the row and column coordinates for the screen output. The range for rows on the screen is 0 to MaxRow(), and for columns it is 0 to MaxCol(). The coordinate 0,0 is the upper left corner of the screen.
GET <lLogicVar> CHECKBOX
This is a memory or field variable holding a logical value to be edited by the user.
CAPTION <cCaption>
This is a character string displayed as caption of the check box. The caption string may include an ampersand character (&) which marks the next character as accelerator key. Pressing the Alt key together with the accelerator key allows the user to jump directly to the check box.
MESSAGE <cMessage>
This is an optional character string displayed in the message row when the check box has input focus. The message row is defined with the MSG AT option of the READ command.
WHEN <lWhen>
This is a logical expression or a code block returning a logical value. If specified, <lWhen> must result in .T. (true) to allow editing. If the expression yields .F. (false), the check box cannot receive input focus.
VALID <lValid>
This is a logical expression or a code block returning a logical value. If specified, <lValid> must result in .T. (true) to end editing. When the result is .F. (false), the currently edited value of <lLogicVar> is invalid and the user cannot leave the check box unless editing is cancelled.
COLOR <cColor>
The parameter <cColor> is an optional character string defining the colors for the display of the check box and its caption. It defaults to the current SetColor() setting. <cColor> must have four color values (see ColorSelect()). They are used as follows:

Color values for check boxes
Color valueDescription
1Color when the check box does not have input focus
2Color when the check box has input focus
3Color for the check box's caption
4Color for the check box's accelerator key

FOCUS <bFocus>
This is an optional code block which is evaluated when the check box receives input focus. The code block is evaluated without parameters.
STATE <bState>
This is an optional code block which is evaluated when the check box's state is changed by the user. The code block is evaluated without parameters.
STYLE <cStyle>
The display style of a check box can be specified with an optional character string of four characters. They are used as follows:

Characters for the display style
PositionDescription
1Left delimiter of check box
2Character for the Checked state
3Character for the Unchecked state
4Right delimiter of check box

SEND <msg>
This is an optional message to be sent to the Get object before it is displayed. Refer to the Get class for possible messages that can be sent to the Get object.
GUISEND <guimsg>
This is an optional message to be sent to the HbCheckbox() object associated with the Get() object before both are displayed. Refer to the HbCheckBox class for possible messages that can be sent to the check box object.

Description

The @...GET CHECKBOX command creates a Get() object and assigns a HbCheckBox() object to the oGet:control instance variable. The HbCheckBox() object displays a check box in text mode and allows a user to edit a logical state (On or Off) within the READ command. The variable <lLogicVar> must be initialized with a logical value before READ is called.

The Get object created with @...GET CHECKBOX is stored in the current Getlist array. The Get object communicates with the associated HbCheckBox object while the READ command is active. This communication ensures that focus and state changes are properly displayed on the screen.

Info

See also:@...GET, Get(), HbCheckBox()
Category: Get system , Input commands
Source:rtl\checkbox.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays two Gets as check boxes using
// different styles.

   PROCEDURE Main
      LOCAL lVar1 := .F.
      LOCAL lVar2 := .T.

      CLS

      @ 3, 3 GET lVar1 CHECKBOX ;
         CAPTION "&Married      " ;
           STYLE "[x ]"  ;
           COLOR "N/BG,W+/BG,N/BG,GR+/BG"

      @ 5, 3 GET lVar2 CHECKBOX ;
         CAPTION "&Self employed" ;
           STYLE "[o ]"  ;
           COLOR "N/BG,W+/BG,N/BG,GR+/BG"

      READ

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe