--Using ActionGroup
1 post
• Page 1 of 1
--Using ActionGroup
This article is outdated - please use our new system at
https://doc.sibvisions.com
If you have multiple radio/toggle buttons in your UI and have the use-case that only one button should be selected than the ActionGroup is a perfect match. The ActionGroup handles a set of radio/toggle buttons and ensures that only one button in the group is selected.
The ActionGroup has an action event that triggers notifications when the selection has been changed.
UIRadioButton butHLeft = new UIRadioButton("Left");
UIRadioButton butHCenter = new UIRadioButton("Center");
UIRadioButton butHRight = new UIRadioButton("Right");
UIRadioButton butHStretch = new UIRadioButton("Stretch");
ActionGroup buttonGroup = new ActionGroup(butHLeft, butHCenter, butHRight, butHStretch);
UIRadioButton butHCenter = new UIRadioButton("Center");
UIRadioButton butHRight = new UIRadioButton("Right");
UIRadioButton butHStretch = new UIRadioButton("Stretch");
ActionGroup buttonGroup = new ActionGroup(butHLeft, butHCenter, butHRight, butHStretch);
The selected button can be changed programmatically by index
or by button
Use eventAction to get notifications about selection changes:
-
Development@SIB - Posts: 325
- Joined: Mon Sep 28, 2009 1:54 pm
1 post
• Page 1 of 1