Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Apple Guide Complete / Part 4 - Scripting Guide Files
Chapter 10 - Guide Script Command Reference / Guide Script Command Descriptions
/ Creating Buttons


<Radio Button>

You can use the <Radio Button> command to place a radio button on a panel. You must specify the button's title and its default state (on or off). You can optionally specify a sequence to insert into the existing sequence based on the radio button's state. You can also specify an anchor point for the radio button and the font of the button title.

<Radio Button> buttonTitle, buttonState [, seqTrue] [, seqFalse]
               [, buttonAnchor] [, buttonFont]
buttonTitle
A string specifying the radio button's title.
buttonState
A Boolean constant indicating the default state of the radio button. Specify TRUE to set the radio button to on, specify FALSE to set the radio button to off. Only one radio button in a set can have its default state set to TRUE.
seqTrue
The name of the sequence to insert if the radio button is on (TRUE). If you specify a sequence name in this parameter, you should omit the seqFalse parameter. This parameter is optional.
seqFalse
The name of the sequence to insert if the radio button is off (FALSE). You usually insert a sequence only if the state of the radio button is true, thus you typically do not specify the seqFalse parameter. If you do specify this parameter, you should omit the seqTrue parameter. This parameter is optional.
buttonAnchor
A point that indicates the anchor point of the radio button. To describe a specific point, use the Point function. This parameter is optional.
buttonFont
A constant specifying the font of the button's title. You can use either of these constants to specify the corresponding font:
APPLEGUIDE
Specifies 10-point Espy Serif.
SYSTEM
Specifies the system font of the current script system. For example, for Roman script systems, indicates 12-point Chicago.
This parameter is optional; if you omit this parameter Apple Guide displays the button title in the system font.
DESCRIPTION
The <Radio Button> command places a radio button with the specified title on a panel. If you specify the seqTrue or seqFalse parameter, Apple Guide inserts the specified sequence into the current sequence, according to the setting of the radio button. This lets you easily accomplish sequence branching. When you use this method, Apple Guide displays the panel containing the radio buttons; when the user navigates to another panel, Apple Guide inserts the named sequence according to the current setting of the radio buttons. Alternatively, you can explicitly check the radio button settings yourself, using the <If> command and the built-in function radioButtonState.

Radio buttons appear inline with the surrounding text and are justified within the current format unless you specify an optional anchor point.

Always provide in your panel a label identifying the group of choices that your radio buttons offer. You can place this label on the panel and then use the <Radio Button> command to place your radio buttons.

EXAMPLES
<Define Panel> "Index Choices"
   #label for this group of radio buttons
   What type of index do you want to create?

   <Radio Button> "Book Index", TRUE, \xAC
                  "How do I create a book index?" \xAC
                  ,,, APPLEGUIDE
   <Radio Button> "Chapter Index", FALSE, \xAC
                  "How do I create a chapter index?"\xAC
                  ,,, APPLEGUIDE
<End Panel>
#alternative method of checking settings of radio buttons
<Define Panel> "Index Choices 2"
   #label for this group of radio buttons
   What type of index do you want to create?

   <Radio Button> "Book Index", TRUE, ,,, APPLEGUIDE
   <Radio Button> "Chapter Index", FALSE, ,,, APPLEGUIDE
<End Panel>

<Define Sequence> "How do I create an index?"
   <Panel> "Index Choices 2"
   <If> radioButtonState("Book Index", "Index Choices 2")
      <Panel> "How do I create a book index?"
   <Else>
      <Panel> "How do I create a chapter index?"
   <End if>
<End Sequence>
SEE ALSO
For information on creating checkboxes, see the description of the <CheckBox> command on page 10-69. For information on other buttons, see the description of the <Standard Button> and <3D Button> commands on page 10-57 and page 10-60, respectively.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
12 JUL 1996