Click or drag to resize

RadioButtonGroup.FillUsing Method

X#
Specify the radio buttons that make up the group and the set of values corresponding to these buttons, using an array.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD FillUsing(
	aContents
) AS USUAL CLIPPER
Request Example View Source

Parameters

aContents (Optional)
Type: Usual
The array containing existing radio buttons or the values that should be used to create radio buttons. A two-dimensional array may be used to define the values to be returned to the program when a radio button is selected; this 'other' value is what is returned in the RadioButtonGroup:Value property, and what is stored in the database if the control is associated with a database field. If a one-dimensional array is specified, the values are returned as 1, 2, 3... Thus, the array may be specified in one of two formats: 1. One-dimensional array containing radio button objects that are to be linked to the group 2. Two-dimensional arrays, each element containing a RadioButton object and the corresponding value returned to the program Note: the two dimensional array has the same structure as that returned by DBServer:GetLookupTable().

Return Value

Type: Usual
Remarks
For fixed structures, the individual radio buttons may be created as regular controls, either dynamically or through a resource entity, and assigned to the group through the FillUsing() method.
Tip Tip
The radio button group may be associated with a database field, just like any other control.
Examples
Create a radio button group with different currencies, showing an explicit representation to the user but using a different representation internally. This example, shown below, with the radio buttons explicitly created through a resource entity. The code simply links the radio buttons to the group:
X#
 1RESOURCE OrderWindow DIALOG 7,11,239,196
 2STYLE WS_CHILD
 3FONT 8,"MS Sans Serif"
 4BEGIN
 5CONTROL "Currency",;
 6ORDERWINDOW_CURRENCY,"Button";
 7BS_GROUPBOX|WS_GROUP|WS_CHILD,;
 827,33,85,122
 9CONTROL "U.S. Dollars",;
10ORDERWINDOW_THERADIOBUTTON1,"Button";
11BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
1238,45,57,11
13CONTROL "Can. Dollars",;
14ORDERWINDOW_THERADIOBUTTON2,"Button";
15BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
1638,63,69,11
17CONTROL "Mexican Pesos",;
18ORDERWINDOW_THERADIOBUTTON3,"Button";
19BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
2038,82,69,11
21CONTROL "Yen",;
22ORDERWINDOW_THERADIOBUTTON4,"Button";
23BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
2438,100,68,11
25CONTROL "British Pounds",;
26ORDERWINDOW_THERADIOBUTTON5,"Button";
27BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
2838,118,68,11
29CONTROL "German Marks",;
30ORDERWINDOW_THERADIOBUTTON6,"Button";
31BS_AUTORADIOBUTTON|WS_TABSTOP|WS_CHILD,;
3238,137,69,11
33METHOD Init(oWindow,iCtlID,oServer) CLASS OrderWindow
34SUPER:Init(oWindow,ResourceID{"OrderWindow"},iCtlID)
35oCCTheRadioButton1 := RadioButton{SELF,;
36ResourceID{ORDERWINDOW_THERADIOBUTTON1}}
37RadioButton1:HyperLabel := {#TheRadioButton1,;
38"U.S. Dollars",,}
39oCCTheRadioButton2 := RadioButton{SELF,;
40ResourceID{ORDERWINDOW_THERADIOBUTTON2}}
41RadioButton2:HyperLabel := {#TheRadioButton2,;
42"Can. Dollars",,}
43oCCTheRadioButton3 := RadioButton{SELF,;
44ResourceID{ORDERWINDOW_THERADIOBUTTON3}}
45RadioButton3:HyperLabel := {#TheRadioButton3,;
46"Mexican Pesos",,}
47oCCTheRadioButton4 := RadioButton{SELF,;
48ResourceID{ORDERWINDOW_THERADIOBUTTON4}}
49RadioButton4:HyperLabel := {#TheRadioButton4,;
50"Yen",,}
51oCCTheRadioButton5 := RadioButton{SELF,;
52ResourceID{ORDERWINDOW_THERADIOBUTTON5}}
53RadioButton5:HyperLabel := {#TheRadioButton5,;
54"British Pounds",,}
55oCCTheRadioButton6 := RadioButton{SELF,;
56ResourceID{ORDERWINDOW_THERADIOBUTTON6}}
57RadioButton6:HyperLabel := {#TheRadioButton6,;
58"German Marks",,}
59oDCCCurrency := RadioButtonGroup{SELF,;
60ResourceID{ORDERWINDOW_CURRENCY}}
61oDCCCurrency:FieldSpec := ;
62FieldSpec{#Currency,STRING,3,0}
63oDCCurrency:FillUsing({;
64{oCCTheRadioButton1,"USD"},;
65{oCCTheRadioButton2,"CDN"},;
66{oCCTheRadioButton3,"MEX"},;
67{oCCTheRadioButton4,"YEN"},;
68{oCCTheRadioButton5,"UK"},;
69{oCCTheRadioButton6,"DM"};
70})
71oDCCurrency:HyperLabel := {#Currency,"Currency",,}
See Also