1 |
578 |
markom |
<HTML>
|
2 |
|
|
<HEAD>
|
3 |
|
|
<TITLE>iwidgets2.2.0 User Commands - spinner</TITLE>
|
4 |
|
|
</HEAD>
|
5 |
|
|
<BODY BGCOLOR="#FFFFFF">
|
6 |
|
|
<H1>iwidgets2.2.0 User Commands - spinner</H1>
|
7 |
|
|
<HR>
|
8 |
|
|
<PRE>
|
9 |
|
|
|
10 |
|
|
</PRE>
|
11 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
12 |
|
|
|
13 |
|
|
|
14 |
|
|
</PRE>
|
15 |
|
|
<H2>NAME</H2><PRE>
|
16 |
|
|
spinner - Create and manipulate a spinner widget
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
</PRE>
|
20 |
|
|
<H2>SYNOPSIS</H2><PRE>
|
21 |
|
|
<STRONG>spinner</STRONG> <EM>pathName</EM> ?<EM>options</EM>?
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
</PRE>
|
25 |
|
|
<H2>INHERITANCE</H2><PRE>
|
26 |
|
|
itk::Widget <- Labeledwidget <- Spinner
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
</PRE>
|
30 |
|
|
<H2>STANDARD OPTIONS</H2><PRE>
|
31 |
|
|
<STRONG>background</STRONG> <STRONG>borderWidth</STRONG> <STRONG>cursor</STRONG> <STRONG>exportSelection</STRONG>
|
32 |
|
|
<STRONG>foreground</STRONG> <STRONG>highlightColor</STRONG> <STRONG>highlightThicknessinsertBackground</STRONG>
|
33 |
|
|
<STRONG>insertBorderWidth</STRONG> <STRONG>insertOffTime</STRONG> <STRONG>insertOnTimeinsertWidth</STRONG>
|
34 |
|
|
<STRONG>justify</STRONG> <STRONG>relief</STRONG> <STRONG>selectBackgroundselectBorderWidth</STRONG>
|
35 |
|
|
<STRONG>selectForeground</STRONG> <STRONG>textVariable</STRONG>
|
36 |
|
|
|
37 |
|
|
See the "options" manual entry for details on the standard
|
38 |
|
|
options.
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
</PRE>
|
42 |
|
|
<H2>ASSOCIATED OPTIONS</H2><PRE>
|
43 |
|
|
<STRONG>show</STRONG> <STRONG>state</STRONG>
|
44 |
|
|
|
45 |
|
|
See the "entry" manual entry for details on the associated
|
46 |
|
|
options.
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
</PRE>
|
50 |
|
|
<H2>INHERITED OPTIONS</H2><PRE>
|
51 |
|
|
<STRONG>childSitePos</STRONG> <STRONG>command</STRONG> <STRONG>fixed</STRONG> <STRONG>focusCommand</STRONG>
|
52 |
|
|
<STRONG>invalid</STRONG> <STRONG>textBackground</STRONG> <STRONG>textFont</STRONG> <STRONG>validate</STRONG>
|
53 |
|
|
<STRONG>width</STRONG>
|
54 |
|
|
|
55 |
|
|
See the "entryfield" widget manual entry for details on the
|
56 |
|
|
above inherited options.
|
57 |
|
|
|
58 |
|
|
<STRONG>labelBitmap</STRONG> <STRONG>labelFont</STRONG> <STRONG>labelImage</STRONG> <STRONG>labelMargin</STRONG>
|
59 |
|
|
<STRONG>labelPos</STRONG> <STRONG>labelText</STRONG> <STRONG>labelVariable</STRONG>
|
60 |
|
|
|
61 |
|
|
See the "labeledwidget" widget manual entry for details on
|
62 |
|
|
the above inherited options.
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
</PRE>
|
66 |
|
|
<H2>WIDGET-SPECIFIC OPTIONS</H2><PRE>
|
67 |
|
|
Name: <STRONG>arrowOrient</STRONG>
|
68 |
|
|
Class: <STRONG>Orient</STRONG>
|
69 |
|
|
Command-Line Switch: <STRONG>-arroworient</STRONG>
|
70 |
|
|
|
71 |
|
|
Specifies placement of arrow buttons: <STRONG>horizontal</STRONG> or
|
72 |
|
|
<STRONG>vertical</STRONG>. The default is vertical.
|
73 |
|
|
|
74 |
|
|
Name: <STRONG>decrement</STRONG>
|
75 |
|
|
Class: <STRONG>Command</STRONG>
|
76 |
|
|
Command-Line Switch: <STRONG>-decrement</STRONG>
|
77 |
|
|
Tcl command to be executed when down arrow is pressed.
|
78 |
|
|
|
79 |
|
|
Name: <STRONG>increment</STRONG>
|
80 |
|
|
Class: <STRONG>Command</STRONG>
|
81 |
|
|
Command-Line Switch: <STRONG>-increment</STRONG>
|
82 |
|
|
|
83 |
|
|
Tcl command to be executed when up arrow is pressed.
|
84 |
|
|
|
85 |
|
|
Name: <STRONG>repeatDelay</STRONG>
|
86 |
|
|
Class: <STRONG>RepeatDelay</STRONG>
|
87 |
|
|
Command-Line Switch: <STRONG>-repeatdelay</STRONG>
|
88 |
|
|
|
89 |
|
|
Specifies the initial delay in milliseconds before the
|
90 |
|
|
spinner repeat action on the arrow buttons engages.
|
91 |
|
|
The default is 300 milliseconds.
|
92 |
|
|
|
93 |
|
|
Name: <STRONG>repeatInterval</STRONG>
|
94 |
|
|
Class: <STRONG>RepeatInterval</STRONG>
|
95 |
|
|
Command-Line Switch: <STRONG>-repeatinterval</STRONG>
|
96 |
|
|
|
97 |
|
|
Specifies the repeat delay in milliseconds between
|
98 |
|
|
selections of the arrow buttons. A repeatinterval of 0
|
99 |
|
|
disables button repeat. The default is 100 mil-
|
100 |
|
|
liseconds.
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
</PRE>
|
104 |
|
|
<H2><HR ALIGN=LEFT WIDTH=70% SIZE=3></H2><PRE>
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
</PRE>
|
109 |
|
|
<H2>DESCRIPTION</H2><PRE>
|
110 |
|
|
The <STRONG>spinner</STRONG> command creates a spinner widget. The spinner
|
111 |
|
|
is comprised of an entryfield plus up and down arrow but-
|
112 |
|
|
tons. Arrows may be drawn horizontally or vertically.
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
</PRE>
|
118 |
|
|
<H2>METHODS</H2><PRE>
|
119 |
|
|
The <STRONG>spinner</STRONG> command creates a new Tcl command whose name is
|
120 |
|
|
<EM>pathName</EM>. This command may be used to invoke various opera-
|
121 |
|
|
tions on the widget. It has the following general form:
|
122 |
|
|
|
123 |
|
|
<EM>pathName</EM> <EM>option</EM> ?<EM>arg</EM> <EM>arg</EM> ...?
|
124 |
|
|
|
125 |
|
|
<EM>Option</EM> and the <EM>arg</EM>s determine the exact behavior of the com-
|
126 |
|
|
mand. The following commands are possible for spinner widg-
|
127 |
|
|
ets:
|
128 |
|
|
|
129 |
|
|
|
130 |
|
|
</PRE>
|
131 |
|
|
<H2>ASSOCIATED METHODS</H2><PRE>
|
132 |
|
|
<STRONG>delete</STRONG> <STRONG>get</STRONG> <STRONG>icursor</STRONG> <STRONG>index</STRONG>
|
133 |
|
|
<STRONG>insert</STRONG> <STRONG>scan</STRONG> <STRONG>selection</STRONG> <STRONG>xview</STRONG>
|
134 |
|
|
|
135 |
|
|
See the "entry" manual entry for details on the associated
|
136 |
|
|
methods.
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
</PRE>
|
140 |
|
|
<H2>INHERITED METHODS</H2><PRE>
|
141 |
|
|
<STRONG>childsite</STRONG> <STRONG>clear</STRONG> <STRONG>peek</STRONG>
|
142 |
|
|
|
143 |
|
|
See the "entryfield" manual entry for details on the associ-
|
144 |
|
|
ated methods.
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
</PRE>
|
148 |
|
|
<H2>WIDGET-SPECIFIC METHODS</H2><PRE>
|
149 |
|
|
<EM>pathName</EM> <STRONG>cget</STRONG> <EM>option</EM>
|
150 |
|
|
Returns the current value of the configuration option
|
151 |
|
|
given by <EM>option</EM>. <EM>Option</EM> may have any of the values
|
152 |
|
|
accepted by the <STRONG>spinner</STRONG> command.
|
153 |
|
|
|
154 |
|
|
<EM>pathName</EM> <STRONG>configure</STRONG> ?<EM>option</EM>? ?<EM>value</EM> <EM>option</EM> <EM>value</EM> ...?
|
155 |
|
|
Query or modify the configuration options of the
|
156 |
|
|
widget. If no <EM>option</EM> is specified, returns a list
|
157 |
|
|
describing all of the available options for <EM>pathName</EM>
|
158 |
|
|
(see <STRONG>Tk_ConfigureInfo</STRONG> for information on the format of
|
159 |
|
|
this list). If <EM>option</EM> is specified with no <EM>value</EM>, then
|
160 |
|
|
the command returns a list describing the one named
|
161 |
|
|
option (this list will be identical to the correspond-
|
162 |
|
|
ing sublist of the value returned if no <EM>option</EM> is
|
163 |
|
|
specified). If one or more <EM>option</EM> - <EM>value</EM> pairs are
|
164 |
|
|
specified, then the command modifies the given widget
|
165 |
|
|
option(s) to have the given value(s); in this case the
|
166 |
|
|
command returns an empty string. <EM>Option</EM> may have any
|
167 |
|
|
of the values accepted by the <STRONG>spinner</STRONG> command.
|
168 |
|
|
|
169 |
|
|
<EM>pathName</EM> <STRONG>down</STRONG>
|
170 |
|
|
Derived classes may overload this method to specialize
|
171 |
|
|
functionality.
|
172 |
|
|
|
173 |
|
|
<EM>pathName</EM> <STRONG>up</STRONG>
|
174 |
|
|
Derived classes may overload this method to specialize
|
175 |
|
|
functionality.
|
176 |
|
|
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
</PRE>
|
180 |
|
|
<H2>COMPONENTS</H2><PRE>
|
181 |
|
|
Name: <STRONG>downarrow</STRONG>
|
182 |
|
|
Class: <STRONG>Canvas</STRONG>
|
183 |
|
|
|
184 |
|
|
The downarrow component is the downward pointing button
|
185 |
|
|
of the spinner. See the "canvas" widget manual entry
|
186 |
|
|
for details on the downarrow component item.
|
187 |
|
|
|
188 |
|
|
Name: <STRONG>uparrow</STRONG>
|
189 |
|
|
Class: <STRONG>Canvas</STRONG>
|
190 |
|
|
|
191 |
|
|
The uparrow component is the upward pointing button of
|
192 |
|
|
the spinner. See the "canvas" widget manual entry for
|
193 |
|
|
details on the uparrow component item.
|
194 |
|
|
|
195 |
|
|
|
196 |
|
|
|
197 |
|
|
</PRE>
|
198 |
|
|
<H2>EXAMPLE</H2><PRE>
|
199 |
|
|
option add *textBackground GhostWhite
|
200 |
|
|
|
201 |
|
|
set months {January February March April May June July \
|
202 |
|
|
August September October November December}
|
203 |
|
|
|
204 |
|
|
proc blockInput {char} {
|
205 |
|
|
return 0
|
206 |
|
|
}
|
207 |
|
|
|
208 |
|
|
proc spinMonth {step} {
|
209 |
|
|
global months
|
210 |
|
|
|
211 |
|
|
set index [expr [lsearch $months [.sm get]] + $step]
|
212 |
|
|
|
213 |
|
|
if {$index < 0} {set index 11}
|
214 |
|
|
if {$index > 11} {set index 0}
|
215 |
|
|
|
216 |
|
|
.sm delete 0 end
|
217 |
|
|
.sm insert 0 [lindex $months $index]
|
218 |
|
|
}
|
219 |
|
|
|
220 |
|
|
spinner .sm -labeltext "Month : " -width 10 -fixed 10 -validate blockInput \
|
221 |
|
|
-decrement {spinMonth -1} -increment {spinMonth 1}
|
222 |
|
|
.sm insert 0 January
|
223 |
|
|
|
224 |
|
|
pack .sm -padx 10 -pady 10
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
|
228 |
|
|
</PRE>
|
229 |
|
|
<H2>ACKNOWLEDGEMENTS:</H2><PRE>
|
230 |
|
|
Ken Copeland <ken@hilco.com>
|
231 |
|
|
|
232 |
|
|
10/18/95 - Added auto-repeat action to spinner arrow
|
233 |
|
|
buttons.
|
234 |
|
|
|
235 |
|
|
|
236 |
|
|
</PRE>
|
237 |
|
|
<H2>AUTHOR</H2><PRE>
|
238 |
|
|
Sue Yockey
|
239 |
|
|
|
240 |
|
|
|
241 |
|
|
</PRE>
|
242 |
|
|
<H2>KEYWORDS</H2><PRE>
|
243 |
|
|
spinner, widget
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
|
250 |
|
|
|
251 |
|
|
|
252 |
|
|
|
253 |
|
|
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
</PRE>
|
257 |
|
|
</BODY>
|
258 |
|
|
</HTML>
|