1 |
578 |
markom |
'\"
|
2 |
|
|
'\" Copyright (c) 1996, Expert Interface Technologies
|
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 |
|
|
'\" The file man.macros and some of the macros used by this file are
|
8 |
|
|
'\" copyrighted: (c) 1990 The Regents of the University of California.
|
9 |
|
|
'\" (c) 1994-1995 Sun Microsystems, Inc.
|
10 |
|
|
'\" The license terms of the Tcl/Tk distrobution are in the file
|
11 |
|
|
'\" license.tcl.
|
12 |
|
|
.so man.macros
|
13 |
|
|
'----------------------------------------------------------------------
|
14 |
|
|
.HS tixControl tix 4.0
|
15 |
|
|
.BS
|
16 |
|
|
'
|
17 |
|
|
'
|
18 |
|
|
'----------------------------------------------------------------------
|
19 |
|
|
.SH NAME
|
20 |
|
|
tixControl \- Create and manipulate tixControl widgets
|
21 |
|
|
'
|
22 |
|
|
'
|
23 |
|
|
'
|
24 |
|
|
'----------------------------------------------------------------------
|
25 |
|
|
.SH SYNOPSIS
|
26 |
|
|
\fBtixControl\fI \fIpathName ?\fIoptions\fR?
|
27 |
|
|
'
|
28 |
|
|
'
|
29 |
|
|
'----------------------------------------------------------------------
|
30 |
|
|
.PP
|
31 |
|
|
.SH SUPER-CLASS
|
32 |
|
|
The \fBTixControl\fR class is derived from the \fBTixLabelWidget\fR
|
33 |
|
|
class and inherits all the commands, options and subwidgets of its
|
34 |
|
|
super-class.
|
35 |
|
|
'
|
36 |
|
|
'----------------------------------------------------------------------
|
37 |
|
|
.SH "STANDARD OPTIONS"
|
38 |
|
|
'
|
39 |
|
|
The Control widget supports all the standard options of a frame
|
40 |
|
|
widget. See the \fBoptions(n)\fR manual entry for details on the
|
41 |
|
|
standard options.
|
42 |
|
|
'
|
43 |
|
|
'
|
44 |
|
|
'----------------------------------------------------------------------
|
45 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
46 |
|
|
'
|
47 |
|
|
'----------BEGIN
|
48 |
|
|
.LP
|
49 |
|
|
.nf
|
50 |
|
|
Name: \fBallowEmpty\fR
|
51 |
|
|
Class: \fBAllowEmpty\fR
|
52 |
|
|
Switch: \fB\-allowempty\fR
|
53 |
|
|
.fi
|
54 |
|
|
.IP
|
55 |
|
|
Specifies whether the Control widget should allow the empty string
|
56 |
|
|
as a valid input.
|
57 |
|
|
'----------END
|
58 |
|
|
'
|
59 |
|
|
'----------BEGIN
|
60 |
|
|
.LP
|
61 |
|
|
.nf
|
62 |
|
|
Name: \fBautorepeat\fR
|
63 |
|
|
Class: \fBAutoRepeat\fR
|
64 |
|
|
Switch: \fB\-autorepeat\fR
|
65 |
|
|
.fi
|
66 |
|
|
.IP
|
67 |
|
|
Specifies whether the Control widget should have autorepeat behavior.
|
68 |
|
|
If set to be "true", the value of the Control widget will be
|
69 |
|
|
automatically incremented or decremented when the user holds down the
|
70 |
|
|
mouse button over the arrow buttons. Only values "true" and
|
71 |
|
|
"false" will be recognized.
|
72 |
|
|
'----------END
|
73 |
|
|
'
|
74 |
|
|
'
|
75 |
|
|
'----------BEGIN
|
76 |
|
|
.LP
|
77 |
|
|
.nf
|
78 |
|
|
Name: \fBcommand\fR
|
79 |
|
|
Class: \fBCommand\fR
|
80 |
|
|
Switch: \fB\-command\fR
|
81 |
|
|
.fi
|
82 |
|
|
.IP
|
83 |
|
|
Specifies the command to be called when the \fB\-value\fR option of
|
84 |
|
|
the Control widget is changed. The command will be called with one
|
85 |
|
|
arguments -- the new value of the Control widget.
|
86 |
|
|
'----------END
|
87 |
|
|
'
|
88 |
|
|
'
|
89 |
|
|
'----------BEGIN
|
90 |
|
|
.LP
|
91 |
|
|
.nf
|
92 |
|
|
Name: \fBdecrCmd\fR
|
93 |
|
|
Class: \fBDecrCmd\fR
|
94 |
|
|
Switch: \fB\-decrcmd\fR
|
95 |
|
|
.fi
|
96 |
|
|
.IP
|
97 |
|
|
Specifies a TCL command to be called when the the user presses the
|
98 |
|
|
down-arrow button subwidget. This command is called with one parameter
|
99 |
|
|
-- the current \fB\-value\fR of this Control widget. This
|
100 |
|
|
command is to decrement this value by one step, according to its own
|
101 |
|
|
definition of "decrement", and return the decremented value, which
|
102 |
|
|
will be stored in the \fB\-value\fR of this Control widget.
|
103 |
|
|
'----------END
|
104 |
|
|
'
|
105 |
|
|
'----------BEGIN
|
106 |
|
|
.LP
|
107 |
|
|
.nf
|
108 |
|
|
Name: \fBdisableCallback\fR
|
109 |
|
|
Class: \fBDisableCallback\fR
|
110 |
|
|
Switch: \fB\-disablecallback\fR
|
111 |
|
|
.fi
|
112 |
|
|
.IP
|
113 |
|
|
A boolean value indicating whether callbacks should be disabled. When
|
114 |
|
|
set to true, the TCL command specified by the \fB\-command\fR option
|
115 |
|
|
is not executed when the \fB\-value\fR of the Control widget
|
116 |
|
|
changes.
|
117 |
|
|
'----------END
|
118 |
|
|
'
|
119 |
|
|
'----------BEGIN
|
120 |
|
|
.LP
|
121 |
|
|
.nf
|
122 |
|
|
Name: \fBdisableForeground\fR
|
123 |
|
|
Class: \fBDisableForeground\fR
|
124 |
|
|
Switch: \fB\-disableforeground\fR
|
125 |
|
|
.fi
|
126 |
|
|
.IP
|
127 |
|
|
The foreground color to use for of the entry subwidget when the
|
128 |
|
|
Control widget is disabled.
|
129 |
|
|
'----------END
|
130 |
|
|
'
|
131 |
|
|
'
|
132 |
|
|
'----------BEGIN
|
133 |
|
|
.LP
|
134 |
|
|
.nf
|
135 |
|
|
Name: \fBincrCmd\fR
|
136 |
|
|
Class: \fBIncrCmd\fR
|
137 |
|
|
Switch: \fB\-incrcmd\fR
|
138 |
|
|
.fi
|
139 |
|
|
.IP
|
140 |
|
|
Specifies a TCL command to be called when the the user presses the
|
141 |
|
|
up-arrow button subwidget. This command is called with one parameter
|
142 |
|
|
-- the current \fB\-value\fR of this Control widget. This
|
143 |
|
|
command is to increment this value by one step, according to its own
|
144 |
|
|
definition of "increment", and return the incremented value, which
|
145 |
|
|
will be stored in the \fB\-value\fR of this Control widget.
|
146 |
|
|
'----------END
|
147 |
|
|
'
|
148 |
|
|
'----------BEGIN
|
149 |
|
|
.LP
|
150 |
|
|
.nf
|
151 |
|
|
Name: \fBinitwait\fR
|
152 |
|
|
Class: \fBInitwait\fR
|
153 |
|
|
Switch: \fB\-initwait\fR
|
154 |
|
|
.fi
|
155 |
|
|
.IP
|
156 |
|
|
Specifies how long the Control widget should wait initially before
|
157 |
|
|
it starts to automatically increment or decrement its value in the
|
158 |
|
|
autorepeat mode. In milliseconds.
|
159 |
|
|
'----------END
|
160 |
|
|
'
|
161 |
|
|
'----------BEGIN
|
162 |
|
|
.LP
|
163 |
|
|
.nf
|
164 |
|
|
Name: \fBinteger\fR
|
165 |
|
|
Class: \fBInteger\fR
|
166 |
|
|
Switch: \fB\-integer\fR
|
167 |
|
|
.fi
|
168 |
|
|
.IP
|
169 |
|
|
A Boolean value specifying whether only integer numbers are accepted.
|
170 |
|
|
'----------END
|
171 |
|
|
'
|
172 |
|
|
'----------BEGIN
|
173 |
|
|
.LP
|
174 |
|
|
.nf
|
175 |
|
|
Name: \fBlabel\fR
|
176 |
|
|
Class: \fBLabel\fR
|
177 |
|
|
Switch: \fB\-label\fR
|
178 |
|
|
.fi
|
179 |
|
|
.IP
|
180 |
|
|
Specifies the string to display as the label of this Control widget.
|
181 |
|
|
'----------END
|
182 |
|
|
'
|
183 |
|
|
'----------BEGIN
|
184 |
|
|
.LP
|
185 |
|
|
.nf
|
186 |
|
|
Name: \fBlabelSide\fR
|
187 |
|
|
Class: \fBLabelSide\fR
|
188 |
|
|
Switch: \fB\-labelside\fR
|
189 |
|
|
.fi
|
190 |
|
|
.IP
|
191 |
|
|
Specifies where the label should be displayed relative to the entry
|
192 |
|
|
subwidget. Valid options are: \fBtop\fR, \fBleft\fR, \fBright\fR,
|
193 |
|
|
\fBbottom\fR, \fBnone\fR or \fBacrosstop\fR.
|
194 |
|
|
'----------END
|
195 |
|
|
'
|
196 |
|
|
'
|
197 |
|
|
'----------BEGIN
|
198 |
|
|
.LP
|
199 |
|
|
.nf
|
200 |
|
|
Name: \fBmax\fR
|
201 |
|
|
Class: \fBMax\fR
|
202 |
|
|
Switch: \fB\-max\fR
|
203 |
|
|
Alias: \fB\-ulimit\fR
|
204 |
|
|
.fi
|
205 |
|
|
.IP
|
206 |
|
|
Specifies the upper limit of the value of the Control widget. When set
|
207 |
|
|
to empty string, the Control widget has no upper limit.
|
208 |
|
|
'----------END
|
209 |
|
|
''
|
210 |
|
|
'----------BEGIN
|
211 |
|
|
.LP
|
212 |
|
|
.nf
|
213 |
|
|
Name: \fBmin\fR
|
214 |
|
|
Class: \fBMin\fR
|
215 |
|
|
Switch: \fB\-min\fR
|
216 |
|
|
Alias: \fB\-llimit\fR
|
217 |
|
|
.fi
|
218 |
|
|
.IP
|
219 |
|
|
Specifies the lower limit of the value of the Control widget.When set
|
220 |
|
|
to empty string, the Control widget has no lower limit.
|
221 |
|
|
'----------END
|
222 |
|
|
'
|
223 |
|
|
'----------BEGIN
|
224 |
|
|
.LP
|
225 |
|
|
.nf
|
226 |
|
|
Name: \fBrepeatRate\fR
|
227 |
|
|
Class: \fBRepeatRate\fR
|
228 |
|
|
Switch: \fB\-repeatrate\fR
|
229 |
|
|
.fi
|
230 |
|
|
.IP
|
231 |
|
|
Specifies how often the value of the Control widget should be
|
232 |
|
|
incremented or decremented when it is in the autorepeat mode. In
|
233 |
|
|
milliseconds.
|
234 |
|
|
'----------END
|
235 |
|
|
'
|
236 |
|
|
'----------BEGIN
|
237 |
|
|
.LP
|
238 |
|
|
.nf
|
239 |
|
|
Name: \fBselectMode\fR
|
240 |
|
|
Class: \fBSelectMode\fR
|
241 |
|
|
Switch: \fB\-selectmode\fR
|
242 |
|
|
.fi
|
243 |
|
|
.IP
|
244 |
|
|
Specifies how the Control widget should react to \fC\fR
|
245 |
|
|
events. When set to "immediate", any user keyboard inputs will
|
246 |
|
|
immediately change the \fB\-value\fR option. When set to "normal", the
|
247 |
|
|
user keyboard inputs will be copied to the \fB\-value\fR option only
|
248 |
|
|
if the\fC \fR key is pressed or the keyboard focus is
|
249 |
|
|
changed. The use of the immediate mode is discouraged. For effective
|
250 |
|
|
use of the Control widget, one should use the normal mode together
|
251 |
|
|
with the \fBupdate\fR widget command (see below).
|
252 |
|
|
'----------END
|
253 |
|
|
'
|
254 |
|
|
'----------BEGIN
|
255 |
|
|
.LP
|
256 |
|
|
.nf
|
257 |
|
|
Name: \fBstate\fR
|
258 |
|
|
Class: \fBState\fR
|
259 |
|
|
Switch: \fB\-state\fR
|
260 |
|
|
.fi
|
261 |
|
|
.IP
|
262 |
|
|
Specifies the whether the Control widget is normal or
|
263 |
|
|
disabled. Only the values "normal" and "disabled" are recognized.
|
264 |
|
|
'----------END
|
265 |
|
|
'
|
266 |
|
|
'----------BEGIN
|
267 |
|
|
.LP
|
268 |
|
|
.nf
|
269 |
|
|
Name: \fBstep\fR
|
270 |
|
|
Class: \fBStep\fR
|
271 |
|
|
Switch: \fB\-step\fR
|
272 |
|
|
.fi
|
273 |
|
|
.IP
|
274 |
|
|
Specifies by how much the value of the Control widget should be
|
275 |
|
|
incremented or decrmented when the user press the arrow buttons.
|
276 |
|
|
'----------END
|
277 |
|
|
'
|
278 |
|
|
'
|
279 |
|
|
'----------BEGIN
|
280 |
|
|
.LP
|
281 |
|
|
.nf
|
282 |
|
|
Name: \fBvalidateCmd\fR
|
283 |
|
|
Class: \fBValidateCmd\fR
|
284 |
|
|
Switch: \fB\-validatecmd\fR
|
285 |
|
|
.fi
|
286 |
|
|
.IP
|
287 |
|
|
Specifies a TCL command to be called when the -value of the
|
288 |
|
|
Control widget is about to change. This command is called
|
289 |
|
|
with one parameter -- the new \fB\-value\fR entered by the user. This
|
290 |
|
|
command is to validate this new value by returning a value it deems
|
291 |
|
|
valid.
|
292 |
|
|
'----------END
|
293 |
|
|
'
|
294 |
|
|
'----------BEGIN
|
295 |
|
|
.LP
|
296 |
|
|
.nf
|
297 |
|
|
Name: \fBvalue\fR
|
298 |
|
|
Class: \fBValue\fR
|
299 |
|
|
Switch: \fB\-value\fR
|
300 |
|
|
.fi
|
301 |
|
|
.IP
|
302 |
|
|
Specifies the value of the Control widget.
|
303 |
|
|
'----------END
|
304 |
|
|
'
|
305 |
|
|
'----------BEGIN
|
306 |
|
|
.LP
|
307 |
|
|
.nf
|
308 |
|
|
Name: \fBvariable\fR
|
309 |
|
|
Class: \fBVariable\fR
|
310 |
|
|
Switch: \fB\-variable\fR
|
311 |
|
|
.fi
|
312 |
|
|
.IP
|
313 |
|
|
Specifies the global variable in which the value of the
|
314 |
|
|
Control widget should be stored. The value of the Control widget
|
315 |
|
|
will be automatically updated when this variable is changed.
|
316 |
|
|
'----------END
|
317 |
|
|
'
|
318 |
|
|
'----------------------------------------------------------------------
|
319 |
|
|
.SH SUBWIDGETS
|
320 |
|
|
'----------BEGIN
|
321 |
|
|
.LP
|
322 |
|
|
.nf
|
323 |
|
|
Name: \fBdecr\fR
|
324 |
|
|
Class: \fBButton\fR
|
325 |
|
|
.fi
|
326 |
|
|
.IP
|
327 |
|
|
The down arrow button.
|
328 |
|
|
'----------END
|
329 |
|
|
'
|
330 |
|
|
'----------BEGIN
|
331 |
|
|
.LP
|
332 |
|
|
.nf
|
333 |
|
|
Name: \fBentry\fR
|
334 |
|
|
Class: \fBEntry\fR
|
335 |
|
|
.fi
|
336 |
|
|
.IP
|
337 |
|
|
The entry that shows the value of this Control widget.
|
338 |
|
|
'----------END
|
339 |
|
|
'
|
340 |
|
|
'----------BEGIN
|
341 |
|
|
.LP
|
342 |
|
|
.nf
|
343 |
|
|
Name: \fBincr\fR
|
344 |
|
|
Class: \fBButton\fR
|
345 |
|
|
.fi
|
346 |
|
|
.IP
|
347 |
|
|
The up arrow button.
|
348 |
|
|
'----------END
|
349 |
|
|
'
|
350 |
|
|
'----------BEGIN
|
351 |
|
|
.LP
|
352 |
|
|
.nf
|
353 |
|
|
Name: \fBlabel\fR
|
354 |
|
|
Class: \fBLabel\fR
|
355 |
|
|
.fi
|
356 |
|
|
.IP
|
357 |
|
|
The label subwidget.
|
358 |
|
|
'----------END
|
359 |
|
|
'
|
360 |
|
|
.BE
|
361 |
|
|
'
|
362 |
|
|
'
|
363 |
|
|
'----------------------------------------------------------------------
|
364 |
|
|
.SH DESCRIPTION
|
365 |
|
|
'
|
366 |
|
|
.PP
|
367 |
|
|
'
|
368 |
|
|
The \fBtixControl\fR command creates a new window (given by the
|
369 |
|
|
\fIpathName\fR argument) and makes it into a Control widget.
|
370 |
|
|
Additional options, described above, may be specified on the command
|
371 |
|
|
line or in the option database to configure aspects of the
|
372 |
|
|
Control widget such as its cursor and relief.
|
373 |
|
|
|
374 |
|
|
The Control widget is also known as the \fBSpinBox\fR widget.
|
375 |
|
|
It is generally used to control a value. The user can adjust the value
|
376 |
|
|
by pressing the two arrow buttons or by entering the value directly
|
377 |
|
|
into the entry. The new value will be checked against the user-defined
|
378 |
|
|
upper and lower limits.
|
379 |
|
|
'
|
380 |
|
|
'
|
381 |
|
|
'----------------------------------------------------------------------
|
382 |
|
|
.SH WIDGET COMMANDS
|
383 |
|
|
.PP
|
384 |
|
|
'
|
385 |
|
|
The \fBtixControl\fR command creates a new Tcl command whose name is
|
386 |
|
|
the same as the path name of the Control widget's window. This
|
387 |
|
|
command may be used to invoke various operations on the widget. It has
|
388 |
|
|
the following general form:
|
389 |
|
|
'
|
390 |
|
|
.DS C
|
391 |
|
|
'
|
392 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
393 |
|
|
.PP
|
394 |
|
|
.DE
|
395 |
|
|
'
|
396 |
|
|
\fIPathName\fR is the name of the command, which is the same as the
|
397 |
|
|
Control widget's path name. \fIOption\fR and the \fIarg\fRs
|
398 |
|
|
determine the exact behavior of the command. The following commands
|
399 |
|
|
are possible for Control widgets:
|
400 |
|
|
'
|
401 |
|
|
.TP
|
402 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
403 |
|
|
'
|
404 |
|
|
Returns the current value of the configuration option given by
|
405 |
|
|
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
|
406 |
|
|
\fBtixControl\fR command.
|
407 |
|
|
'
|
408 |
|
|
'
|
409 |
|
|
.TP
|
410 |
|
|
'
|
411 |
|
|
\fIpathName \fBconfigure\fR ?\fIoption\fR? \fI?value option value ...\fR?
|
412 |
|
|
'
|
413 |
|
|
Query or modify the configuration options of the widget. If no
|
414 |
|
|
\fIoption\fR is specified, returns a list describing all of the
|
415 |
|
|
available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
416 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
417 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
418 |
|
|
one named option (this list will be identical to the corresponding
|
419 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
420 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
421 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
422 |
|
|
this case the command returns an empty string. \fIOption\fR may have
|
423 |
|
|
any of the values accepted by the \fBtixControl\fR command.
|
424 |
|
|
'
|
425 |
|
|
.TP
|
426 |
|
|
\fIpathName \fBdecr\fR
|
427 |
|
|
'
|
428 |
|
|
Decrements the value of the Control widget by the step specified
|
429 |
|
|
by the \fI\-step\fR option.
|
430 |
|
|
'
|
431 |
|
|
'
|
432 |
|
|
.TP
|
433 |
|
|
\fIpathName \fBincr\fR
|
434 |
|
|
'
|
435 |
|
|
Increments the value of the Control widget by the step
|
436 |
|
|
specified by the \fI\-step\fR option.
|
437 |
|
|
'
|
438 |
|
|
'
|
439 |
|
|
.TP
|
440 |
|
|
\fIpathName \fBinvoke\fR
|
441 |
|
|
'
|
442 |
|
|
Causes the command specified by the \fI\-command\fR option to be
|
443 |
|
|
invoked.
|
444 |
|
|
'
|
445 |
|
|
.TP
|
446 |
|
|
\fIpathName \fBupdate\fR
|
447 |
|
|
'
|
448 |
|
|
If the user has modified the entry using keyboard inputs, the update
|
449 |
|
|
command will \fBupdate\fR the \fB\-value\fR of this Control
|
450 |
|
|
widget. When the Control widget's \fB\-selectmode\fR option is set to
|
451 |
|
|
"normal", one should call the \fBupdate\fR command on this widget
|
452 |
|
|
before examining its \fB\-value\fR option. This command has no effect
|
453 |
|
|
in if the \fB\-selectmode\fR option is set to "immediate".
|
454 |
|
|
'
|
455 |
|
|
.TP
|
456 |
|
|
\fIpathName \fBsubwidget \fI name ?args?\fR
|
457 |
|
|
'
|
458 |
|
|
When no options are given, this command returns the pathname of the
|
459 |
|
|
subwidget of the specified name.
|
460 |
|
|
|
461 |
|
|
When options are given, the widget command of the specified subwidget
|
462 |
|
|
will be called with these options.
|
463 |
|
|
'
|
464 |
|
|
'
|
465 |
|
|
'
|
466 |
|
|
'----------------------------------------------------------------------
|
467 |
|
|
.SH BINDINGS
|
468 |
|
|
.PP
|
469 |
|
|
'
|
470 |
|
|
When the user presses the up/down arrow buttons (or press the and
|
471 |
|
|
arrow keys on the keyboard), the value of the tixControl widget
|
472 |
|
|
is adjusted according to the \fB\-validatecmd\fR, \fB\-incrcmd\fR,
|
473 |
|
|
\fB\-decrcmd\fR, \fB\-step\fR, \fB\-max\fR and \fB\-min\fR options.
|
474 |
|
|
'
|
475 |
|
|
'
|
476 |
|
|
'----------------------------------------------------------------------
|
477 |
|
|
.SH KEYWORDS
|
478 |
|
|
Tix(n)
|