\begin{page}{HTXAdvPage2}{Radio buttons}
\centerline{\fbox{{\tt \thispage}}}\newline
\begin{scroll}


If you just want to make a multiple-choice
type selection, why not use the {\it radio buttons}.

You need to use bitmaps for the active areas (the buttons) but
\HyperName{} will keep track of the currently activated button.
You can use this boolean information somewhere else on your page.
The commands to use are:
\beginImportant
\newline
{\tt \\radioboxes\{{\it group name}\}\{{\it bitmap file1}\}\{{\it bitmap file0}\}}
\newline
{\tt \\radiobox[{\it initial state}]\{{\it label}\}\{{\it group name}\}}
\newline
{\tt \\boxvalue\{{\it label}\}}
\endImportant

The {\tt \\radioboxes} command sets up a group of {\tt \\radiobox}
buttons. The {\it group name} is a label for the group. The filenames
for the bitmaps are specified in {\it bitmap file1} and {\it bitmap file0}.
The first one should denote an activated button and the second
a de-activated one.

To display each button in a group, use {\tt \\radiobox}.
The {\it initial state} should be either {\tt 1} or {\tt 0}
depending on whether the button should first be displayed as activated or not.
The second {\it label} argument defines the name by which the
current state of the button can be referred to.
The third argument specifies which group this button belongs to.

The {\tt \\boxvalue} command can then be used in various
actions. The value of it will
be either {\tt t} or {\tt nil}.

In the example below, we use the {\tt \\htbmfile} macro
defined in {\bf util.ht} so that we do not have to write
the full bitmap file pathnames.

This is how we set up the group. The {\tt \\radioboxes} command does not display
anything.
Note that these commands cannot be included in a {\it patch}.
This is why we display this time the source and the result
at the same time.
\beginImportant
\newline
{\tt \\radioboxes\{group\}\{\\htbmfile\{pick\}\}\{\\htbmfile\{unpick\}\}}\newline
{\tt \\newline \\table\{}\newline
{\tt \{\\radiobox[1]\{b1\}\{group\}\}}\newline
{\tt \{\\radiobox[0]\{b2\}\{group\}\}}\newline
{\tt \{\\radiobox[0]\{b3\}\{group\}\}\}}\newline
{\tt \\newline}\newline
{\tt \\lispcommand\{lisp\}\{(pprint (list}\newline
{\tt \\boxvalue\{b1\} \\boxvalue\{b2\} \\boxvalue\{b3\}))\}}\newline
{\tt \\newline}\newline
{\tt \\unixcommand\{unix\}\{echo '\\boxvalue\{b1\}}\newline
{\tt \\boxvalue\{b2\} \\boxvalue\{b3\}'\}}
\endImportant
\radioboxes{group}{\htbmfile{pick}}{\htbmfile{unpick}}
\table{
{\radiobox[1]{b1}{group}}
{\radiobox[0]{b2}{group}}
{\radiobox[0]{b3}{group}}}
\newline
\lispcommand{lisp}{(pprint (list
\boxvalue{b1} \boxvalue{b2} \boxvalue{b3}))}
\newline
\unixcommand{unix}{echo '\boxvalue{b1}
\boxvalue{b2} \boxvalue{b3}'}
\endImportant




You can only set one radio button at a time. If you want
a non--exclusive selection, try {\tt \\inputbox}.
The syntax for this command is
\beginImportant
\newline
{\tt \\inputbox[{\it initial state}]\{{\it label}\}\{{\it bitmap file1}\}\{{\it bitmap file0}\}}
\endImportant

There is no group command for these.
\beginImportant
\newline
{\tt \\table\{}\newline
{\tt \{\\inputbox[1]\{c1\}\{\\htbmfile\{pick\}\}\{\\htbmfile\{unpick\}\}\}}\newline
{\tt \{\\inputbox\{c2\}\{\\htbmfile\{pick\}\}\{\\htbmfile\{unpick\}\}\}}\newline
{\tt \{\\inputbox[1]\{c3\}\{\\htbmfile\{pick\}\}\{\\htbmfile\{unpick\}\}\}\}}\newline
{\tt \\newline}\newline
{\tt \\lispcommand\{lisp\}\{(pprint (list}\newline
{\tt \\boxvalue\{c1\} \\boxvalue\{c2\} \\boxvalue\{c3\}))\}}\newline
{\tt \\newline}\newline
{\tt \\unixcommand\{unix\}\{echo }\newline
{\tt '\\boxvalue\{c1\} \\boxvalue\{c2\} \\boxvalue\{c3\}'\}}\newline
\endImportant
\table{
{\inputbox[1]{c1}{\htbmfile{pick}}{\htbmfile{unpick}}}
{\inputbox{c2}{\htbmfile{pick}}{\htbmfile{unpick}}}
{\inputbox[1]{c3}{\htbmfile{pick}}{\htbmfile{unpick}}}}
\newline
\lispcommand{lisp}{(pprint (list
\boxvalue{c1} \boxvalue{c2} \boxvalue{c3}))}
\newline
\unixcommand{unix}{echo
'\boxvalue{c1} \boxvalue{c2} \boxvalue{c3}'}
\endImportant


Note that the {\it initial state} is an
optional argument. If omitted
the button will initially
be deactivated.

\end{scroll}
\beginmenu
\menulink{Next Page --- Macros}{HTXAdvPage3}
\endmenu

\end{page}
