author | Claus Gittinger <cg@exept.de> |
Fri, 06 Sep 2002 18:59:19 +0200 | |
changeset 2175 | b7388c30badf |
parent 1985 | 1e21a6928dfb |
child 2212 | db7871a125b7 |
permissions | -rw-r--r-- |
1718 | 1 |
" |
2 |
COPYRIGHT (c) 1997 eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
||
14 |
||
1981 | 15 |
"{ Package: 'stx:libwidg2' }" |
16 |
||
1299 | 17 |
View subclass:#UpDownButton |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
18 |
instanceVariableNames:'orientation upButton downButton' |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
19 |
classVariableNames:'' |
338 | 20 |
poolDictionaries:'' |
21 |
category:'Views-Interactors' |
|
22 |
! |
|
23 |
||
24 |
!UpDownButton class methodsFor:'documentation'! |
|
25 |
||
1718 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 1997 eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
" |
|
38 |
||
39 |
||
40 |
! |
|
41 |
||
338 | 42 |
documentation |
43 |
" |
|
44 |
an up/down button - simply two buttons in one view. |
|
1436 | 45 |
This is also called SpinButton. |
338 | 46 |
|
47 |
[author:] |
|
48 |
Claus Gittinger |
|
49 |
||
50 |
[see also:] |
|
51 |
ArrowButton |
|
52 |
ComboUpDownView |
|
53 |
" |
|
54 |
! |
|
55 |
||
56 |
examples |
|
57 |
" |
|
58 |
[exBegin] |
|
59 |
|top ud| |
|
60 |
||
61 |
top := StandardSystemView new. |
|
62 |
top extent:(300 @ 200). |
|
63 |
||
64 |
ud := UpDownButton in:top. |
|
65 |
ud origin:(10 @ 10). |
|
66 |
||
67 |
ud upAction:[Transcript showCR:'up']. |
|
68 |
ud downAction:[Transcript showCR:'down']. |
|
69 |
top open. |
|
70 |
[exEnd] |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
71 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
72 |
[exBegin] |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
73 |
|top ud| |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
74 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
75 |
top := StandardSystemView new. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
76 |
top extent:(300 @ 200). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
77 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
78 |
ud := UpDownButton in:top. |
1299 | 79 |
ud origin:(10 @ 10). |
80 |
ud model:[:arg| Transcript showCR:arg]. |
|
81 |
top open. |
|
82 |
[exEnd] |
|
83 |
||
84 |
[exBegin] |
|
85 |
|top ud| |
|
86 |
||
87 |
top := StandardSystemView new. |
|
88 |
top extent:(300 @ 200). |
|
89 |
||
90 |
ud := UpDownButton in:top. |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
91 |
ud orientation:#horizontal. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
92 |
ud origin:(10 @ 10). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
93 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
94 |
ud upAction:[Transcript showCR:'up']. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
95 |
ud downAction:[Transcript showCR:'down']. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
96 |
top open. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
97 |
[exEnd] |
338 | 98 |
" |
99 |
||
100 |
! ! |
|
101 |
||
102 |
!UpDownButton methodsFor:'accessing-behavior'! |
|
103 |
||
104 |
downAction:aBlock |
|
899 | 105 |
"set the down-action" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
106 |
|
338 | 107 |
downButton action:aBlock |
108 |
! |
|
109 |
||
1299 | 110 |
enabled |
111 |
||
112 |
^ upButton enabled. |
|
113 |
||
114 |
"Created: / 30.3.1999 / 17:01:43 / stefan" |
|
115 |
! |
|
818 | 116 |
|
1299 | 117 |
enabled:aBoolean |
118 |
||
119 |
upButton enabled:aBoolean. |
|
120 |
downButton enabled:aBoolean. |
|
121 |
||
122 |
"Created: / 30.3.1999 / 15:47:11 / stefan" |
|
818 | 123 |
! |
124 |
||
338 | 125 |
upAction:aBlock |
899 | 126 |
"set the up-action" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
127 |
|
338 | 128 |
upButton action:aBlock |
129 |
! ! |
|
130 |
||
818 | 131 |
!UpDownButton methodsFor:'accessing-channels'! |
132 |
||
133 |
backgroundChannel |
|
899 | 134 |
"return a valueHolder for the background color" |
818 | 135 |
|
899 | 136 |
^ upButton backgroundChannel |
818 | 137 |
! |
138 |
||
139 |
backgroundChannel: aValueHolder |
|
899 | 140 |
"set a valueHolder for the background color" |
818 | 141 |
|
142 |
upButton backgroundChannel: aValueHolder. |
|
143 |
downButton backgroundChannel: aValueHolder |
|
144 |
! |
|
145 |
||
146 |
enableChannel |
|
899 | 147 |
"return a valueHolder for the enabled-state" |
818 | 148 |
|
1299 | 149 |
^ upButton enableChannel |
150 |
||
151 |
"Modified: / 30.3.1999 / 16:56:32 / stefan" |
|
818 | 152 |
! |
153 |
||
154 |
enableChannel: aValueHolder |
|
899 | 155 |
"set a valueHolder for the enabled-state" |
818 | 156 |
|
157 |
upButton enableChannel: aValueHolder. |
|
158 |
downButton enableChannel: aValueHolder |
|
159 |
! |
|
160 |
||
161 |
foregroundChannel |
|
899 | 162 |
"return a valueHolder for the foreground color" |
818 | 163 |
|
899 | 164 |
^ upButton foregroundChannel |
818 | 165 |
! |
166 |
||
167 |
foregroundChannel: aValueHolder |
|
899 | 168 |
"set a valueHolder for the foreground color" |
818 | 169 |
|
170 |
upButton foregroundChannel: aValueHolder. |
|
171 |
downButton foregroundChannel: aValueHolder |
|
1299 | 172 |
! |
173 |
||
174 |
model:aModel |
|
175 |
||
176 |
|m| |
|
177 |
||
178 |
aModel notNil ifTrue:[ |
|
179 |
m := self. |
|
180 |
upButton changeMessage:#changeUp:. |
|
181 |
downButton changeMessage:#changeDown:. |
|
182 |
]. |
|
183 |
upButton model:m. |
|
184 |
downButton model:m. |
|
185 |
^ super model:aModel |
|
186 |
||
187 |
"Modified: / 30.3.1999 / 17:45:59 / stefan" |
|
818 | 188 |
! ! |
189 |
||
190 |
!UpDownButton methodsFor:'accessing-colors'! |
|
191 |
||
192 |
backgroundColor |
|
899 | 193 |
"return the backgroundColor" |
818 | 194 |
|
852 | 195 |
^upButton backgroundColor |
818 | 196 |
|
197 |
! |
|
198 |
||
199 |
backgroundColor:aColor |
|
899 | 200 |
"set the backgroundColor" |
818 | 201 |
|
202 |
aColor ~~ upButton backgroundColor ifTrue:[ |
|
203 |
upButton backgroundColor:aColor. |
|
204 |
downButton backgroundColor:aColor. |
|
912
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
205 |
shown ifTrue:[ |
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
206 |
self invalidateRepairNow:true |
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
207 |
] |
818 | 208 |
] |
912
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
209 |
|
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
210 |
"Modified: / 6.6.1998 / 19:53:50 / cg" |
818 | 211 |
! |
212 |
||
213 |
foregroundColor |
|
899 | 214 |
"return the foregroundColor" |
818 | 215 |
|
852 | 216 |
^upButton foregroundColor |
818 | 217 |
|
218 |
! |
|
219 |
||
220 |
foregroundColor:aColor |
|
899 | 221 |
"set the foregroundColor" |
818 | 222 |
|
223 |
aColor ~~ upButton foregroundColor ifTrue:[ |
|
224 |
upButton foregroundColor:aColor. |
|
225 |
downButton foregroundColor:aColor. |
|
912
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
226 |
shown ifTrue:[ |
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
227 |
self invalidateRepairNow:true |
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
228 |
] |
818 | 229 |
] |
912
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
230 |
|
e4b45ee7df6d
redrawNow, when colors change.
Claus Gittinger <cg@exept.de>
parents:
899
diff
changeset
|
231 |
"Modified: / 6.6.1998 / 19:53:44 / cg" |
818 | 232 |
! ! |
233 |
||
338 | 234 |
!UpDownButton methodsFor:'accessing-components'! |
235 |
||
236 |
downButton |
|
899 | 237 |
"return the downButton" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
238 |
|
338 | 239 |
^ downButton |
240 |
! |
|
241 |
||
242 |
upButton |
|
899 | 243 |
"return the upButton" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
244 |
|
338 | 245 |
^ upButton |
246 |
! ! |
|
247 |
||
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
248 |
!UpDownButton methodsFor:'accessing-look'! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
249 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
250 |
orientation |
899 | 251 |
"return the orientation (a symbol)" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
252 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
253 |
^ orientation |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
254 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
255 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
256 |
orientation:aSymbol |
899 | 257 |
"set the orientation (#horizontal or #vertical)" |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
258 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
259 |
orientation := aSymbol. |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
260 |
|
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
261 |
self initializeButtonDimensions. |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
262 |
self initializeButtonForms |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
263 |
! ! |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
264 |
|
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
265 |
!UpDownButton methodsFor:'change & update'! |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
266 |
|
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
267 |
sizeChanged:how |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
268 |
|
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
269 |
super sizeChanged:how. |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
270 |
|
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
271 |
self initializeButtonDimensions |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
272 |
! ! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
273 |
|
868 | 274 |
!UpDownButton methodsFor:'event handling'! |
275 |
||
1299 | 276 |
changeDown:aValue |
277 |
"down button was pressed, send to my model" |
|
278 |
||
279 |
self sendChangeMessageWith:#down |
|
280 |
||
281 |
"Modified: / 30.3.1999 / 17:28:50 / stefan" |
|
282 |
! |
|
283 |
||
284 |
changeUp:aValue |
|
285 |
"up button was pressed, send to my model" |
|
286 |
||
287 |
self sendChangeMessageWith:#up |
|
288 |
||
289 |
"Created: / 30.3.1999 / 17:28:26 / stefan" |
|
290 |
! |
|
291 |
||
868 | 292 |
keyPress:aKey x:x y:y |
293 |
"simulate a buttonPress/release" |
|
294 |
||
1985
1e21a6928dfb
stc does not understand + and - in resources.
Stefan Vogel <sv@exept.de>
parents:
1981
diff
changeset
|
295 |
<resource: #keyboard (#CursorRight #CursorUp #CursorLeft #CursorDown)> |
1981 | 296 |
|
297 |
|theButton theController| |
|
868 | 298 |
|
299 |
((aKey == #CursorUp) |
|
300 |
or:[aKey == #CursorRight |
|
301 |
or:[aKey == $+]]) ifTrue:[ |
|
302 |
theButton := upButton |
|
303 |
] ifFalse:[ |
|
304 |
((aKey == #CursorDown) |
|
305 |
or:[aKey == #CursorLeft |
|
306 |
or:[aKey == $-]]) ifTrue:[ |
|
307 |
theButton := downButton |
|
308 |
]. |
|
309 |
]. |
|
310 |
theButton notNil ifTrue:[ |
|
311 |
theController := theButton controller. |
|
312 |
theController pressed:true. |
|
313 |
theController pressed:false. |
|
314 |
^ self |
|
315 |
]. |
|
316 |
^ super keyPress:aKey x:x y:y |
|
317 |
||
318 |
"Created: / 21.4.1998 / 19:48:28 / cg" |
|
319 |
"Modified: / 21.4.1998 / 19:56:28 / cg" |
|
320 |
! ! |
|
321 |
||
1264 | 322 |
!UpDownButton methodsFor:'focus handling'! |
323 |
||
324 |
showFocus:explicit |
|
325 |
"display myself as having-focus" |
|
326 |
||
327 |
(upButton enabled or:[downButton enabled]) ifTrue: [ |
|
328 |
super showFocus:explicit |
|
329 |
] |
|
330 |
! ! |
|
331 |
||
338 | 332 |
!UpDownButton methodsFor:'initialization'! |
333 |
||
334 |
initialize |
|
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
335 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
336 |
orientation := #vertical. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
337 |
|
338 | 338 |
super initialize. |
339 |
self initializeButtons |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
340 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
341 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
342 |
initializeButtonDimensions |
899 | 343 |
|upOrigin downOrigin upCorner downCorner| |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
344 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
345 |
orientation == #vertical ifTrue:[ |
1435
6343d644bf32
oops - up/down was reversed when orientation==horizontal
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
346 |
upOrigin := 0@0. |
899 | 347 |
upCorner := (width - 1) @ (height // 2). |
348 |
downOrigin := 0 @ (height // 2 + 1). |
|
349 |
downCorner := (width - 1) @ (height - 1) |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
350 |
] ifFalse:[ |
1435
6343d644bf32
oops - up/down was reversed when orientation==horizontal
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
351 |
downOrigin := 0@0. |
6343d644bf32
oops - up/down was reversed when orientation==horizontal
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
352 |
downCorner := (width // 2) @ (height - 1). |
6343d644bf32
oops - up/down was reversed when orientation==horizontal
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
353 |
upOrigin := (width // 2 + 1) @ 0. |
6343d644bf32
oops - up/down was reversed when orientation==horizontal
Claus Gittinger <cg@exept.de>
parents:
1299
diff
changeset
|
354 |
upCorner := (width - 1) @ (height - 1) |
899 | 355 |
]. |
356 |
||
357 |
upButton origin:upOrigin. |
|
358 |
upButton corner:upCorner. |
|
359 |
downButton origin:downOrigin. |
|
360 |
downButton corner:downCorner. |
|
361 |
||
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
362 |
! |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
363 |
|
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
364 |
initializeButtonForms |
2175
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
365 |
|upLabel downLabel upPref downPref prefW prefH| |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
366 |
|
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
367 |
orientation == #vertical ifTrue:[ |
2175
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
368 |
upLabel := ArrowButton defaultWIN32ArrowButtonFormForDirection:#up onDevice:nil. |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
369 |
downLabel := ArrowButton defaultWIN32ArrowButtonFormForDirection:#down onDevice:nil. |
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
370 |
] ifFalse:[ |
2175
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
371 |
downLabel := ArrowButton defaultWIN32ArrowButtonFormForDirection:#left onDevice:nil. |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
372 |
upLabel := ArrowButton defaultWIN32ArrowButtonFormForDirection:#right onDevice:nil. |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
373 |
]. |
899 | 374 |
upButton label:upLabel. |
375 |
downButton label:downLabel. |
|
376 |
||
2175
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
377 |
upPref := upButton preferredExtent. |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
378 |
downPref := downButton preferredExtent. |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
379 |
|
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
380 |
orientation == #vertical ifTrue:[ |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
381 |
prefW := upPref x max:(downPref x). |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
382 |
prefH := upPref y + (downPref y). |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
383 |
] ifFalse:[ |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
384 |
prefW := upPref x + (downPref x). |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
385 |
prefH := upPref y max: (downPref y). |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
386 |
]. |
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
387 |
|
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
388 |
self preferredExtent:prefW@prefH. |
338 | 389 |
! |
390 |
||
391 |
initializeButtons |
|
392 |
upButton := ArrowButton upIn:self. |
|
393 |
upButton autoRepeat:true. |
|
394 |
||
395 |
downButton := ArrowButton downIn:self. |
|
396 |
downButton autoRepeat:true. |
|
397 |
||
788
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
398 |
self initializeButtonDimensions. |
826f9374823b
take forms from the ArrowButton + resizing behavior added
tz
parents:
779
diff
changeset
|
399 |
self initializeButtonForms |
338 | 400 |
! ! |
401 |
||
402 |
!UpDownButton class methodsFor:'documentation'! |
|
403 |
||
404 |
version |
|
2175
b7388c30badf
always use win95 style arrows
Claus Gittinger <cg@exept.de>
parents:
1985
diff
changeset
|
405 |
^ '$Header: /cvs/stx/stx/libwidg2/UpDownButton.st,v 1.19 2002-09-06 16:59:19 cg Exp $' |
338 | 406 |
! ! |