Back to Push Button Object
Up to Table of Contents
Ahead to Text Objects

Radio Button Object

Use Radio Buttons to let the user choose between two or more mutually exclusive options. For example, your application can display three Radio Buttons to let the user choose one of three images they want to display. Use the Radio Button tool to draw a Radio Button object. The tool appears as follows:

Radio Button Appearance

The following figure shows an example of how a Radio Button might appear within Jamba.

Note that by default, a Radio Button is not checked. If you want the object to be checked by default, set its Checked property to True. (In keeping with Radio Button convention, make sure to set only one button in a group to be checked initially.) Use the Label property to control the text that appears in the object and use the Font property to control the character font and size. Use the TextColor property to control the color of the characters. The BackgroundColor property sets the color for the face of the object.

Interactivity

Typically, you set up Radio Buttons so that when the user clicks on a Radio Button to turn it on, the other Radio Buttons in the group automatically turn off. Then, the application can either take immediate action to reflect the user's choice, or the application can wait until the user clicks another button, such as an "OK" Push Button to evaluate the selection.

To make sure that Radio Buttons behave as a group, each object's To Do List should turn off the other Radio Buttons as soon as the user clicks. For example, consider an application with three Radio Buttons. RadioButton1's To Do List would appear as follows for the Click event:

The preceding To Do List turns off the other Radio Buttons as soon as the user clicks on RadioButton1. Similarly, the To Do List for RadioButton2 would appear as follows for the Click event:

The preceding To Do List turns off the other Radio Buttons as soon as the user clicks on RadioButton2.

Immediate Action Based on the Selection

If you want the application to take another action (besides turning off the other Radio Buttons) when the user clicks, simply add that item to the To Do List. For example, the following figure shows how the To Do List appears when the user clicks on RadioButton1 to first turn off the other Radio Buttons and then play an audio file.

Delayed Evaluation of the Selection

When a Radio Button is checked, its Checked property contains the value True. Your application can use a Push Button click (or some other interaction) to initiate the evaluation of the current state of a group of Radio Buttons. When the user clicks on the Push Button, the Push Button sends the Checked property of each Radio Button in the group to a CGI program for evaluation. The CGI program determines which object is checked and returns information to the calling application.

To send the three Checked properties to the CGI program, you need to use the Object.Property syntax in the CGI object's To Do List. Specifically, the CGI object's ParameterList property is set to RadioButton1.Checked;RadioButton2.Checked;RadioButton3.Checked. This information is sent as soon as the user clicks on the Push Button. Assuming that you have set up the Radio Buttons so that only one is checked at any given time, one of the object's Checked properties will be True and the others will be False. The Response property would be set to True so that the CGI object expects return information. The CGI program is coded to determine which object is set to True.

When it determines which Radio Button is checked, the CGI program returns information to the application so that it takes the appropriate action based on the user's selection. For example, it could send back a value to play Audio1, Audio2 or Audio3 based on the state of the Radio Buttons.

For more information, see the section entitled "CGI object."

Radio Button Properties, Methods, and Events

Radio Button objects support the following properties, methods, and events:

Properties Methods Events
BackgroundColor MoveAndSize() Click
Checked SlideTo() Create
Enabled
 
Hide
Font
 
Show
Height
 
SlideToComplete
HowToHide
 
 
HowToShow
 
 
Label
 
 
Name
 
 
TextColor
 
 
Visible
 
 
Width
 
 
X
 
 
Y
 
 

Back to Push Button Object
Up to Table of Contents
Ahead to Text Objects