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 |
|
|
'\" @(#) spinner.n 1.21 94/12/17 16:04:44
|
8 |
|
|
'/"
|
9 |
|
|
.so man.macros
|
10 |
|
|
.HS spinner iwid
|
11 |
|
|
.BS
|
12 |
|
|
'\" Note: do not modify the .SH NAME line immediately below!
|
13 |
|
|
.SH NAME
|
14 |
|
|
spinner \- Create and manipulate a spinner widget
|
15 |
|
|
.SH SYNOPSIS
|
16 |
|
|
\fBspinner\fI \fIpathName \fR?\fIoptions\fR?
|
17 |
|
|
.SH "INHERITANCE"
|
18 |
|
|
itk::Widget <- Labeledwidget <- Spinner
|
19 |
|
|
.SH "STANDARD OPTIONS"
|
20 |
|
|
.LP
|
21 |
|
|
.nf
|
22 |
|
|
.ta 4c 8c 12c
|
23 |
|
|
\fBbackground\fR \fBborderWidth\fR \fBcursor\fR \fBexportSelection\fR
|
24 |
|
|
\fBforeground\fR \fBhighlightColor\fR \fBhighlightThickness\fR \fBinsertBackground\fR
|
25 |
|
|
\fBinsertBorderWidth\fR \fBinsertOffTime\fR \fBinsertOnTime\fR \fBinsertWidth\fR
|
26 |
|
|
\fBjustify\fR \fBrelief\fR \fBselectBackground\fR \fBselectBorderWidth\fR
|
27 |
|
|
\fBselectForeground\fR \fBtextVariable\fR
|
28 |
|
|
.fi
|
29 |
|
|
.LP
|
30 |
|
|
See the "options" manual entry for details on the standard options.
|
31 |
|
|
.SH "ASSOCIATED OPTIONS"
|
32 |
|
|
.LP
|
33 |
|
|
.nf
|
34 |
|
|
.ta 4c 8c 12c
|
35 |
|
|
\fBshow\fR \fBstate\fR
|
36 |
|
|
.fi
|
37 |
|
|
.LP
|
38 |
|
|
See the "entry" manual entry for details on the associated options.
|
39 |
|
|
.SH "INHERITED OPTIONS"
|
40 |
|
|
.LP
|
41 |
|
|
.nf
|
42 |
|
|
.ta 4c 8c 12c
|
43 |
|
|
\fBchildSitePos\fR \fBcommand\fR \fBfixed\fR \fBfocusCommand\fR
|
44 |
|
|
\fBinvalid\fR \fBtextBackground\fR \fBtextFont\fR \fBvalidate\fR
|
45 |
|
|
\fBwidth\fR
|
46 |
|
|
.fi
|
47 |
|
|
.LP
|
48 |
|
|
See the "entryfield" widget manual entry for details on the above
|
49 |
|
|
inherited options.
|
50 |
|
|
.LP
|
51 |
|
|
.nf
|
52 |
|
|
.ta 4c 8c 12c
|
53 |
|
|
\fBdisabledForeground\fR \fBlabelBitmap\fR \fBlabelFont\fR \fBlabelImage\fR
|
54 |
|
|
\fBlabelMargin\fR \fBlabelPos\fR \fBlabelText\fR \fBlabelVariable\fR
|
55 |
|
|
\fBstate\fR
|
56 |
|
|
.fi
|
57 |
|
|
.LP
|
58 |
|
|
See the "labeledwidget" widget manual entry for details on the above
|
59 |
|
|
inherited options.
|
60 |
|
|
.SH "WIDGET-SPECIFIC OPTIONS"
|
61 |
|
|
.LP
|
62 |
|
|
.nf
|
63 |
|
|
Name: \fBarrowOrient\fR
|
64 |
|
|
Class: \fBOrient\fR
|
65 |
|
|
Command-Line Switch: \fB-arroworient\fR
|
66 |
|
|
.fi
|
67 |
|
|
.IP
|
68 |
|
|
Specifies placement of arrow buttons: \fBhorizontal\fR or \fBvertical\fR.
|
69 |
|
|
The default is vertical.
|
70 |
|
|
.LP
|
71 |
|
|
.nf
|
72 |
|
|
Name: \fBdecrement\fR
|
73 |
|
|
Class: \fBCommand\fR
|
74 |
|
|
Command-Line Switch: \fB-decrement\fR
|
75 |
|
|
.fi
|
76 |
|
|
.IP
|
77 |
|
|
Tcl command to be executed when down arrow is pressed.
|
78 |
|
|
.LP
|
79 |
|
|
.nf
|
80 |
|
|
Name: \fBincrement\fR
|
81 |
|
|
Class: \fBCommand\fR
|
82 |
|
|
Command-Line Switch: \fB-increment\fR
|
83 |
|
|
.fi
|
84 |
|
|
.IP
|
85 |
|
|
Tcl command to be executed when up arrow is pressed.
|
86 |
|
|
.LP
|
87 |
|
|
.nf
|
88 |
|
|
Name: \fBrepeatDelay\fR
|
89 |
|
|
Class: \fBRepeatDelay\fR
|
90 |
|
|
Command-Line Switch: \fB-repeatdelay\fR
|
91 |
|
|
.fi
|
92 |
|
|
.IP
|
93 |
|
|
Specifies the initial delay in milliseconds before the spinner repeat action
|
94 |
|
|
on the arrow buttons engages. The default is 300 milliseconds.
|
95 |
|
|
.LP
|
96 |
|
|
.nf
|
97 |
|
|
Name: \fBrepeatInterval\fR
|
98 |
|
|
Class: \fBRepeatInterval\fR
|
99 |
|
|
Command-Line Switch: \fB-repeatinterval\fR
|
100 |
|
|
.fi
|
101 |
|
|
.IP
|
102 |
|
|
Specifies the repeat delay in milliseconds between selections of the arrow
|
103 |
|
|
buttons. A repeatinterval of 0 disables button repeat. The default is
|
104 |
|
|
100 milliseconds.
|
105 |
|
|
.LP
|
106 |
|
|
.BE
|
107 |
|
|
|
108 |
|
|
.SH DESCRIPTION
|
109 |
|
|
.PP
|
110 |
|
|
The \fBspinner\fR command creates a spinner widget. The spinner is
|
111 |
|
|
comprised of an entryfield plus up and down arrow buttons.
|
112 |
|
|
Arrows may be drawn horizontally or vertically.
|
113 |
|
|
.DE
|
114 |
|
|
|
115 |
|
|
.SH "METHODS"
|
116 |
|
|
.PP
|
117 |
|
|
The \fBspinner\fR command creates a new Tcl command whose
|
118 |
|
|
name is \fIpathName\fR. This
|
119 |
|
|
command may be used to invoke various
|
120 |
|
|
operations on the widget. It has the following general form:
|
121 |
|
|
.DS C
|
122 |
|
|
\fIpathName option \fR?\fIarg arg ...\fR?
|
123 |
|
|
.DE
|
124 |
|
|
\fIOption\fR and the \fIarg\fRs
|
125 |
|
|
determine the exact behavior of the command. The following
|
126 |
|
|
commands are possible for spinner widgets:
|
127 |
|
|
.SH "ASSOCIATED METHODS"
|
128 |
|
|
.LP
|
129 |
|
|
.nf
|
130 |
|
|
.ta 4c 8c 12c
|
131 |
|
|
\fBdelete\fR \fBget\fR \fBicursor\fR \fBindex\fR
|
132 |
|
|
\fBinsert\fR \fBscan\fR \fBselection\fR \fBxview\fR
|
133 |
|
|
.fi
|
134 |
|
|
.LP
|
135 |
|
|
See the "entry" manual entry for details on the associated methods.
|
136 |
|
|
.SH "INHERITED METHODS"
|
137 |
|
|
.LP
|
138 |
|
|
.nf
|
139 |
|
|
.ta 4c 8c 12c
|
140 |
|
|
\fBchildsite\fR \fBclear\fR \fBpeek\fR
|
141 |
|
|
.fi
|
142 |
|
|
.LP
|
143 |
|
|
See the "entryfield" manual entry for details on the associated methods.
|
144 |
|
|
.SH "WIDGET-SPECIFIC METHODS"
|
145 |
|
|
.TP
|
146 |
|
|
\fIpathName \fBcget\fR \fIoption\fR
|
147 |
|
|
Returns the current value of the configuration option given
|
148 |
|
|
by \fIoption\fR.
|
149 |
|
|
\fIOption\fR may have any of the values accepted by the \fBspinner\fR
|
150 |
|
|
command.
|
151 |
|
|
.TP
|
152 |
|
|
\fIpathName\fR \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
|
153 |
|
|
Query or modify the configuration options of the widget.
|
154 |
|
|
If no \fIoption\fR is specified, returns a list describing all of
|
155 |
|
|
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
|
156 |
|
|
information on the format of this list). If \fIoption\fR is specified
|
157 |
|
|
with no \fIvalue\fR, then the command returns a list describing the
|
158 |
|
|
one named option (this list will be identical to the corresponding
|
159 |
|
|
sublist of the value returned if no \fIoption\fR is specified). If
|
160 |
|
|
one or more \fIoption\-value\fR pairs are specified, then the command
|
161 |
|
|
modifies the given widget option(s) to have the given value(s); in
|
162 |
|
|
this case the command returns an empty string.
|
163 |
|
|
\fIOption\fR may have any of the values accepted by the \fBspinner\fR
|
164 |
|
|
command.
|
165 |
|
|
.TP
|
166 |
|
|
\fIpathName \fBdown\fR
|
167 |
|
|
Derived classes may overload this method to specialize functionality.
|
168 |
|
|
.TP
|
169 |
|
|
\fIpathName \fBup\fR
|
170 |
|
|
Derived classes may overload this method to specialize functionality.
|
171 |
|
|
|
172 |
|
|
.SH "COMPONENTS"
|
173 |
|
|
.LP
|
174 |
|
|
.nf
|
175 |
|
|
Name: \fBdownarrow\fR
|
176 |
|
|
Class: \fBCanvas\fR
|
177 |
|
|
.fi
|
178 |
|
|
.IP
|
179 |
|
|
The downarrow component is the downward pointing button of the spinner. See
|
180 |
|
|
the "canvas" widget manual entry for details on the downarrow component item.
|
181 |
|
|
.LP
|
182 |
|
|
.nf
|
183 |
|
|
Name: \fBuparrow\fR
|
184 |
|
|
Class: \fBCanvas\fR
|
185 |
|
|
.fi
|
186 |
|
|
.IP
|
187 |
|
|
The uparrow component is the upward pointing button of the spinner. See
|
188 |
|
|
the "canvas" widget manual entry for details on the uparrow component item.
|
189 |
|
|
.fi
|
190 |
|
|
|
191 |
|
|
.SH EXAMPLE
|
192 |
|
|
.DS
|
193 |
|
|
set months {January February March April May June July \\
|
194 |
|
|
August September October November December}
|
195 |
|
|
|
196 |
|
|
proc blockInput {char} {
|
197 |
|
|
return 0
|
198 |
|
|
}
|
199 |
|
|
|
200 |
|
|
proc spinMonth {step} {
|
201 |
|
|
global months
|
202 |
|
|
|
203 |
|
|
set index [expr [lsearch $months [.sm get]] + $step]
|
204 |
|
|
|
205 |
|
|
if {$index < 0} {set index 11}
|
206 |
|
|
if {$index > 11} {set index 0}
|
207 |
|
|
|
208 |
|
|
.sm delete 0 end
|
209 |
|
|
.sm insert 0 [lindex $months $index]
|
210 |
|
|
}
|
211 |
|
|
|
212 |
|
|
spinner .sm -labeltext "Month : " -width 10 -fixed 10 -validate blockInput \\
|
213 |
|
|
-decrement {spinMonth -1} -increment {spinMonth 1}
|
214 |
|
|
.sm insert 0 January
|
215 |
|
|
|
216 |
|
|
pack .sm -padx 10 -pady 10
|
217 |
|
|
.DE
|
218 |
|
|
.SH ACKNOWLEDGEMENTS:
|
219 |
|
|
.LP
|
220 |
|
|
Ken Copeland
|
221 |
|
|
.IP
|
222 |
|
|
10/18/95 - Added auto-repeat action to spinner arrow buttons.
|
223 |
|
|
.LP
|
224 |
|
|
.SH AUTHOR
|
225 |
|
|
Sue Yockey
|
226 |
|
|
.SH KEYWORDS
|
227 |
|
|
spinner, widget
|