Radio box

Radio boxes are lists containing small, circular buttons to the left of the entries (or options), only one of which can be selected at a time.

Radio boxes are provided to allow selection of only one option from several pre-defined alternatives. They can be used, for instance, for setting data point values or triggering actions such as switching between automatic mode, manual mode and "off".

Figure 1. Radiobox

To create a radiobox

  1. Click on the radio box tool .

  2. Click in the panel work area. Define the size.

  3. Open the Property Sheet

  4. Specify the name of the radio box in the field Name.

  5. Enter the options using the editor. The editor is opened via the ... button.

Figure 2. Radiobox Editor

Clicking on the Add After button places the new option after the option selected in the editor. Clicking on the Add Before button places the new option in front of the option selected in the editor. An option can be renamed by clicking on the Rename button. Clicking on the Remove button deletes the selected option.

If you made the radiobox too wide or too narrow for the options, you can change the width of the box afterwards by selecting the box and then dragging the corresponding boundary marking with the mouse.

The text formatting for the list options can be edited in the Property Sheet.

A double-click on the radiobox in the panel during engineering opens the Radiobox Editor.

A Radio box can be displayed either vertically or horizontally by setting the "vertical" property in the property sheet

Example

The following example contains a script for a radio box with four options indicating the status of a valve (closed, closing, opening, open). The function dpConnect() calls the switching() function whenever there is a change in the online value of the data point "VD01.OnOff". This sets the radio box options according to the online value. It is assumed that the online values 0, 1, 2 and 3 are assigned to the switch statuses.

main()
{
  dpConnect("switching", "VD01.OnOff:_online.._value");
}
switching(string dp, int s)
{
  setValue("", "number", s);
}                        

For graphics functions see Control Graphics/Radiobox functions.