| xHarbour Reference Documentation > Command Reference |
![]() |
![]() |
![]() |
Creates a Get object as radio button group and displays it to the screen.
@ <nTop>, <nLeft>, <nBottom>, <nRight> ;
GET <nVar>|<cVar> ;
RADIOGROUP <aRadioButtons> ;
[CAPTION <cCaption>] ;
[MESSAGE <cMessage>] ;
[WHEN <lWhen>] ;
[VALID <lValid>] ;
[COLOR <cColor>] ;
[FOCUS <bFocus>] ;
[SEND <msg>] ;
[GUISEND <guimsg>]
Color values for radio button groups
| Color value | Description |
|---|---|
| 1 | Color for the border around the radio button group |
| 2 | Color for the caption |
| 3 | Color for the accelerator key |
The @...GET RADIOGROUP command creates a Get() object and assigns a HbRadioGroup() object to the oGet:control instance variable. The HbRadioGroup() object displays all HbRadioButton() objects stored in the <aRadioButtons> array in text mode and allows a user to select one of the redio buttons while the READ command is active. The position or the data of the selected radio button is assigned to the edited variable when READ is terminated.
The Get object created with @...GET RADIOGROUP is stored in the current Getlist array. The Get object communicates with the associated HbRadioGroup object while the READ command is active. This communication ensures that focus and state changes are properly displayed on the screen.
| See also: | @...GET, Get(), HbRadioButton(), HbRadioGroup() |
| Category: | Get system , Input commands |
| Source: | rtl\radiogrp.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example demonstrates how radio button groups can be integrated
// in the Get list and are filled with radio buttons.
#include "Inkey.ch"
PROCEDURE Main
LOCAL aRadio1[3], aRadio2[4]
LOCAL nSpeed, cPages
LOCAL cColor1 := "W/B,W+/B,R/W+"
LOCAL cColor2 := "N/BG,N/BG,GR+/BG,GR+/BG,N/BG,W+/BG,GR+/BG"
SET EVENTMASK TO INKEY_ALL
SET COLOR TO N/BG
CLS
nSpeed := 1 //default to the first item.
aRadio1[ 1 ] := HbRadioButton():new( 4, 22, "&slow" )
aRadio1[ 2 ] := HbRadioButton():new( 5, 22, "&medium" )
aRadio1[ 3 ] := HbRadioButton():new( 6, 22, "&fast" )
AEval( aRadio1, {|o| o:colorSpec := cColor2 } )
cPages := "all"
aRadio2[ 1 ] := HbRadioButton():new( 10, 22, "&first page", "this" )
aRadio2[ 2 ] := HbRadioButton():new( 11, 22, "&this page" , "first")
aRadio2[ 3 ] := HbRadioButton():new( 12, 22, "&last page" , "last" )
aRadio2[ 4 ] := HbRadioButton():new( 13, 22, "&all pages" , "all" )
AEval( aRadio2, {|o| o:colorSpec := cColor2 } )
@ 3, 20, 7, 40 GET nSpeed ;
RADIOGROUP aRadio1 ;
CAPTION "&Speed" ;
COLOR cColor1
@ 9, 20, 14, 40 GET cPages ;
RADIOGROUP aRadio2 ;
CAPTION "&Pages" ;
COLOR cColor1
READ
? nSpeed, cPages
RETURN
http://www.xHarbour.com