author | Claus Gittinger <cg@exept.de> |
Tue, 28 Oct 1997 20:16:04 +0100 | |
changeset 577 | fe0313b081bc |
parent 340 | c02e5db9b6f5 |
child 651 | 2317d52abba7 |
permissions | -rw-r--r-- |
577 | 1 |
'From Smalltalk/X, Version:3.2.1 on 25-oct-1997 at 2:25:15 pm' ! |
2 |
||
338 | 3 |
SimpleView subclass:#UpDownButton |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
4 |
instanceVariableNames:'orientation upButton downButton' |
577 | 5 |
classVariableNames:'DefaultDownForm DefaultUpForm DefaultLeftForm DefaultRightForm' |
338 | 6 |
poolDictionaries:'' |
7 |
category:'Views-Interactors' |
|
8 |
! |
|
9 |
||
10 |
!UpDownButton class methodsFor:'documentation'! |
|
11 |
||
12 |
documentation |
|
13 |
" |
|
14 |
an up/down button - simply two buttons in one view. |
|
15 |
||
16 |
[author:] |
|
17 |
Claus Gittinger |
|
18 |
||
19 |
[see also:] |
|
20 |
ArrowButton |
|
21 |
ComboUpDownView |
|
22 |
" |
|
23 |
! |
|
24 |
||
25 |
examples |
|
26 |
" |
|
27 |
[exBegin] |
|
28 |
|top ud| |
|
29 |
||
30 |
top := StandardSystemView new. |
|
31 |
top extent:(300 @ 200). |
|
32 |
||
33 |
ud := UpDownButton in:top. |
|
34 |
ud origin:(10 @ 10). |
|
35 |
||
36 |
ud upAction:[Transcript showCR:'up']. |
|
37 |
ud downAction:[Transcript showCR:'down']. |
|
38 |
top open. |
|
39 |
[exEnd] |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
40 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
41 |
[exBegin] |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
42 |
|top ud| |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
43 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
44 |
top := StandardSystemView new. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
45 |
top extent:(300 @ 200). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
46 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
47 |
ud := UpDownButton in:top. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
48 |
ud orientation:#horizontal. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
49 |
ud origin:(10 @ 10). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
50 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
51 |
ud upAction:[Transcript showCR:'up']. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
52 |
ud downAction:[Transcript showCR:'down']. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
53 |
top open. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
54 |
[exEnd] |
338 | 55 |
" |
56 |
||
57 |
! ! |
|
58 |
||
59 |
!UpDownButton class methodsFor:'defaults'! |
|
60 |
||
61 |
downButtonForm |
|
62 |
"return the down-buttons image" |
|
63 |
||
577 | 64 |
<resource: #style (#upDownButton.downForm #upDownButton.downFormFile)> |
338 | 65 |
|
66 |
|fileName form| |
|
67 |
||
577 | 68 |
DefaultDownForm notNil ifTrue:[ |
69 |
^ DefaultDownForm |
|
70 |
]. |
|
71 |
||
72 |
form := StyleSheet at:'upDownButton.downForm' default:nil. |
|
338 | 73 |
form isNil ifTrue:[ |
577 | 74 |
fileName := StyleSheet at:'upDownButton.downFormFile' default:'ComboDnB_win.xbm'. |
338 | 75 |
form := Image fromFile:fileName. |
76 |
]. |
|
77 |
form isNil ifTrue:[ |
|
577 | 78 |
form := Form width:10 height:6 |
338 | 79 |
fromArray:#[ |
80 |
2r00000000 2r00000000 |
|
577 | 81 |
2r01111111 2r10000000 |
82 |
2r00111111 2r00000000 |
|
83 |
2r00011110 2r00000000 |
|
84 |
2r00001100 2r00000000 |
|
85 |
2r00000000 2r00000000 |
|
338 | 86 |
] |
87 |
on:Display. |
|
88 |
]. |
|
89 |
form notNil ifTrue:[ |
|
577 | 90 |
DefaultDownForm := form. |
338 | 91 |
^ form on:Display |
92 |
]. |
|
93 |
^ nil |
|
94 |
||
577 | 95 |
"Created: / 1.4.1997 / 11:53:39 / cg" |
96 |
"Modified: / 25.10.1997 / 14:24:20 / cg" |
|
338 | 97 |
! |
98 |
||
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
99 |
leftButtonForm |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
100 |
"return the left-buttons image" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
101 |
|
577 | 102 |
<resource: #style (#upDownButton.leftForm #upDownButton.leftFormFile)> |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
103 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
104 |
|fileName form| |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
105 |
|
577 | 106 |
DefaultLeftForm notNil ifTrue:[ |
107 |
^ DefaultLeftForm |
|
108 |
]. |
|
109 |
||
110 |
form := StyleSheet at:'upDownButton.leftForm' default:nil. |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
111 |
form isNil ifTrue:[ |
577 | 112 |
fileName := StyleSheet at:'upDownButton.leftFormFile' default:'ComboLtB_win.xbm'. |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
113 |
form := Image fromFile:fileName. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
114 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
115 |
form isNil ifTrue:[ |
577 | 116 |
form := Form width:6 height:10 |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
117 |
fromArray:#[ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
118 |
2r00000000 |
577 | 119 |
2r00001000 |
120 |
2r00011000 |
|
121 |
2r00111000 |
|
122 |
2r01111000 |
|
123 |
2r01111000 |
|
124 |
2r00111000 |
|
125 |
2r00011000 |
|
126 |
2r00001000 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
127 |
2r00000000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
128 |
] |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
129 |
on:Display. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
130 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
131 |
form notNil ifTrue:[ |
577 | 132 |
DefaultLeftForm := form. |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
133 |
^ form on:Display |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
134 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
135 |
^ nil |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
136 |
|
577 | 137 |
"Created: / 1.4.1997 / 12:39:18 / cg" |
138 |
"Modified: / 25.10.1997 / 14:21:45 / cg" |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
139 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
140 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
141 |
rightButtonForm |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
142 |
"return the left-buttons image" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
143 |
|
577 | 144 |
<resource: #style (#upDownButton.rightForm #upDownButton.rightFormFile)> |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
145 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
146 |
|fileName form| |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
147 |
|
577 | 148 |
DefaultRightForm notNil ifTrue:[ |
149 |
^ DefaultRightForm |
|
150 |
]. |
|
151 |
||
152 |
form := StyleSheet at:'upDownButton.rightForm' default:nil. |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
153 |
form isNil ifTrue:[ |
577 | 154 |
fileName := StyleSheet at:'upDownButton.rightFormFile' default:'ComboRtB_win.xbm'. |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
155 |
form := Image fromFile:fileName. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
156 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
157 |
form isNil ifTrue:[ |
577 | 158 |
form := Form width:6 height:10 |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
159 |
fromArray:#[ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
160 |
2r00000000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
161 |
2r01000000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
162 |
2r01100000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
163 |
2r01110000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
164 |
2r01111000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
165 |
2r01111000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
166 |
2r01110000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
167 |
2r01100000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
168 |
2r01000000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
169 |
2r00000000 |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
170 |
] |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
171 |
on:Display. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
172 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
173 |
form notNil ifTrue:[ |
577 | 174 |
DefaultRightForm := form. |
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
175 |
^ form on:Display |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
176 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
177 |
^ nil |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
178 |
|
577 | 179 |
"Created: / 1.4.1997 / 12:39:34 / cg" |
180 |
"Modified: / 25.10.1997 / 14:23:04 / cg" |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
181 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
182 |
|
338 | 183 |
upButtonForm |
184 |
"return the up-buttons image" |
|
185 |
||
577 | 186 |
<resource: #style (#upDownButton.upForm #upDownButton.upFormFile)> |
338 | 187 |
|
188 |
|fileName form| |
|
189 |
||
577 | 190 |
DefaultUpForm notNil ifTrue:[ |
191 |
^ DefaultUpForm |
|
192 |
]. |
|
193 |
||
194 |
form := StyleSheet at:'upDownButton.upForm' default:nil. |
|
338 | 195 |
form isNil ifTrue:[ |
577 | 196 |
fileName := StyleSheet at:'upDownButton.upFormFile' default:'ComboUpB_win.xbm'. |
338 | 197 |
form := Image fromFile:fileName. |
198 |
]. |
|
199 |
form isNil ifTrue:[ |
|
577 | 200 |
form := Form width:10 height:6 |
338 | 201 |
fromArray:#[ |
577 | 202 |
2r00000000 2r00000000 |
203 |
2r00001100 2r00000000 |
|
204 |
2r00011110 2r00000000 |
|
205 |
2r00111111 2r00000000 |
|
206 |
2r01111111 2r10000000 |
|
338 | 207 |
2r00000000 2r00000000 |
208 |
] |
|
209 |
on:Display. |
|
210 |
]. |
|
211 |
form notNil ifTrue:[ |
|
577 | 212 |
DefaultUpForm := form. |
338 | 213 |
^ form on:Display |
214 |
]. |
|
215 |
^ nil |
|
216 |
||
577 | 217 |
"Created: / 1.4.1997 / 11:54:13 / cg" |
218 |
"Modified: / 25.10.1997 / 14:23:49 / cg" |
|
219 |
! |
|
220 |
||
221 |
updateStyleCache |
|
222 |
DefaultDownForm := DefaultUpForm := DefaultLeftForm := DefaultRightForm := nil. |
|
223 |
||
224 |
"Created: / 25.10.1997 / 14:11:48 / cg" |
|
338 | 225 |
! ! |
226 |
||
227 |
!UpDownButton methodsFor:'accessing-behavior'! |
|
228 |
||
229 |
downAction:aBlock |
|
230 |
downButton action:aBlock |
|
231 |
||
232 |
"Created: 1.4.1997 / 11:56:33 / cg" |
|
233 |
! |
|
234 |
||
235 |
upAction:aBlock |
|
236 |
upButton action:aBlock |
|
237 |
||
238 |
"Created: 1.4.1997 / 11:56:28 / cg" |
|
239 |
! ! |
|
240 |
||
241 |
!UpDownButton methodsFor:'accessing-components'! |
|
242 |
||
243 |
downButton |
|
244 |
^ downButton |
|
245 |
||
246 |
"Created: 1.4.1997 / 11:56:05 / cg" |
|
247 |
! |
|
248 |
||
249 |
upButton |
|
250 |
^ upButton |
|
251 |
||
252 |
"Created: 1.4.1997 / 11:55:52 / cg" |
|
253 |
"Modified: 1.4.1997 / 11:56:02 / cg" |
|
254 |
! ! |
|
255 |
||
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
256 |
!UpDownButton methodsFor:'accessing-look'! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
257 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
258 |
orientation |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
259 |
^ orientation |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
260 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
261 |
"Created: 1.4.1997 / 12:42:01 / cg" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
262 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
263 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
264 |
orientation:aSymbol |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
265 |
orientation := aSymbol. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
266 |
self initializeButtonDimensions |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
267 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
268 |
"Created: 1.4.1997 / 12:42:17 / cg" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
269 |
"Modified: 1.4.1997 / 12:42:29 / cg" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
270 |
! ! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
271 |
|
338 | 272 |
!UpDownButton methodsFor:'initialization'! |
273 |
||
274 |
initialize |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
275 |
orientation := #vertical. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
276 |
|
338 | 277 |
super initialize. |
278 |
self initializeButtons |
|
279 |
||
280 |
"Created: 1.4.1997 / 11:58:07 / cg" |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
281 |
"Modified: 1.4.1997 / 12:47:58 / cg" |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
282 |
! |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
283 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
284 |
initializeButtonDimensions |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
285 |
orientation == #vertical ifTrue:[ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
286 |
upButton label:(self class upButtonForm). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
287 |
downButton label:(self class downButtonForm). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
288 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
289 |
upButton origin:0@0. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
290 |
downButton origin:(0 @ upButton preferredExtent y). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
291 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
292 |
self preferredExtent:(upButton preferredExtent x |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
293 |
@ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
294 |
(upButton preferredExtent y |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
295 |
+ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
296 |
downButton preferredExtent y)). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
297 |
] ifFalse:[ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
298 |
upButton label:(self class rightButtonForm). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
299 |
downButton label:(self class leftButtonForm). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
300 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
301 |
downButton origin:0@0. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
302 |
upButton origin:(downButton preferredExtent x @ 0). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
303 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
304 |
self preferredExtent:((upButton preferredExtent x |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
305 |
+ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
306 |
downButton preferredExtent x) |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
307 |
@ |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
308 |
upButton preferredExtent y). |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
309 |
]. |
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
310 |
|
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
311 |
"Modified: 1.4.1997 / 12:47:38 / cg" |
338 | 312 |
! |
313 |
||
314 |
initializeButtons |
|
315 |
upButton := ArrowButton upIn:self. |
|
316 |
upButton action:[self countUp]. |
|
317 |
upButton autoRepeat:true. |
|
318 |
||
319 |
downButton := ArrowButton downIn:self. |
|
320 |
downButton action:[self countDown]. |
|
321 |
downButton autoRepeat:true. |
|
322 |
||
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
323 |
self initializeButtonDimensions |
338 | 324 |
|
340
c02e5db9b6f5
added left-right orientation.
Claus Gittinger <cg@exept.de>
parents:
338
diff
changeset
|
325 |
"Modified: 1.4.1997 / 12:42:58 / cg" |
338 | 326 |
! ! |
327 |
||
328 |
!UpDownButton class methodsFor:'documentation'! |
|
329 |
||
330 |
version |
|
577 | 331 |
^ '$Header: /cvs/stx/stx/libwidg2/UpDownButton.st,v 1.3 1997-10-28 19:16:04 cg Exp $' |
338 | 332 |
! ! |