RadioButtons

(System Library)

Description: Draws a set of labeled radio buttons with (optional) title and border.
Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: Bevel | CheckBox | ColorSelect | DropList | DropTree | Edit | GridList | HScrollbar | Listbox | SpinBox | SplitList | TextBox | ToolBar | VScrollbar
Format: System.RadioButtons(X1, Y1, X2, Y2, Labels, Select [, FocusID, Border, Title, BtnsOnLeft, AlignTitle, AllowTextResizing, LeftToRight, BGColor, FGColor, Spacing, EnableFlags, Height, DotColorParm, TitleBGColor, TitleFGColor, BevelColor])
Parameters:  
X1
Required. Any numeric expression giving the X coordinate on the screen of one side of the radio buttons.
Y1
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the radio buttons.
X2
Required. Any numeric expression giving the X coordinate on the screen of the side of the radio buttons opposite to X1.
Y2
Required. Any numeric expression giving the Y coordinate on the screen of the top or bottom of the radio buttons, whichever is the opposite to Y1.
Labels
Required. An array of text expressions used to label the buttons. The number of labels determines the number of buttons.
Select
Required. A variable whose value will be set to the index from 0 of the selected button. If the value of this variable is initially invalid, it will default to 0.
FocusID
An optional parameter that is any numeric expression from 0 to 32767 for the focus number of the first radio button. Each radio button following will have a focus ID number equal to the next number in sequence.
If this value is 0, the radio buttons will display the current setting of Select, but its value will not be able to be changed and the buttons will appear grayed out. The default value is 1.
Border

Optional numeric that may have the following values:

0 = No outline (default)

1 = Raised box outline

2 = Bevel outline

Title
An optional parameter that is any text expression to be used as a title with the radio buttons. The default value is to have no title.
BtnsOnLeft
An optional parameter that is any logical expression. If true (non-0) the radio buttons will appear to the left of their labels, if false (0) they will be to the right. The default value is true.
AlignTitle
An optional parameter that is any logical expression. If true (non-0) the title is drawn within the radio buttons' boundaries, if false(0) the buttons fill their bounding area and the title is added at the top (i.e. it extends past the top boundary). The default is true.
AllowTextResizing
An optional flag. If true, then text will resize with the control.
LeftToRight
An optional flag. If true, the buttons will be drawn from left to right.
BGColor
Optional. Any numeric expression for the background color of the control. No default value.
FGColor
Optional. Any numeric expression for the foreground color of the control (text color). No default value.
Spacing

Optional. Any of:

  • FALSE/Invalid = Full spacing
  • TRUE = Standard spacing
  • Array = An array of numeric values, providing the spacing in pixels to be used between one button and the next.
EnableFlags
Optional. An array of flags to enable or disable single buttons.
Height
Optional return value. If a variable is provided for this parameter the function will be set to the control's height, measured in pixels. Standard spacing will be used unless a spacing array has been provided.
DotColorParm
Optional color value, to be used for the radio dot.
TitleBGColor
Optional background color value to be used for the title bar.
TitleFGColor
Optional foreground color value to be used for the title text.
BevelColor
Optional color value to be used for the bevel line.
Comments:

This module is a member of the System Library, and must therefore be prefaced by \System. as shown in the "Format" section.

If your application predates version 11.2, use the backslash notation rather than dot: \System\

The parameters X1, Y1, X2 and Y2 define the outline of the buttons including their border, if there is one. If the area is too small to fully display the buttons they will extend beyond their right and bottom boundaries. Buttons and their border will not overlap each other and will always be shown in their entirety, although the labels may be clipped or entirely deleted.
For any optional parameter that is to be set, all optional parameters preceding the desired one must be present, although they may be invalid.

This does not return TRUE on change and should not be used as the trigger for an action statement. Instead, use a Watch on the variable being modified by the radio button selection.

Example:

System.RadioButtons(10, 10, 300, 210 { Outline of buttons },
                    Types { An array of labels },
                    Selected { Selected btn (from 0)},
                    4 { First btn's focus ID },
                    1 { Show border },
                    "PLC Types" { Title of the buttons },
                    0 { Buttons on the right });