RadioButton

The value types RadioGroup and RadioButton ares used to create radio buttons.

../../../../_images/RadioButton.png

Syntax

<Parameter>
<Name>RadioGroupValue</Name>
<Text>RadioGroup</Text>
<Value>1</Value>
<ValueType>RadioGroup</ValueType>

<Parameter>
<Name>RadioButtonValue1</Name>
<Text>RadioButton</Text>
<Value>1</Value>
<ValueType>RadioButton</ValueType>
</Parameter>
<Parameter>
<Name>RadioButtonValue2</Name>
<Text>RadioButton</Text>
<Value>2</Value>
<ValueType>RadioButton</ValueType>
</Parameter>
<Parameter>
<Name>RadioButtonValue3</Name>
<Text>RadioButton</Text>
<Value>3</Value>
<ValueType>RadioButton</ValueType>
</Parameter>
</Parameter>

The value of the RadioButton can be an integer, float or string value. A combination of these value types within a RadioGroup is possible:

../../../../_images/MultiValueTypeRadioButton.png

The <Parameter> node with the value type RadioGroup groups the child <Parameter> nodes with the type RadioButton and is the value holder for the value of the selected radio button.

Within the PythonPart script (py-file), the selected value is then also accessed via this parameter.

Optional tags

If the PythonPart should be localized, the following tag must be added

<TextId>1001</TextId>

Sometimes it’s useful to disable or hide the radio button depending on the value of another parameter. This is achieved by adding additional tags to the parameter or by defining functions in the py-file. See Enable and visible options

The persistent state of the parameter can be changed by adding

<Persistent></Persistent>

Example

The implementation of the RadioGroup value type is described in the example RadioButtons, which is located in

…\etc\Examples\PythonParts\PaletteExamples\RadioButtons.pyp
…\etc\PythonPartsExampleScripts\PaletteExamples\RadioButtons.py