blob: fbf571cf3f4d43291ddfa5c1abaa088e29c3569e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
\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}
|