HTBasic Help
×
Menu
Index

Radiobutton Widget

 
_______________________________________________________
RADIOBUTTON Widget
Provides a bank of buttons in which only one button at a time can be depressed
_______________________________________________________
 
Legal Usage                Level-0 Widget:                Yes
                 Parent to:                None
                 Child of:                        PANEL
 
Example Image
 
     
 
Example Program
 
See RADIOBUTTON Widget for an example program that produces a displaysimilar to that shown above.
 
Attributes
 
See RADIOBUTTON Widget Attributes for the RADIOBUTTON widget attribute list.
 
Remarks
 
The RADIOBUTTON widget displays a bank of buttons, only one of which can be depressed at a time. The RADIOBUTTON widget exhibits the properties of an old automobile radio's buttons. That is, when you press one button, the others pop out or are released. The RADIOBUTTON widget works correctly only when it is a member of a "tab group".
 
The RADIOBUTTON widget is an extension of the TOGGLEBUTTON concept. Like a TOGGLEBUTTON, a RADIOBUTTON has a VALUE attribute. Click on the button once, and VALUE is set to 1. Click on it again, and VALUE is cleared back to 0.
 
A CHANGED event can be enabled to occur whenever you click on it. Each RADIOBUTTON has a circle in it. Set the RADIOBUTTON and the circle appears filled. Clear the RADIOBUTTON and the circle is cleared.
 
If you set or clear a TOGGLEBUTTON it has no direct effect on anything else in the user interface. However, if you create a tab group of RADIOBUTTONs, only one RADIOBUTTON in the group can be set at a time. If you set a different RADIOBUTTON in the tab group, any other RADIOBUTTON already set will be cleared.
 
The RADIOBUTTON widget operation is as described here only when it is a member of a "tab group".If one RADIOBUTTON in a tab group has been set to 1 and you set another RADIOBUTTON to 1, TWO CHANGED events occur - one for the original button as it is cleared, and another for the new button as it is set.
 
When you click on a RADIOBUTTON, an event is generated for the button and the program lists the state (set or 1, clear or 0) of the button in the PRINTER widget. If you set a button, and there is already a button set in the same tab group, the "old" button will be cleared, generating an event to have its cleared state listed in the PRINTER widget. Also, the "new" button will be set, generating a second event to have its set state listed in the PRINTER widget.
 
Clicking on a button in a tab group causes that button's circle to be set, with no other effects in any other group. However, if you then click on another button in a tab group, the first button's circle in that group will be cleared and the new button's circle will be set.RADIOBUTTON behavior is convenient for selecting a value from a set of members that are mutually exclusive. That is, a set where you can choose one of several, but never more than one at a time.
 
Events
 
Events for the RADIOBUTTON widget are:
 
·
CHANGED
·
SYSTEM MENU
·
CHANGED
 
An event is generated when the user "presses" the RADIOBUTTON by clicking on it with the left mouse button or by pressing the Spacebar while the focus is on the RADIOBUTTON. Within a tab group of RADIOBUTTON widgets, two CHANGED events will be generated when you click on one of the RADIOBUTTON widgets:
 
·
First, the previously selected button generates a CHANGED event as it is deselected.
·
Second, the button you select now generates a CHANGED event
 
SYSTEM MENU
 
This event is generated when the operator selects items from the SYSTEM MENU.