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