1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1995 DSC Technologies Corporation
|
3 |
|
|
'\"
|
4 |
|
|
'\" See the file "license.terms" for information on usage and redistribution
|
5 |
|
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
6 |
|
|
'\"
|
7 |
|
|
'\" toolbar.n
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS toolbar iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
\fBtoolbar\fR \- Create and manipulate a tool bar
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBtoolbar\fR \fIpathName\fR ?\fIoptions\fR?
|
17 |
|
|
.SH STANDARD OPTIONS
|
18 |
|
|
.LP
|
19 |
|
|
.nf
|
20 |
|
|
.ta 4c 8c 12c
|
21 |
|
|
\fBactiveBackground\fR \fBfont\fR \fBinsertForeground\fR \fBselectForeground\fR
|
22 |
|
|
\fBactiveForeground\fR \fBforeground\fR \fBorient\fR \fBstate\fR
|
23 |
|
|
\fBbackground\fR \fBhighlightBackground\fR \fBrelief\fR \fBtroughColor\fR
|
24 |
|
|
\fBborderWidth\fR \fBhighlightColor\fR \fBselectBackground\fR \fBcursor\fR
|
25 |
|
|
\fBhighlightThickness\fR \fBselectBorderWidth\fR \fBdisabledForeground\fR \fBinsertBackground\fR
|
26 |
|
|
\fBselectColor\fR
|
27 |
|
|
.fi
|
28 |
|
|
.LP
|
29 |
|
|
See the "options" manual entry for details on the standard options. For widgets
|
30 |
|
|
added to the toolbar, these options will be propogated if the widget supports
|
31 |
|
|
the option. For example, all widgets that support a font option will be changed
|
32 |
|
|
if the the toolbar's font option is configured.
|
33 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
34 |
|
|
.LP
|
35 |
|
|
.nf
|
36 |
|
|
Name: \fBballoonBackground\fR
|
37 |
|
|
Class: \fBBalloonBackground\fR
|
38 |
|
|
Command-Line Switch: \fB-ballooonbackground\fR
|
39 |
|
|
.fi
|
40 |
|
|
.IP
|
41 |
|
|
Specifies the background color of the balloon help displayed at the bottom
|
42 |
|
|
center of a widget on the toolbar that has a non empty string for its
|
43 |
|
|
balloonStr option. The default color is yellow.
|
44 |
|
|
.LP
|
45 |
|
|
.nf
|
46 |
|
|
Name: \fBballoonDelay1\fR
|
47 |
|
|
Class: \fBBalloonDelay1\fR
|
48 |
|
|
Command-Line Switch: \fB-balloondelay1\fR
|
49 |
|
|
.fi
|
50 |
|
|
.IP
|
51 |
|
|
Specifies the length of time (in milliseconds) to wait before initially
|
52 |
|
|
posting a balloon help hint window. This delay is in effect whenever 1)
|
53 |
|
|
the mouse leaves the toolbar, or 2) a toolbar item is selected with the
|
54 |
|
|
mouse button.
|
55 |
|
|
.LP
|
56 |
|
|
.nf
|
57 |
|
|
Name: \fBballoonDelay2\fR
|
58 |
|
|
Class: \fBBalloonDelay2\fR
|
59 |
|
|
Command-Line Switch: \fB-balloondelay2\fR
|
60 |
|
|
.fi
|
61 |
|
|
.IP
|
62 |
|
|
Specifies the length of time (in milliseconds) to wait before continuing to
|
63 |
|
|
post balloon help hint windows. This delay is in effect after the first
|
64 |
|
|
time a balloon hint window is activated. It remains in effect until 1) the
|
65 |
|
|
mouse leaves the toolbar, or 2) a toolbar item is selected with the mouse
|
66 |
|
|
button.
|
67 |
|
|
.LP
|
68 |
|
|
.nf
|
69 |
|
|
Name: \fBballoonFont\fR
|
70 |
|
|
Class: \fBBalloonFont\fR
|
71 |
|
|
Command-Line Switch: \fB-balloonfont\fR
|
72 |
|
|
.fi
|
73 |
|
|
.IP
|
74 |
|
|
Specifies the font of the balloon help text displayed at the bottom center
|
75 |
|
|
of a widget on the toolbar that has a non empty string for its
|
76 |
|
|
balloonStr option. The default font is 6x10.
|
77 |
|
|
.LP
|
78 |
|
|
.nf
|
79 |
|
|
Name: \fBballoonForeground\fR
|
80 |
|
|
Class: \fBBalloonForeground\fR
|
81 |
|
|
Command-Line Switch: \fB-ballooonforeground\fR
|
82 |
|
|
.fi
|
83 |
|
|
.IP
|
84 |
|
|
Specifies the foreground color of the balloon help displayed at the
|
85 |
|
|
bottom center of a widget on the toolbar that has a non empty string for
|
86 |
|
|
its balloonStr option. The default color is black.
|
87 |
|
|
.LP
|
88 |
|
|
.nf
|
89 |
|
|
Name: \fBhelpVariable\fR
|
90 |
|
|
Class: \fBHelpVariable\fR
|
91 |
|
|
Command-Line Switch: \fB-helpvariable\fR
|
92 |
|
|
.fi
|
93 |
|
|
.IP
|
94 |
|
|
Specifies the global variable to update whenever the mouse is in motion
|
95 |
|
|
over a toolbar widget. This global variable is updated with the current
|
96 |
|
|
value of the active widget's helpStr. Other widgets can "watch" this
|
97 |
|
|
variable with the trace command, or as is the case with entry or label
|
98 |
|
|
widgets, they can set their textVariable to the same global variable. This
|
99 |
|
|
allows for a simple implementation of a help status bar. Whenever the
|
100 |
|
|
mouse leaves a menu entry, the helpVariable is set to the empty string {}.
|
101 |
|
|
.LP
|
102 |
|
|
.nf
|
103 |
|
|
Name: \fBorient\fR
|
104 |
|
|
Class: \fBOrient\fR
|
105 |
|
|
Command-Line Switch: \fB-orient\fR
|
106 |
|
|
.fi
|
107 |
|
|
.IP
|
108 |
|
|
Specifies the orientation of the toolbar. Must be either horizontal or
|
109 |
|
|
vertical.
|
110 |
|
|
.BE
|
111 |
|
|
.SH DESCRIPTION
|
112 |
|
|
The \fBtoolbar\fR command creates a new window (given by the pathName
|
113 |
|
|
argument) and makes it into a \fBtoolbar\fR widget. Additional options,
|
114 |
|
|
described above may be specified on the command line or in the option
|
115 |
|
|
database to configure aspects of the toolbar such as its colors, font,
|
116 |
|
|
and orientation. The \fBtoolbar\fR command returns its pathName argument. At
|
117 |
|
|
the time this command is invoked, there must not exist a window named
|
118 |
|
|
pathName, but pathName's parent must exist.
|
119 |
|
|
.PP
|
120 |
|
|
A \fBtoolbar\fR is a widget that displays a collection of widgets arranged
|
121 |
|
|
either in a row or a column (depending on the value of the -orient option).
|
122 |
|
|
This collection of widgets is usually for user convenience to give access
|
123 |
|
|
to a set of commands or settings. Any widget may be placed on a toolbar.
|
124 |
|
|
However, command or value-oriented widgets (such as button, radiobutton,
|
125 |
|
|
etc.) are usually the most useful kind of widgets to appear on a toolbar.
|
126 |
|
|
.PP
|
127 |
|
|
In addition, the toolbar adds two new options to all widgets that are added to
|
128 |
|
|
it. These are the \fBhelpStr\fR and \fBballoonStr\fR options. See the
|
129 |
|
|
discussion for the widget command add below.
|
130 |
|
|
|
131 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
132 |
|
|
.PP
|
133 |
|
|
The toolbar command creates a new Tcl command whose name is pathName. This
|
134 |
|
|
command may be used to invoke various operations on the widget. It has the
|
135 |
|
|
following general form:
|
136 |
|
|
.DS C
|
137 |
|
|
\fIpathName\fR \fIoption\fR \fI?arg arg ...?\fR
|
138 |
|
|
.DE
|
139 |
|
|
Option and args determine the exact behavior of the command.
|
140 |
|
|
.PP
|
141 |
|
|
Many of the widget commands for a toolbar take as one argument an indicator of
|
142 |
|
|
which widget item of the toolbar to operate on. The indicator is called
|
143 |
|
|
an \fBindex\fR and may be specified in any of the following forms:
|
144 |
|
|
.TP
|
145 |
|
|
\fInumber\fR
|
146 |
|
|
Specifies the widget numerically, where 0 corresponds to the first
|
147 |
|
|
widget in the notebook, 1 to the second, and so on. (For horizontal, 0 is the
|
148 |
|
|
leftmost; for vertical, 0 is the topmost).
|
149 |
|
|
.TP
|
150 |
|
|
\fBend\fR
|
151 |
|
|
Specifes the last widget in the toolbar's index. If the toolbar is
|
152 |
|
|
empty this will return -1.
|
153 |
|
|
.TP
|
154 |
|
|
\fBlast\fR
|
155 |
|
|
Same as end.
|
156 |
|
|
.TP
|
157 |
|
|
\fIpattern\fR
|
158 |
|
|
If the index doesn't satisfy any of the above forms, then this form is
|
159 |
|
|
used. Pattern is pattern-matched against the widgetName of each widget in the
|
160 |
|
|
toolbar, in order from the first to the last widget, until a matching entry is
|
161 |
|
|
found. An exact match must occur.
|
162 |
|
|
.PP
|
163 |
|
|
The following commands are possible for toolbar widgets:
|
164 |
|
|
.TP
|
165 |
|
|
\fIpathName\fR \fBadd\fR \fIwidgetCommand\fR \fIwidgetName\fR \fI?option value?\fR
|
166 |
|
|
Adds a widget with the command widgetCommand whose name is widgetName to the
|
167 |
|
|
toolbar. If widgetCommand is radiobutton or checkbutton, its packing is
|
168 |
|
|
slightly padded to match the geometry of button widgets. In addition, the
|
169 |
|
|
indicatorOn option is false by default and the selectColor is that of the
|
170 |
|
|
toolbar background by default. This allows Radiobutton and Checkbutton widgets
|
171 |
|
|
to be added as icons by simply setting their bitmap or image options. If
|
172 |
|
|
additional arguments are present, they are the set of available options
|
173 |
|
|
that the widget type of \fIwidgetCommand\fR supports. In addition they may
|
174 |
|
|
also be one of the following options:
|
175 |
|
|
.RS
|
176 |
|
|
.TP
|
177 |
|
|
\fB-helpstr\fR \fIvalue\fR
|
178 |
|
|
Specifes the help string to associate with the widget. When the mouse moves
|
179 |
|
|
over the widget, the variable denoted by \fBhelpVariable\fR is set
|
180 |
|
|
to \fBhelpStr\fR. Another widget can bind to the helpVariable and thus
|
181 |
|
|
track status help.
|
182 |
|
|
.TP
|
183 |
|
|
\fB-balloonstr\fR \fIvalue\fR
|
184 |
|
|
Specifes the string to display in a balloon window for this widget. A
|
185 |
|
|
balloon window is a small popup window centered at the bottom of the
|
186 |
|
|
widget. Usually the \fBballoonStr\fR value is the name of the item on the
|
187 |
|
|
toolbar. It is sometimes known as a hint window.
|
188 |
|
|
.IP
|
189 |
|
|
When the mouse moves into an item on the toolbar, a timer is set based on
|
190 |
|
|
the value of \fBballoonDelay1\fR. If the mouse stays inside the item
|
191 |
|
|
for \fBballoonDelay1\fR, the balloon window will pop up displaying
|
192 |
|
|
the \fBballoonStr\fR value. Once the balloon window is posted, a new
|
193 |
|
|
timer based on \fBballoonDelay2\fR is set. This is typically a shorter
|
194 |
|
|
timer. If the mouse is moved to another item, the window is unposted and
|
195 |
|
|
a new window will be posted over the item if the shorter delay time is
|
196 |
|
|
satisfied.
|
197 |
|
|
.IP
|
198 |
|
|
While the balloon window is posted, it can also be unposted if the item
|
199 |
|
|
is selected. In this case the timer is reset to \fBballoonDelay1\fR.
|
200 |
|
|
Whenever the mouse leaves the toolbar, the timer is also reset
|
201 |
|
|
to \fBballoonDelay1\fR.
|
202 |
|
|
.IP
|
203 |
|
|
This window posting/unposting model is the same model used in the
|
204 |
|
|
Windows95 environment.
|
205 |
|
|
.RE
|
206 |
|
|
.TP
|
207 |
|
|
\fIpathName\fR \fBcget\fR \fIoption\fR
|
208 |
|
|
Returns the current value of the configuration option given by \fIoption\fR.
|
209 |
|
|
.TP
|
210 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR \fIvalue\fR?
|
211 |
|
|
Query or modify the configuration options of the widget. If no \fIoption\fR is
|
212 |
|
|
specified, returns a list describing all of the available options for pathName
|
213 |
|
|
(see Tk_ConfigureInfo for information on the format of this list). If
|
214 |
|
|
\fIoption\fR is specified with no value, then the command returns a
|
215 |
|
|
list describing the one
|
216 |
|
|
named option (this list will be identical to the corresponding sublist of the
|
217 |
|
|
value returned if no option is specified). If one or more option-value pairs
|
218 |
|
|
are specified, then the command modifies the given widget option(s) to have the
|
219 |
|
|
given value(s); in this case the command returns an empty string.
|
220 |
|
|
.TP
|
221 |
|
|
\fIpathName\fR \fBdelete\fR \fIindex\fR ?\fIindex2\fR?
|
222 |
|
|
This command deletes all items between \fIindex\fR and \fIindex2\fR
|
223 |
|
|
inclusive. If \fIindex2\fR is omitted then it defaults to \fIindex\fR.
|
224 |
|
|
Returns an empty string.
|
225 |
|
|
.TP
|
226 |
|
|
\fIpathName\fR \fBindex\fR \fIindex\fR
|
227 |
|
|
Returns the widget's numerical index for the entry corresponding
|
228 |
|
|
to \fIindex\fR. If \fIindex\fR is not found, -1 is returned.
|
229 |
|
|
.TP
|
230 |
|
|
\fIpathName\fR \fBinsert\fR \fIbeforeIndex\fR \fIwidgetCommand\fR \fIwidgetName\fR \fI?option value?\fR
|
231 |
|
|
.TP
|
232 |
|
|
Insert a new item named \fIwidgetName\fR with the
|
233 |
|
|
command \fIwidgetCommand\fR before the item specified by \fIbeforeIndex\fR.
|
234 |
|
|
If \fIwidgetCommand\fR is \fBradiobutton\fR or \fBcheckbutton\fR, its
|
235 |
|
|
packing is slightly padded to match the geometry of button widgets. In
|
236 |
|
|
addition, the \fBindicatorOn\fR option is \fBfalse\fR by default and the
|
237 |
|
|
\fBselectColor\fR is that of the toolbar background by default. This allows
|
238 |
|
|
\fBRadiobutton\fR and \fBCheckbutton\fR widgets to be added as icons by
|
239 |
|
|
simply setting their \fBbitmap\fR or \fBimage\fR options. The set of
|
240 |
|
|
available options is the same as specified in the \fBad\fR command.
|
241 |
|
|
.TP
|
242 |
|
|
\fIpathName\fR \fBitemcget\fR \fIindex\fR \fIoption\fR
|
243 |
|
|
Returns the current value of the configuration option given by \fIoption\fR for
|
244 |
|
|
index. The item type of \fIindex\fR determines the valid available options.
|
245 |
|
|
.TP
|
246 |
|
|
\fIpathName\fR \fBitemconfigure\fR \fIindex\fR \fI?option value?\fR
|
247 |
|
|
Query or modify the configuration options of the widget of the toolbar
|
248 |
|
|
specified by \fIindex\fR. If no option is specified,
|
249 |
|
|
returns a list describing all of
|
250 |
|
|
the available options for \fIindex\fR
|
251 |
|
|
(see \fBTk_ConfigureInfo\fR for information on the
|
252 |
|
|
format of this list). If \fIoption\fR is specified with no value,
|
253 |
|
|
then the command
|
254 |
|
|
returns a list describing the one named option (this list will be identical to
|
255 |
|
|
the corresponding sublist of the value returned if no option is specified). If
|
256 |
|
|
one or more option-value pairs are specified, then the command modifies the
|
257 |
|
|
given widget option(s) to have the given value(s); in this case the command
|
258 |
|
|
returns an empty string. The item type of \fIindex\fR determines the valid
|
259 |
|
|
available options. The set of available options is the same as specified
|
260 |
|
|
in the \fBad\fR command.
|
261 |
|
|
.SH EXAMPLE
|
262 |
|
|
.DS
|
263 |
|
|
toolbar .tb -helpvariable statusVar
|
264 |
|
|
|
265 |
|
|
.tb add button item1 \\
|
266 |
|
|
-helpstr "Save It" -bitmap @./icons/Tool_32_box.xbm \\
|
267 |
|
|
-balloonstr "Save" -command {puts 1}
|
268 |
|
|
.tb add button item2 \\
|
269 |
|
|
-helpstr "Save It" -bitmap @./icons/Tool_32_brush.xbm \\
|
270 |
|
|
-balloonstr "Save" -command {puts 1}
|
271 |
|
|
.tb add button item3 \\
|
272 |
|
|
-helpstr "Save It" -bitmap @./icons/Tool_32_cut.xbm \\
|
273 |
|
|
-balloonstr "Save" -command {puts 1}
|
274 |
|
|
.tb add button item4 \\
|
275 |
|
|
-helpstr "Save It" -bitmap @./icons/Tool_32_draw.xbm \\
|
276 |
|
|
-balloonstr "Save" -command {puts 1}
|
277 |
|
|
.tb add button item5 \\
|
278 |
|
|
-bitmap @./icons/Tool_32_erase.xbm -helpstr "Play It" \\
|
279 |
|
|
-command {puts 2}
|
280 |
|
|
.tb add frame filler \\
|
281 |
|
|
-borderwidth 1 -width 10 -height 10
|
282 |
|
|
.tb add radiobutton item6 \\
|
283 |
|
|
-bitmap @./icons/Tool_32_oval.xbm -command {puts 4} \\
|
284 |
|
|
-variable result -value OPEN -helpstr "Radio Button # 1" \\
|
285 |
|
|
-balloonstr "Radio"
|
286 |
|
|
.tb add radiobutton item7 \\
|
287 |
|
|
-bitmap @./icons/Tool_32_line.xbm -command {puts 5} \\
|
288 |
|
|
-variable result -value CLOSED
|
289 |
|
|
.tb add checkbutton item8 \\
|
290 |
|
|
-bitmap @./icons/Tool_32_text.xbm -command {puts 6} \\
|
291 |
|
|
-variable checkit -onvalue yes -offvalue no
|
292 |
|
|
.tb add checkbutton check2 \\
|
293 |
|
|
-bitmap @./icons/Tool_32_points.xbm -command {puts 7} \\
|
294 |
|
|
-variable checkit2 -onvalue yes -offvalue no
|
295 |
|
|
|
296 |
|
|
pack .tb -side top -anchor nw
|
297 |
|
|
.DE
|
298 |
|
|
.SH AUTHOR
|
299 |
|
|
Bill Scott
|
300 |
|
|
.SH KEYWORDS
|
301 |
|
|
toolbar, button, radiobutton, checkbutton, iwidgets, widget
|
302 |
|
|
|