Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ XR Studio

Radio Button example

  • Last UpdatedDec 06, 2023
  • 1 minute read

Radio buttons are mutually exclusive stateful buttons that are typically used in the human interfaces.

Code example

This is a code example that creates a group of three radio buttons.

<!-- group definition -->

<rect name="radioGroup" size="200 200" position="100 100">

<button name="b1" show="true" position="20 20" size="10 10" >

<rect image="on.png" order="5" show="true" />

<rect image="off.png" order="5" show="true" />

</button>

<button name="b2" show="true" position="20 20" size="10 10" >

<rect image="on.png" order="5" show="true" />

<rect image="off.png" order="5" show="true" />

</button>

<button name="b3" show="true" position="20 20" size="10 10" >

<rect image="on.png" order="5" show="true" />

<rect image="off.png" order="5" show="true" />

</button>

<rect/>

<!-- selection check command blocks -->

<command name="checkB1">

<setField field="b1.selected" value="true" />

<setField field="b2.selected" value="false" />

<setField field="b3.selected" value="false" />

</command>

<command name="checkB2">

<setField field="b1.selected" value="false" />

<setField field="b2.selected" value="true" />

<setField field="b3.selected" value="false" />

</command> <command name="checkB3">

<setField field="b1.selected" value="false" />

<setField field="b2.selected" value="false" />

<setField field="b3.selected" value="true" />

</command>

<!-- buttons to command checks routings -->

<route from="b1.mouseDown" to="checkB1.execute" />

<route from="b2.mouseDown" to="checkB2.execute" />

<route from="b3.mouseDown" to="checkB3.execute" />

TitleResults for “How to create a CRG?”Also Available in