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