author | Claus Gittinger <cg@exept.de> |
Fri, 17 Jan 1997 23:27:31 +0100 | |
changeset 959 | 331da6bc19ec |
parent 926 | 279927abd911 |
child 966 | 824e0ecc0e6f |
permissions | -rw-r--r-- |
1 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
59 | 3 |
All Rights Reserved |
1 | 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 |
Button subclass:#ArrowButton |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
14 |
instanceVariableNames:'arrowStyle' |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
15 |
classVariableNames:'DownArrowForm UpArrowForm LeftArrowForm RightArrowForm |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
16 |
CachedStyle DefaultArrowStyle DefaultBackgroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
17 |
DefaultForegroundColor DefaultActiveBackgroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
18 |
DefaultActiveForegroundColor DefaultEnteredBackgroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
19 |
DefaultEnteredForegroundColor DefaultDisabledForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
20 |
DefaultArrowButtonActiveLevel DefaultArrowButtonPassiveLevel |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
21 |
DownArrowFormFile UpArrowFormFile LeftArrowFormFile |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
22 |
RightArrowFormFile' |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
23 |
poolDictionaries:'' |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
24 |
category:'Views-Interactors' |
1 | 25 |
! |
26 |
||
899 | 27 |
!ArrowButton class methodsFor:'documentation'! |
38 | 28 |
|
29 |
copyright |
|
30 |
" |
|
31 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
59 | 32 |
All Rights Reserved |
38 | 33 |
|
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! |
|
42 |
||
43 |
documentation |
|
44 |
" |
|
59 | 45 |
ArrowButtons display an arrow as their label; they are mainly |
38 | 46 |
used for scrollbars, but can be useful on their own in some applications. |
59 | 47 |
Beside the contents, their default behavior is to perform their action |
48 |
when pressed - not (as is the default for normal buttons) when released. |
|
38 | 49 |
|
65 | 50 |
Indivdual ArrowButtons can be created by sending one of: |
580 | 51 |
ArrowButton upIn:aView /downIn: / leftIn: or rightIn: |
38 | 52 |
passing the parent view as argument. |
65 | 53 |
|
130 | 54 |
See examples. |
55 |
||
580 | 56 |
|
57 |
[styleSheet parameters:] |
|
58 |
||
59 |
arrowButtonStyle <Symbol> the style of the button; |
|
60 |
#motif, #st80 or nil (default) |
|
61 |
arrowButtonForegroundColor <nil | Color> foregroundColor |
|
62 |
arrowButtonBackgroundColor <nil | Color> backgroundColor |
|
63 |
||
64 |
arrowButtonActiveForegroundColor foregroundColor when pressed |
|
65 |
arrowButtonActiveBackgroundColor backgroundColor when pressed |
|
66 |
||
67 |
arrowButtonEnteredForegroundColor foregroundColor when mouse pointer entered |
|
68 |
arrowButtonEnteredBackgroundColor backgroundColor when mouse pointer entered |
|
69 |
||
585 | 70 |
[author:] |
71 |
Claus Gittinger |
|
72 |
||
580 | 73 |
[See also:] |
74 |
Button Toggle CheckToggle CheckBox |
|
75 |
ScrollBar |
|
130 | 76 |
|
62 | 77 |
" |
78 |
! |
|
1 | 79 |
|
62 | 80 |
examples |
81 |
" |
|
38 | 82 |
example1: |
593 | 83 |
[exBegin] |
84 |
|v p b1 b2 b3 b4| |
|
38 | 85 |
|
593 | 86 |
v := StandardSystemView extent:200@200. |
87 |
p := HorizontalPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v. |
|
88 |
b1 := ArrowButton upIn:p. |
|
89 |
b2 := ArrowButton downIn:p. |
|
90 |
b3 := ArrowButton leftIn:p. |
|
91 |
b4 := ArrowButton rightIn:p. |
|
38 | 92 |
|
593 | 93 |
b1 action:['whatEver you like here ...']. |
94 |
b2 action:['whatEver you like here ...']. |
|
95 |
b3 action:['whatEver you like here ...']. |
|
96 |
b4 action:['whatEver you like here ...']. |
|
38 | 97 |
|
593 | 98 |
v open |
99 |
[exEnd] |
|
38 | 100 |
|
1 | 101 |
|
38 | 102 |
example2: |
593 | 103 |
[exBegin] |
104 |
|v p b1 b2 b3 b4| |
|
59 | 105 |
|
593 | 106 |
v := StandardSystemView extent:200@200. |
107 |
p := HorizontalPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v. |
|
108 |
b1 := (ArrowButton upIn:p) extent:30@30. |
|
109 |
b2 := (ArrowButton downIn:p) extent:30@30. |
|
110 |
b3 := (ArrowButton leftIn:p) extent:30@30. |
|
111 |
b4 := (ArrowButton rightIn:p) extent:30@30. |
|
59 | 112 |
|
593 | 113 |
b1 action:['whatEver you like here ...']. |
114 |
b2 action:['whatEver you like here ...']. |
|
115 |
b3 action:['whatEver you like here ...']. |
|
116 |
b4 action:['whatEver you like here ...']. |
|
59 | 117 |
|
593 | 118 |
v open |
119 |
[exEnd] |
|
120 |
||
59 | 121 |
|
122 |
example3: |
|
593 | 123 |
[exBegin] |
124 |
|v p b1 b2 b3 b4| |
|
59 | 125 |
|
593 | 126 |
v := StandardSystemView extent:200@200. |
127 |
p := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v. |
|
128 |
b1 := (ArrowButton upIn:p) origin:(0.33 @ 0.0) corner:(0.67 @ 0.33). |
|
129 |
b3 := (ArrowButton leftIn:p) origin:(0.0 @ 0.33) corner:(0.33 @ 0.67). |
|
130 |
b4 := (ArrowButton rightIn:p) origin:(0.67 @ 0.33) corner:(1.0 @ 0.67). |
|
131 |
b2 := (ArrowButton downIn:p) origin:(0.33 @ 0.67) corner:(0.67 @ 1.0). |
|
38 | 132 |
|
593 | 133 |
b1 action:['whatEver you like here ...']. |
134 |
b2 action:['whatEver you like here ...']. |
|
135 |
b3 action:['whatEver you like here ...']. |
|
136 |
b4 action:['whatEver you like here ...']. |
|
59 | 137 |
|
593 | 138 |
v open |
139 |
[exEnd] |
|
140 |
||
59 | 141 |
|
65 | 142 |
example4 (not good coding style, to explicitely use a particular style, |
593 | 143 |
just a demonstration how it looks ..): |
144 |
[exBegin] |
|
145 |
|v p b1 b2 b3 b4 oldStyle| |
|
59 | 146 |
|
593 | 147 |
oldStyle := View defaultStyle. |
148 |
View defaultStyle:#motif. |
|
38 | 149 |
|
593 | 150 |
v := StandardSystemView extent:100@100. |
151 |
p := View origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:v. |
|
59 | 152 |
|
593 | 153 |
b1 := (ArrowButton upIn:p) origin:(0.33 @ 0.0) corner:(0.67 @ 0.33). |
154 |
b3 := (ArrowButton leftIn:p) origin:(0.0 @ 0.33) corner:(0.33 @ 0.67). |
|
155 |
b4 := (ArrowButton rightIn:p) origin:(0.67 @ 0.33) corner:(1.0 @ 0.67). |
|
156 |
b2 := (ArrowButton downIn:p) origin:(0.33 @ 0.67) corner:(0.67 @ 1.0). |
|
38 | 157 |
|
593 | 158 |
b1 action:['whatEver you like here ...']. |
159 |
b2 action:['whatEver you like here ...']. |
|
160 |
b3 action:['whatEver you like here ...']. |
|
161 |
b4 action:['whatEver you like here ...']. |
|
59 | 162 |
|
593 | 163 |
View defaultStyle:oldStyle. |
164 |
v open |
|
165 |
[exEnd] |
|
38 | 166 |
" |
167 |
! ! |
|
1 | 168 |
|
899 | 169 |
!ArrowButton class methodsFor:'instance creation'! |
59 | 170 |
|
205 | 171 |
downIn:aView |
172 |
^ (super in:aView) direction:#down |
|
173 |
! |
|
59 | 174 |
|
205 | 175 |
leftIn:aView |
176 |
^ (super in:aView) direction:#left |
|
59 | 177 |
! |
178 |
||
205 | 179 |
rightIn:aView |
180 |
^ (super in:aView) direction:#right |
|
181 |
! |
|
6 | 182 |
|
205 | 183 |
upIn:aView |
184 |
^ (super in:aView) direction:#up |
|
185 |
! ! |
|
38 | 186 |
|
899 | 187 |
!ArrowButton class methodsFor:'defaults'! |
1 | 188 |
|
38 | 189 |
downArrowButtonForm:style on:aDevice |
959 | 190 |
"return the form used for the scrollDown Button" |
1 | 191 |
|
923
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
192 |
<resource: #style (#arrowButtonDownForm)> |
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
193 |
|
59 | 194 |
|form| |
38 | 195 |
|
196 |
" |
|
197 |
use cached form, if device is appropriate |
|
198 |
" |
|
59 | 199 |
CachedStyle ~~ style ifTrue:[ |
657 | 200 |
UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil |
59 | 201 |
]. |
202 |
||
38 | 203 |
((aDevice == Display) and:[DownArrowForm notNil]) ifTrue:[ |
657 | 204 |
^ DownArrowForm |
38 | 205 |
]. |
206 |
||
154 | 207 |
DownArrowForm := StyleSheet at:'arrowButtonDownForm' default:nil. |
208 |
DownArrowForm notNil ifTrue:[ |
|
925 | 209 |
^ DownArrowForm |
154 | 210 |
]. |
211 |
||
38 | 212 |
" |
59 | 213 |
special treatment for st80 arrows |
214 |
- they do not really fit into the general (bitmap) scheme ... |
|
215 |
(i.e. they are computed instead of drawn from a bitmap) |
|
38 | 216 |
" |
59 | 217 |
style ~~ #st80 ifTrue:[ |
657 | 218 |
DownArrowFormFile notNil ifTrue:[ |
899 | 219 |
form := Image fromFile:DownArrowFormFile resolution:100 on:aDevice. |
657 | 220 |
form isNil ifTrue:[ |
899 | 221 |
form := Image fromFile:('bitmaps/' , DownArrowFormFile) resolution:100 on:aDevice. |
222 |
form isNil ifTrue:[ |
|
926 | 223 |
'ArrowButton [info]: no bitmapFile: ' infoPrint. DownArrowFormFile infoPrintCR. |
899 | 224 |
] |
657 | 225 |
] |
226 |
] |
|
38 | 227 |
]. |
6 | 228 |
|
38 | 229 |
" |
230 |
form to use as a fallback, if no bitmap file is present |
|
231 |
(actually not really needed - just to show something useful, in |
|
232 |
case of a bad installation) |
|
233 |
" |
|
234 |
form isNil ifTrue:[ |
|
657 | 235 |
style == #st80 ifTrue:[ |
236 |
form := Form width:9 height:9 depth:1 on:Display. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
237 |
form isNil ifTrue:[^ nil]. |
657 | 238 |
form clear. |
239 |
form lineWidth:2. |
|
240 |
form capStyle:#round. |
|
241 |
form paint:(Color colorId:1). |
|
242 |
form displayLineFromX:0 y:2 toX:4 y:6. |
|
901 | 243 |
form displayLineFromX:4 y:6 toX:8 y:2. |
244 |
form beImmediateForm. |
|
657 | 245 |
] ifFalse:[ |
246 |
form := Form width:16 height:16 |
|
247 |
fromArray:#[2r00000000 2r00000000 |
|
248 |
2r00001111 2r11110000 |
|
249 |
2r00001000 2r00010000 |
|
250 |
2r00001000 2r00010000 |
|
251 |
2r00001000 2r00010000 |
|
252 |
2r00001000 2r00010000 |
|
253 |
2r00001000 2r00010000 |
|
254 |
2r01111000 2r00011110 |
|
255 |
2r01000000 2r00000010 |
|
256 |
2r00100000 2r00000100 |
|
257 |
2r00010000 2r00001000 |
|
258 |
2r00001000 2r00010000 |
|
259 |
2r00000100 2r00100000 |
|
260 |
2r00000010 2r01000000 |
|
261 |
2r00000001 2r10000000 |
|
262 |
2r00000000 2r00000000] |
|
263 |
on:aDevice. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
264 |
form isNil ifTrue:[^ nil]. |
657 | 265 |
]. |
1 | 266 |
]. |
38 | 267 |
|
268 |
" |
|
269 |
remember form for next use |
|
270 |
" |
|
271 |
(aDevice == Display) ifTrue:[ |
|
657 | 272 |
CachedStyle := style. |
273 |
DownArrowForm := form |
|
38 | 274 |
]. |
275 |
||
276 |
^ form |
|
657 | 277 |
|
959 | 278 |
"Modified: 17.1.1997 / 23:15:17 / cg" |
1 | 279 |
! |
280 |
||
38 | 281 |
leftArrowButtonForm:style on:aDevice |
959 | 282 |
"return the form used for the scrollLeft Button" |
38 | 283 |
|
923
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
284 |
<resource: #style (#arrowButtonLeftForm)> |
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
285 |
|
59 | 286 |
|form| |
38 | 287 |
|
288 |
" |
|
289 |
use cached form, if device is appropriate |
|
290 |
" |
|
59 | 291 |
CachedStyle ~~ style ifTrue:[ |
657 | 292 |
UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil |
59 | 293 |
]. |
294 |
||
38 | 295 |
((aDevice == Display) and:[LeftArrowForm notNil]) ifTrue:[ |
657 | 296 |
^ LeftArrowForm |
38 | 297 |
]. |
298 |
||
154 | 299 |
LeftArrowForm := StyleSheet at:'arrowButtonLeftForm' default:nil. |
300 |
LeftArrowForm notNil ifTrue:[ |
|
657 | 301 |
^ LeftArrowForm |
154 | 302 |
]. |
303 |
||
38 | 304 |
" |
59 | 305 |
special treatment for st80 arrows |
306 |
- they do not really fit into the general (bitmap) scheme ... |
|
307 |
(i.e. they are computed instead of drawn from a bitmap) |
|
38 | 308 |
" |
59 | 309 |
style ~~ #st80 ifTrue:[ |
657 | 310 |
LeftArrowFormFile notNil ifTrue:[ |
899 | 311 |
form := Image fromFile:LeftArrowFormFile resolution:100 on:aDevice. |
657 | 312 |
form isNil ifTrue:[ |
899 | 313 |
form := Image fromFile:'bitmaps/' , LeftArrowFormFile resolution:100 on:aDevice. |
314 |
form isNil ifTrue:[ |
|
926 | 315 |
'ArrowButton [info]: no bitmapFile: ' infoPrint. LeftArrowFormFile infoPrintCR. |
899 | 316 |
] |
657 | 317 |
] |
318 |
] |
|
38 | 319 |
]. |
6 | 320 |
|
38 | 321 |
" |
322 |
form to use as a fallback, if no bitmap file is present |
|
323 |
(actually not really needed - just to show something useful, in |
|
324 |
case of a bad installation) |
|
325 |
" |
|
326 |
form isNil ifTrue:[ |
|
657 | 327 |
style == #st80 ifTrue:[ |
328 |
form := Form width:9 height:9 depth:1 on:Display. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
329 |
form isNil ifTrue:[^ nil]. |
657 | 330 |
form clear. |
331 |
form lineWidth:2. |
|
332 |
form capStyle:#round. |
|
333 |
form paint:(Color colorId:1). |
|
334 |
form displayLineFromX:6 y:0 toX:2 y:4. |
|
335 |
form displayLineFromX:2 y:4 toX:6 y:8. |
|
901 | 336 |
form beImmediateForm. |
657 | 337 |
] ifFalse:[ |
338 |
form := Form width:16 height:16 |
|
339 |
fromArray:#[2r00000000 2r00000000 |
|
340 |
2r00000001 2r10000000 |
|
341 |
2r00000010 2r10000000 |
|
342 |
2r00000100 2r10000000 |
|
343 |
2r00001000 2r11111110 |
|
344 |
2r00010000 2r00000010 |
|
345 |
2r00100000 2r00000010 |
|
346 |
2r01000000 2r00000010 |
|
347 |
2r01000000 2r00000010 |
|
348 |
2r00100000 2r00000010 |
|
349 |
2r00010000 2r00000010 |
|
350 |
2r00001000 2r11111110 |
|
351 |
2r00000100 2r10000000 |
|
352 |
2r00000010 2r10000000 |
|
353 |
2r00000001 2r10000000 |
|
354 |
2r00000000 2r00000000] |
|
355 |
on:aDevice. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
356 |
form isNil ifTrue:[^ nil]. |
657 | 357 |
]. |
1 | 358 |
]. |
38 | 359 |
|
360 |
" |
|
361 |
remember form for next use |
|
362 |
" |
|
363 |
(aDevice == Display) ifTrue:[ |
|
657 | 364 |
CachedStyle := style. |
365 |
LeftArrowForm := form |
|
38 | 366 |
]. |
367 |
||
368 |
^ form |
|
657 | 369 |
|
959 | 370 |
"Modified: 17.1.1997 / 23:15:14 / cg" |
1 | 371 |
! |
372 |
||
38 | 373 |
rightArrowButtonForm:style on:aDevice |
959 | 374 |
"return the form used for the scrollRight Button" |
38 | 375 |
|
923
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
376 |
<resource: #style (#arrowButtonRightForm)> |
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
377 |
|
59 | 378 |
|form| |
38 | 379 |
|
380 |
" |
|
381 |
use cached form, if device is appropriate |
|
382 |
" |
|
59 | 383 |
CachedStyle ~~ style ifTrue:[ |
657 | 384 |
UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil |
59 | 385 |
]. |
386 |
||
38 | 387 |
((aDevice == Display) and:[RightArrowForm notNil]) ifTrue:[ |
657 | 388 |
^ RightArrowForm |
38 | 389 |
]. |
390 |
||
154 | 391 |
RightArrowForm := StyleSheet at:'arrowButtonRightForm' default:nil. |
392 |
RightArrowForm notNil ifTrue:[ |
|
657 | 393 |
^ RightArrowForm |
154 | 394 |
]. |
395 |
||
38 | 396 |
" |
59 | 397 |
special treatment for st80 arrows |
398 |
- they do not really fit into the general (bitmap) scheme ... |
|
399 |
(i.e. they are computed instead of drawn from a bitmap) |
|
38 | 400 |
" |
59 | 401 |
style ~~ #st80 ifTrue:[ |
657 | 402 |
RightArrowFormFile notNil ifTrue:[ |
899 | 403 |
form := Image fromFile:RightArrowFormFile resolution:100 on:aDevice. |
657 | 404 |
form isNil ifTrue:[ |
899 | 405 |
form := Image fromFile:'bitmaps/' , RightArrowFormFile resolution:100 on:aDevice. |
406 |
form isNil ifTrue:[ |
|
926 | 407 |
'ArrowButton [info]: no bitmapFile: ' infoPrint. RightArrowFormFile infoPrintCR. |
899 | 408 |
] |
657 | 409 |
] |
410 |
] |
|
38 | 411 |
]. |
6 | 412 |
|
38 | 413 |
" |
414 |
form to use as a fallback, if no bitmap file is present |
|
415 |
(actually not really needed - just to show something useful, in |
|
416 |
case of a bad installation) |
|
417 |
" |
|
418 |
form isNil ifTrue:[ |
|
657 | 419 |
style == #st80 ifTrue:[ |
420 |
form := Form width:9 height:9 depth:1 on:Display. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
421 |
form isNil ifTrue:[^ nil]. |
657 | 422 |
form clear. |
423 |
form lineWidth:2. |
|
424 |
form capStyle:#round. |
|
425 |
form paint:(Color colorId:1). |
|
426 |
form displayLineFromX:2 y:0 toX:6 y:4. |
|
901 | 427 |
form displayLineFromX:6 y:4 toX:2 y:8. |
428 |
form beImmediateForm. |
|
657 | 429 |
] ifFalse:[ |
430 |
form := Form width:16 height:16 |
|
431 |
fromArray:#[2r00000000 2r00000000 |
|
432 |
2r00000001 2r10000000 |
|
433 |
2r00000001 2r01000000 |
|
434 |
2r00000001 2r00100000 |
|
435 |
2r01111111 2r00010000 |
|
436 |
2r01000000 2r00001000 |
|
437 |
2r01000000 2r00000100 |
|
438 |
2r01000000 2r00000010 |
|
439 |
2r01000000 2r00000010 |
|
440 |
2r01000000 2r00000100 |
|
441 |
2r01000000 2r00001000 |
|
442 |
2r01111111 2r00010000 |
|
443 |
2r00000001 2r00100000 |
|
444 |
2r00000001 2r01000000 |
|
445 |
2r00000001 2r10000000 |
|
446 |
2r00000000 2r00000000] |
|
447 |
on:aDevice. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
448 |
form isNil ifTrue:[^ nil]. |
657 | 449 |
]. |
1 | 450 |
]. |
38 | 451 |
|
452 |
" |
|
453 |
remember form for next use |
|
454 |
" |
|
455 |
(aDevice == Display) ifTrue:[ |
|
657 | 456 |
CachedStyle := style. |
457 |
RightArrowForm := form |
|
38 | 458 |
]. |
459 |
||
460 |
^ form |
|
657 | 461 |
|
959 | 462 |
"Modified: 17.1.1997 / 23:15:20 / cg" |
1 | 463 |
! |
464 |
||
205 | 465 |
upArrowButtonForm:style on:aDevice |
466 |
"return the form used for the scrollUp Button" |
|
467 |
||
923
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
468 |
<resource: #style (#arrowButtonUpForm)> |
a6ee1a239fc0
resource spec updated; cache device form
Claus Gittinger <cg@exept.de>
parents:
901
diff
changeset
|
469 |
|
205 | 470 |
|form| |
471 |
||
472 |
" |
|
473 |
use cached form, if device is appropriate |
|
474 |
" |
|
475 |
CachedStyle ~~ style ifTrue:[ |
|
657 | 476 |
UpArrowForm := DownArrowForm := LeftArrowForm := RightArrowForm := nil |
205 | 477 |
]. |
478 |
||
479 |
((aDevice == Display) and:[UpArrowForm notNil]) ifTrue:[ |
|
657 | 480 |
^ UpArrowForm |
205 | 481 |
]. |
482 |
||
483 |
UpArrowForm := StyleSheet at:'arrowButtonUpForm' default:nil. |
|
484 |
UpArrowForm notNil ifTrue:[ |
|
925 | 485 |
^ UpArrowForm |
205 | 486 |
]. |
487 |
||
488 |
" |
|
489 |
special treatment for st80 arrows |
|
490 |
- they do not really fit into the general (bitmap) scheme ... |
|
491 |
(i.e. they are computed instead of drawn from a bitmap) |
|
492 |
" |
|
493 |
style ~~ #st80 ifTrue:[ |
|
657 | 494 |
UpArrowFormFile notNil ifTrue:[ |
899 | 495 |
form := Image fromFile:UpArrowFormFile resolution:100 on:aDevice. |
657 | 496 |
form isNil ifTrue:[ |
899 | 497 |
form := Image fromFile:'bitmaps/' , UpArrowFormFile resolution:100 on:aDevice. |
498 |
form isNil ifTrue:[ |
|
926 | 499 |
'ArrowButton [info]: no bitmapFile: ' infoPrint. UpArrowFormFile infoPrintCR. |
899 | 500 |
] |
657 | 501 |
] |
502 |
] |
|
205 | 503 |
]. |
504 |
||
505 |
" |
|
506 |
form to use as a fallback, if no bitmap file is present |
|
507 |
(actually not really needed - just to show something useful, in |
|
508 |
case of a bad installation) |
|
509 |
" |
|
510 |
form isNil ifTrue:[ |
|
657 | 511 |
style == #st80 ifTrue:[ |
512 |
form := Form width:9 height:9 depth:1 on:aDevice. |
|
270
aa6a36e199e7
be tolerant in case form creation fails
Claus Gittinger <cg@exept.de>
parents:
205
diff
changeset
|
513 |
form isNil ifTrue:[^ nil]. |
657 | 514 |
form clear. |
515 |
form lineWidth:2. |
|
516 |
form capStyle:#round. |
|
517 |
form paint:(Color colorId:1). |
|
518 |
form displayLineFromX:0 y:6 toX:4 y:2. |
|
519 |
form displayLineFromX:4 y:2 toX:8 y:6. |
|
901 | 520 |
form beImmediateForm. |
657 | 521 |
] ifFalse:[ |
522 |
form := Form width:16 height:16 |
|
523 |
fromArray:#[2r00000000 2r00000000 |
|
524 |
2r00000001 2r10000000 |
|
525 |
2r00000010 2r01000000 |
|
526 |
2r00000100 2r00100000 |
|
527 |
2r00001000 2r00010000 |
|
528 |
2r00010000 2r00001000 |
|
529 |
2r00100000 2r00000100 |
|
530 |
2r01000000 2r00000010 |
|
531 |
2r01111000 2r00011110 |
|
532 |
2r00001000 2r00010000 |
|
533 |
2r00001000 2r00010000 |
|
534 |
2r00001000 2r00010000 |
|
535 |
2r00001000 2r00010000 |
|
536 |
2r00001000 2r00010000 |
|
537 |
2r00001111 2r11110000 |
|
538 |
2r00000000 2r00000000] |
|
539 |
on:aDevice. |
|
540 |
form isNil ifTrue:[^ nil]. |
|
541 |
]. |
|
205 | 542 |
]. |
543 |
||
544 |
" |
|
545 |
remember form for next use |
|
546 |
" |
|
547 |
(aDevice == Display) ifTrue:[ |
|
657 | 548 |
CachedStyle := style. |
549 |
UpArrowForm := form |
|
205 | 550 |
]. |
551 |
||
552 |
^ form |
|
657 | 553 |
|
926 | 554 |
"Modified: 10.1.1997 / 15:15:20 / cg" |
1 | 555 |
! |
556 |
||
205 | 557 |
updateStyleCache |
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
558 |
"extract values from the styleSheet and cache them in class variables" |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
559 |
|
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
560 |
<resource: #style (#arrowButtonStyle |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
561 |
#arrowButtonActiveLevel #arrowButtonPassiveLevel |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
562 |
#arrowButtonBackgroundColor #arrowButtonForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
563 |
#arrowButtonActiveBackgroundColor #arrowButtonActiveForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
564 |
#arrowButtonEnteredBackgroundColor #arrowButtonEnteredForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
565 |
#arrowButtonDisabledForegroundColor |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
566 |
#arrowButtonDownForm #arrowButtonUpForm |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
567 |
#arrowButtonLeftForm #arrowButtonRightForm |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
568 |
#arrowButtonDownFormFile #arrowButtonUpFormFile |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
569 |
#arrowButtonLeftFormFile #arrowButtonRightFormFile)> |
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
570 |
|
205 | 571 |
DefaultArrowStyle := StyleSheet at:'arrowButtonStyle' default:StyleSheet name. |
572 |
DefaultArrowStyle := DefaultArrowStyle asSymbol. |
|
573 |
||
574 |
DefaultArrowButtonActiveLevel := StyleSheet at:'arrowButtonActiveLevel' default:nil. |
|
575 |
DefaultArrowButtonPassiveLevel := StyleSheet at:'arrowButtonPassiveLevel' default:nil. |
|
576 |
||
577 |
DefaultBackgroundColor := StyleSheet colorAt:'arrowButtonBackgroundColor'. |
|
578 |
DefaultForegroundColor := StyleSheet colorAt:'arrowButtonForegroundColor'. |
|
579 |
DefaultActiveBackgroundColor := StyleSheet colorAt:'arrowButtonActiveBackgroundColor'. |
|
580 |
DefaultActiveForegroundColor := StyleSheet colorAt:'arrowButtonActiveForegroundColor'. |
|
581 |
DefaultEnteredBackgroundColor := StyleSheet colorAt:'arrowButtonEnteredBackgroundColor'. |
|
582 |
DefaultEnteredForegroundColor := StyleSheet colorAt:'arrowButtonEnteredForegroundColor'. |
|
583 |
DefaultDisabledForegroundColor := StyleSheet colorAt:'arrowButtonDisabledForegroundColor'. |
|
584 |
||
585 |
DownArrowForm := StyleSheet at:'arrowButtonDownForm' default:nil. |
|
586 |
UpArrowForm := StyleSheet at:'arrowButtonUpForm' default:nil. |
|
587 |
LeftArrowForm := StyleSheet at:'arrowButtonLeftForm' default:nil. |
|
588 |
RightArrowForm := StyleSheet at:'arrowButtonRightForm' default:nil. |
|
1 | 589 |
|
205 | 590 |
UpArrowFormFile := DownArrowFormFile := LeftArrowFormFile := RightArrowFormFile := nil. |
591 |
UpArrowForm isNil ifTrue:[ |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
592 |
UpArrowFormFile := StyleSheet at:'arrowButtonUpFormFile' default:'ScrollUp.xbm'. |
205 | 593 |
]. |
594 |
DownArrowForm isNil ifTrue:[ |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
595 |
DownArrowFormFile := StyleSheet at:'arrowButtonDownFormFile' default:'ScrollDn.xbm'. |
205 | 596 |
]. |
597 |
LeftArrowForm isNil ifTrue:[ |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
598 |
LeftArrowFormFile := StyleSheet at:'arrowButtonLeftFormFile' default:'ScrollLt.xbm'. |
205 | 599 |
]. |
600 |
RightArrowForm isNil ifTrue:[ |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
601 |
RightArrowFormFile := StyleSheet at:'arrowButtonRightFormFile' default:'ScrollRt.xbm'. |
205 | 602 |
]. |
603 |
||
604 |
" |
|
605 |
self updateStyleCache |
|
606 |
" |
|
607 |
||
608 |
"Modified: 31.8.1995 / 03:01:14 / claus" |
|
440
2beb33cb0146
added style resource directive
Claus Gittinger <cg@exept.de>
parents:
270
diff
changeset
|
609 |
"Modified: 1.3.1996 / 13:45:57 / cg" |
1 | 610 |
! ! |
611 |
||
612 |
!ArrowButton methodsFor:'accessing'! |
|
613 |
||
614 |
direction:aDirectionSymbol |
|
6 | 615 |
|form| |
616 |
||
1 | 617 |
aDirectionSymbol == #up ifTrue:[ |
62 | 618 |
form := (self class upArrowButtonForm:arrowStyle on:device). |
619 |
name := 'upButton'. |
|
1 | 620 |
]. |
621 |
aDirectionSymbol == #down ifTrue:[ |
|
62 | 622 |
form := (self class downArrowButtonForm:arrowStyle on:device). |
623 |
name := 'downButton'. |
|
1 | 624 |
]. |
625 |
aDirectionSymbol == #left ifTrue:[ |
|
62 | 626 |
form := (self class leftArrowButtonForm:arrowStyle on:device). |
627 |
name := 'leftButton'. |
|
1 | 628 |
]. |
629 |
aDirectionSymbol == #right ifTrue:[ |
|
62 | 630 |
form := (self class rightArrowButtonForm:arrowStyle on:device). |
631 |
name := 'rightButton'. |
|
1 | 632 |
]. |
6 | 633 |
self form:form |
1 | 634 |
! ! |
635 |
||
636 |
!ArrowButton methodsFor:'initialization'! |
|
637 |
||
638 |
initStyle |
|
639 |
super initStyle. |
|
59 | 640 |
|
60 | 641 |
DefaultBackgroundColor notNil ifTrue:[ |
642 |
bgColor := DefaultBackgroundColor on:device |
|
643 |
]. |
|
644 |
DefaultForegroundColor notNil ifTrue:[ |
|
645 |
fgColor := DefaultForegroundColor on:device |
|
646 |
]. |
|
59 | 647 |
DefaultActiveForegroundColor notNil ifTrue:[ |
648 |
activeFgColor := DefaultActiveForegroundColor on:device |
|
649 |
]. |
|
650 |
DefaultActiveBackgroundColor notNil ifTrue:[ |
|
651 |
activeBgColor := DefaultActiveBackgroundColor on:device |
|
652 |
]. |
|
653 |
DefaultEnteredForegroundColor notNil ifTrue:[ |
|
654 |
enteredFgColor := DefaultEnteredForegroundColor on:device |
|
655 |
]. |
|
656 |
DefaultEnteredBackgroundColor notNil ifTrue:[ |
|
657 |
enteredBgColor := DefaultEnteredBackgroundColor on:device |
|
658 |
]. |
|
153 | 659 |
DefaultDisabledForegroundColor notNil ifTrue:[ |
660 |
disabledFgColor := DefaultDisabledForegroundColor on:device |
|
661 |
]. |
|
662 |
||
59 | 663 |
arrowStyle := DefaultArrowStyle. |
664 |
||
128 | 665 |
DefaultArrowButtonActiveLevel notNil ifTrue:[onLevel := DefaultArrowButtonActiveLevel]. |
666 |
DefaultArrowButtonPassiveLevel notNil ifTrue:[offLevel := DefaultArrowButtonPassiveLevel]. |
|
667 |
offLevel ~~ level ifTrue:[self level:offLevel]. |
|
668 |
||
669 |
"/ " |
|
670 |
"/ special treatment for motif arrows |
|
671 |
"/ - they do not really fit into the general (bitmap) scheme ... |
|
672 |
"/ " |
|
673 |
"/ arrowStyle == #motif ifTrue:[ |
|
674 |
"/ onLevel := 0. |
|
675 |
"/ offLevel := 0. |
|
676 |
"/ self level:0. |
|
677 |
"/ ] |
|
205 | 678 |
! |
679 |
||
680 |
initialize |
|
681 |
super initialize. |
|
682 |
controller beTriggerOnDown. |
|
1 | 683 |
! ! |
684 |
||
6 | 685 |
!ArrowButton methodsFor:'redrawing'! |
686 |
||
687 |
drawWith:fg and:bg |
|
688 |
"this is a q&d hack for motif ..." |
|
689 |
||
155 | 690 |
|topLeft botRight noColor allColor isString orgX orgY r| |
6 | 691 |
|
59 | 692 |
arrowStyle ~~ #motif ifTrue:[ |
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
693 |
^ super drawWith:fg and:bg. |
6 | 694 |
]. |
695 |
||
59 | 696 |
" |
697 |
the code below does a lot of bitmap drawing, but allows |
|
698 |
to 3D-ify any logo (it draws it displaced by some pixels |
|
699 |
to the upper left in one-color and displaced to the |
|
60 | 700 |
lower right in the other color). It should be rewritten to |
701 |
cache the result for later drawing operations. |
|
59 | 702 |
" |
6 | 703 |
logo notNil ifTrue:[ |
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
704 |
self paint:bg. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
705 |
self fillRectangleX:0 y:0 width:width height:height. |
6 | 706 |
|
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
707 |
shadowColor := shadowColor on:device. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
708 |
lightColor := lightColor on:device. |
153 | 709 |
|
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
710 |
controller pressed ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
711 |
topLeft := shadowColor. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
712 |
botRight := lightColor |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
713 |
] ifFalse:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
714 |
topLeft := lightColor. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
715 |
botRight := shadowColor |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
716 |
]. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
717 |
|
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
718 |
isString := logo isString. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
719 |
|
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
720 |
isString ifFalse:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
721 |
logo depth ~~ 1 ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
722 |
"/ allow for deep logos (for motif) |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
723 |
"/ one catch: if the view background is a complex pixmap |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
724 |
"/ we cannot use this as colorMap entry. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
725 |
"/ therefore, compute their average colors and take these |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
726 |
"/ (this looks ok for buttons ...) |
38 | 727 |
|
781
51741bd620ab
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
768
diff
changeset
|
728 |
logo graphicsDevice ~~ device ifTrue:[ |
768
33056f6466ea
keep forms in the image (in case the .xbm files are lost at restart)
Claus Gittinger <cg@exept.de>
parents:
765
diff
changeset
|
729 |
"/ 'deep logo: ' print. logo depth printCR. |
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
730 |
r := (0@0 corner:10@10). |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
731 |
logo colorMap:(Array with:(bg averageColorIn:r) |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
732 |
with:(topLeft averageColorIn:r) |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
733 |
with:(botRight averageColorIn:r) |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
734 |
with:(fg averageColorIn:r)). |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
735 |
logo photometric:#palette. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
736 |
logo := logo on:device. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
737 |
]. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
738 |
self displayForm:logo x:labelOriginX y:labelOriginY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
739 |
^ self |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
740 |
] |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
741 |
]. |
6 | 742 |
|
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
743 |
noColor := Color noColor. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
744 |
allColor := Color allColor. |
6 | 745 |
|
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
746 |
isString ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
747 |
orgY := height - font height // 2 + font ascent. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
748 |
orgX := width - labelOriginX // 4 - 1. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
749 |
]. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
750 |
self paint:topLeft. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
751 |
#(-1 0 -1) with:#(-1 -1 0) do:[:dX :dY | |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
752 |
isString ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
753 |
self displayString:logo x:orgX+dX y:orgY+dY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
754 |
] ifFalse:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
755 |
self displayForm:logo x:labelOriginX+dX y:labelOriginY+dY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
756 |
] |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
757 |
]. |
6 | 758 |
|
765
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
759 |
self paint:botRight. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
760 |
#(1 1 0) with:#(0 1 1) do:[:dX :dY | |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
761 |
isString ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
762 |
self displayString:logo x:orgX+dX y:orgY+dY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
763 |
] ifFalse:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
764 |
self displayForm:logo x:labelOriginX+dX y:labelOriginY+dY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
765 |
] |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
766 |
]. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
767 |
|
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
768 |
" |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
769 |
finally, the form itself |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
770 |
" |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
771 |
self paint:fg. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
772 |
isString ifTrue:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
773 |
self displayString:logo x:orgX y:orgY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
774 |
] ifFalse:[ |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
775 |
self displayForm:logo x:labelOriginX y:labelOriginY. |
ea6ecf2a5b30
keep deep device image cached
Claus Gittinger <cg@exept.de>
parents:
657
diff
changeset
|
776 |
] |
6 | 777 |
] |
153 | 778 |
|
779 |
"Modified: 31.8.1995 / 03:03:12 / claus" |
|
781
51741bd620ab
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
768
diff
changeset
|
780 |
"Modified: 5.7.1996 / 17:58:46 / cg" |
6 | 781 |
! ! |
205 | 782 |
|
899 | 783 |
!ArrowButton class methodsFor:'documentation'! |
205 | 784 |
|
785 |
version |
|
959 | 786 |
^ '$Header: /cvs/stx/stx/libwidg/Attic/ArrButton.st,v 1.34 1997-01-17 22:26:49 cg Exp $' |
205 | 787 |
! ! |