RADIO

From Macros Wiki
Jump to: navigation, search

Up

Command

RADIO
RADIO <left>, <top>, <width>, <height>, <text>, <variable>, [<default>], [<group number>]


Define the size and the position of a radio button and the text to be displayed next to it.

Parameters

<left>
Start position measured from the left edge of the dialog.
<top>
Start position of measured from the top edge of the dialog.
<width>
Width of the control.
<text>
Text to be displayed next to the radio button.
<variable>
Variable to be set to the state of the button. 0 for not selected, 1 for selected.
[<default>]
Optional default value.
[<group number>]
Radio Group number.

Example

RADIO 70, 44, 70, 24, "Square", type4, 1, 1

To group several radio buttons together, set them all to the same group number and use the same variable name and default value for each of them.
The first radio button in the group will be number 1, the second 2 and so on. Using radio button groups provides a simple way of selecting the
the button to be selected when the dialog is opened and checking which button was selected when the dialog was closed.

RADIO 70, 120, 70, 24, "Up", DirectionVar, DefaultButton, 3
RADIO 70, 150, 70, 24, "Down", DirectionVar, DefaultButton, 3
RADIO 70, 180, 70, 24, "Left", DirectionVar, DefaultButton, 3
RADIO 70, 210, 70, 24, "Right", DirectionVar, DefaultButton, 3
This defines a group of 4 radio buttons (group number 3).
Set the variable "DefaultButton" to the radio button to be selected when the dialog is displayed.
The variable "DirectionVar" will be set to the button that was selected when the dialog was closed.
For an example macro see GetCommands.dlg