author | Claus Gittinger <cg@exept.de> |
Fri, 28 Mar 1997 16:02:32 +0100 | |
changeset 1495 | d1934d676421 |
parent 1494 | 4faf11deec70 |
child 1564 | 676244aa61cd |
permissions | -rw-r--r-- |
0 | 1 |
" |
6 | 2 |
COPYRIGHT (c) 1992 by Claus Gittinger |
80 | 3 |
All Rights Reserved |
0 | 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 |
Object subclass:#Cursor |
|
577 | 14 |
instanceVariableNames:'shape sourceForm maskForm hotX hotY device cursorId' |
15 |
classVariableNames:'Lobby DefaultFgColor DefaultBgColor NormalCursor HandCursor |
|
16 |
ArrowCursor WaitCursor CrossHairCursor OriginCursor CornerCursor |
|
17 |
SquareCursor FourWayCursor UpDownArrowCursor LeftRightArrowCursor |
|
18 |
ThumbsUpCursor ThumbsDownCursor ReadCursor WriteCursor XeqCursor |
|
19 |
StopCursor EyeCursor BlankCursor MarkerCursor UpCursor DownCursor |
|
20 |
LeftCursor RightCursor XMarkerCursor CaretCursor' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Graphics-Support' |
|
0 | 23 |
! |
24 |
||
1140 | 25 |
!Cursor class methodsFor:'documentation'! |
0 | 26 |
|
46 | 27 |
copyright |
28 |
" |
|
29 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
80 | 30 |
All Rights Reserved |
46 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! |
|
40 |
||
0 | 41 |
documentation |
38 | 42 |
" |
43 |
I represents cursors in a device independent manner. |
|
144 | 44 |
Normally, cursors are defined at view creation time, |
601 | 45 |
via |
1228 | 46 |
'aView cursor:aCursor'. |
601 | 47 |
|
48 |
[Instance variables:] |
|
0 | 49 |
|
1228 | 50 |
shape <Symbol> a shape (i.e. #arrow, #hand, ...) or nil |
51 |
sourceForm <Form> if shape is nil, the source bits |
|
52 |
maskForm <Form> if shape is nil, the mask bits |
|
53 |
hotX <SmallInteger> if shape is nil, the hotSpot x of the cursor |
|
54 |
hotY <SmallInteger> if shape is nil, the hotSpot y of the cursor |
|
55 |
device <aDevice> the device, if associated to one |
|
56 |
cursorId <anObject> the device-specific id if device is nonNil |
|
0 | 57 |
|
601 | 58 |
[class variables:] |
59 |
||
1228 | 60 |
Lobby <Registry> keeps track of known device cursors |
61 |
(dont use it: this will be moved to the device) |
|
601 | 62 |
|
1228 | 63 |
DefaultFgColor <Color> default foreground color for cursors (usually black) |
64 |
DefaultBgColor <Color> default background color for cursors (usually white) |
|
0 | 65 |
|
1228 | 66 |
NormalCursor <Cursor> cached instance of normal (arrow) cursor |
67 |
... |
|
0 | 68 |
|
601 | 69 |
[see also:] |
1228 | 70 |
DeviceWorkstation |
71 |
DisplaySurface |
|
72 |
Font Cursor Color Form |
|
73 |
( introduction to view programming :html: programming/viewintro.html#CURSOR ) |
|
611 | 74 |
|
75 |
[author:] |
|
1228 | 76 |
Claus Gittinger |
38 | 77 |
" |
144 | 78 |
! |
79 |
||
80 |
examples |
|
81 |
" |
|
82 |
get a standard cursor: |
|
83 |
||
974 | 84 |
Cursor wait |
85 |
Cursor stop |
|
86 |
Cursor normal |
|
144 | 87 |
|
88 |
create a custom cursor: |
|
89 |
||
974 | 90 |
Cursor extent:16@16 |
91 |
fromArray:#[ 2r00000000 2r00000000 |
|
92 |
2r00000000 2r00000000 |
|
93 |
2r00000000 2r00000000 |
|
94 |
2r11111111 2r11111111 |
|
95 |
2r11111111 2r11111111 |
|
96 |
2r00000000 2r00000000 |
|
97 |
2r00000000 2r00000000 |
|
98 |
2r11111111 2r11111111 |
|
99 |
2r11111111 2r11111111 |
|
100 |
2r00000000 2r00000000 |
|
101 |
2r00000000 2r00000000 |
|
102 |
2r11111111 2r11111111 |
|
103 |
2r11111111 2r11111111 |
|
104 |
2r00000000 2r00000000 |
|
105 |
2r00000000 2r00000000 |
|
106 |
2r00000000 2r00000000] |
|
107 |
offset:-8@ -8 |
|
619 | 108 |
|
109 |
||
144 | 110 |
|
111 |
define a cursor for a view: |
|
974 | 112 |
[exBegin] |
113 |
|v| |
|
144 | 114 |
|
974 | 115 |
v := StandardSystemView extent:100@100. |
116 |
v cursor:Cursor stop. |
|
117 |
v open. |
|
118 |
[exEnd] |
|
619 | 119 |
|
144 | 120 |
|
121 |
with above custom cursor: |
|
974 | 122 |
[exBegin] |
123 |
|v| |
|
144 | 124 |
|
974 | 125 |
v := StandardSystemView extent:100@100. |
126 |
v cursor:( |
|
127 |
Cursor extent:16@16 |
|
128 |
fromArray:#[ 2r00000000 2r00000000 |
|
129 |
2r00000000 2r00000000 |
|
130 |
2r00000000 2r00000000 |
|
131 |
2r11111111 2r11111111 |
|
132 |
2r11111111 2r11111111 |
|
133 |
2r00000000 2r00000000 |
|
134 |
2r00000000 2r00000000 |
|
135 |
2r11111111 2r11111111 |
|
136 |
2r11111111 2r11111111 |
|
137 |
2r00000000 2r00000000 |
|
138 |
2r00000000 2r00000000 |
|
139 |
2r11111111 2r11111111 |
|
140 |
2r11111111 2r11111111 |
|
141 |
2r00000000 2r00000000 |
|
142 |
2r00000000 2r00000000 |
|
143 |
2r00000000 2r00000000] |
|
144 |
offset:-8@ -8). |
|
145 |
v open. |
|
146 |
[exEnd] |
|
619 | 147 |
|
144 | 148 |
|
149 |
with multiple views: |
|
974 | 150 |
[exBegin] |
151 |
|v1 v2 top| |
|
144 | 152 |
|
974 | 153 |
top := StandardSystemView new. |
154 |
top extent:300@300. |
|
155 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
156 |
v1 viewBackground:(Color grey:75). |
|
157 |
v1 cursor:Cursor thumbsUp. |
|
158 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
159 |
v2 viewBackground:(Color white). |
|
160 |
v2 cursor:Cursor wait. |
|
161 |
top open. |
|
162 |
[exEnd] |
|
144 | 163 |
|
164 |
||
702 | 165 |
show a cursor (in the active ST/X view) for a while: |
974 | 166 |
[exBegin] |
619 | 167 |
|
974 | 168 |
Cursor wait |
169 |
showWhile:[ |
|
170 |
Delay waitForSeconds:5 |
|
171 |
] |
|
172 |
[exEnd] |
|
144 | 173 |
|
174 |
||
151 | 175 |
show a cursor in all views belonging to a windowGroup: |
176 |
(have to wait until top is visible to access windowGroup) |
|
974 | 177 |
[exBegin] |
178 |
|v1 v2 top| |
|
151 | 179 |
|
974 | 180 |
top := StandardSystemView new. |
181 |
top extent:300@300. |
|
182 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
183 |
v1 viewBackground:(Color grey:75). |
|
184 |
v1 cursor:(Cursor normal). |
|
702 | 185 |
|
974 | 186 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
187 |
v2 viewBackground:(Color white). |
|
188 |
v2 cursor:(Cursor crossHair). |
|
189 |
top openAndWait. |
|
151 | 190 |
|
974 | 191 |
Delay waitForSeconds:3. |
151 | 192 |
|
974 | 193 |
top windowGroup |
194 |
withCursor:Cursor wait |
|
195 |
do:[ |
|
196 |
Delay waitForSeconds:5 |
|
197 |
] |
|
198 |
[exEnd] |
|
151 | 199 |
|
200 |
||
144 | 201 |
show a cursor in a single view for a while: |
974 | 202 |
[exBegin] |
203 |
|v1 v2 top| |
|
144 | 204 |
|
974 | 205 |
top := StandardSystemView new. |
206 |
top extent:300@300. |
|
207 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
208 |
v1 viewBackground:(Color grey:75). |
|
209 |
v1 cursor:(Cursor normal). |
|
702 | 210 |
|
974 | 211 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
212 |
v2 viewBackground:(Color white). |
|
213 |
v2 cursor:(Cursor crossHair). |
|
702 | 214 |
|
974 | 215 |
top openAndWait. |
702 | 216 |
|
974 | 217 |
Delay waitForSeconds:3. |
144 | 218 |
|
974 | 219 |
v1 withCursor:Cursor wait |
220 |
do:[ |
|
221 |
Delay waitForSeconds:5 |
|
222 |
] |
|
223 |
[exEnd] |
|
144 | 224 |
" |
0 | 225 |
! ! |
226 |
||
1140 | 227 |
!Cursor class methodsFor:'initialization'! |
0 | 228 |
|
229 |
flushDeviceCursors |
|
230 |
"unassign all cursors from their device" |
|
231 |
||
223 | 232 |
Lobby notNil ifTrue:[ |
499 | 233 |
Lobby do:[:aCursor | |
223 | 234 |
aCursor restored. |
235 |
Lobby registerChange:aCursor |
|
499 | 236 |
] |
0 | 237 |
] |
238 |
! |
|
239 |
||
577 | 240 |
initialize |
241 |
Lobby isNil ifTrue:[ |
|
242 |
Lobby := Registry new. |
|
243 |
||
244 |
"want to be informed when returning from snapshot" |
|
245 |
ObjectMemory addDependent:self |
|
246 |
] |
|
247 |
! |
|
248 |
||
1495 | 249 |
initializeNewCursors |
250 |
"Create the new cursors |
|
251 |
Cursor blank |
|
252 |
Cursor down |
|
253 |
Cursor execute |
|
254 |
Cursor left |
|
255 |
Cursor marker |
|
256 |
Cursor normal |
|
257 |
Cursor read |
|
258 |
Cursor right |
|
259 |
Cursor square |
|
260 |
Cursor up |
|
261 |
Cursor wait |
|
262 |
Cursor write |
|
263 |
Cursor thumbsUp |
|
264 |
Cursor thumbsDown |
|
265 |
Cursor xMarker |
|
266 |
Cursor caret |
|
267 |
Cursor stop |
|
268 |
Cursor eye" |
|
269 |
||
270 |
|device| |
|
271 |
||
272 |
" claus: already there in ST/X" |
|
273 |
||
274 |
"/ OriginCursor := |
|
275 |
"/ (Cursor |
|
276 |
"/ extent: 16@16 |
|
277 |
"/ fromArray: #( |
|
278 |
"/ 2r1111111111111111 |
|
279 |
"/ 2r1111111111111111 |
|
280 |
"/ 2r1100000000000000 |
|
281 |
"/ 2r1100000000000000 |
|
282 |
"/ 2r1100000000000000 |
|
283 |
"/ 2r1100000000000000 |
|
284 |
"/ 2r1100000000000000 |
|
285 |
"/ 2r1100000000000000 |
|
286 |
"/ 2r1100000000000000 |
|
287 |
"/ 2r1100000000000000 |
|
288 |
"/ 2r1100000000000000 |
|
289 |
"/ 2r1100000000000000 |
|
290 |
"/ 2r1100000000000000 |
|
291 |
"/ 2r1100000000000000 |
|
292 |
"/ 2r1100000000000000 |
|
293 |
"/ 2r1100000000000000) |
|
294 |
"/ offset: -2@ -2). |
|
295 |
"/ |
|
296 |
||
297 |
" claus: already there in ST/X" |
|
298 |
||
299 |
"/ CornerCursor := |
|
300 |
"/ (Cursor |
|
301 |
"/ extent: 16@16 |
|
302 |
"/ fromArray: #( |
|
303 |
"/ 2r0000000000000011 |
|
304 |
"/ 2r0000000000000011 |
|
305 |
"/ 2r0000000000000011 |
|
306 |
"/ 2r0000000000000011 |
|
307 |
"/ 2r0000000000000011 |
|
308 |
"/ 2r0000000000000011 |
|
309 |
"/ 2r0000000000000011 |
|
310 |
"/ 2r0000000000000011 |
|
311 |
"/ 2r0000000000000011 |
|
312 |
"/ 2r0000000000000011 |
|
313 |
"/ 2r0000000000000011 |
|
314 |
"/ 2r0000000000000011 |
|
315 |
"/ 2r0000000000000011 |
|
316 |
"/ 2r0000000000000011 |
|
317 |
"/ 2r1111111111111111 |
|
318 |
"/ 2r1111111111111111) |
|
319 |
"/ offset: -14@ -14). |
|
320 |
||
321 |
||
322 |
"original from SMACK:" |
|
323 |
||
324 |
"/ ReadCursor := |
|
325 |
"/ (Cursor |
|
326 |
"/ extent: 16@16 |
|
327 |
"/ fromArray: #( |
|
328 |
"/ 2r0000110000000110 |
|
329 |
"/ 2r0001001000001001 |
|
330 |
"/ 2r0001001000001001 |
|
331 |
"/ 2r0010000000010000 |
|
332 |
"/ 2r0100000000100000 |
|
333 |
"/ 2r1111101111100000 |
|
334 |
"/ 2r1000010000100000 |
|
335 |
"/ 2r1000010000100000 |
|
336 |
"/ 2r1011010110100000 |
|
337 |
"/ 2r0111101111000000 |
|
338 |
"/ 2r0000000000000000 |
|
339 |
"/ 2r0000000000000000 |
|
340 |
"/ 2r0000000000000000 |
|
341 |
"/ 2r0000000000000000 |
|
342 |
"/ 2r0000000000000000 |
|
343 |
"/ 2r0000000000000000) |
|
344 |
"/ offset: 0@0). |
|
345 |
||
346 |
||
347 |
"claus: added mask" |
|
348 |
||
349 |
ReadCursor := (Cursor |
|
350 |
extent: 16@16 |
|
351 |
sourceArray: #( |
|
352 |
2r0 |
|
353 |
2r0000110000000110 |
|
354 |
2r0001001000001001 |
|
355 |
2r0001001000001001 |
|
356 |
2r0010000000010000 |
|
357 |
2r0100000000100000 |
|
358 |
2r1111101111100000 |
|
359 |
2r1000010000100000 |
|
360 |
2r1000010000100000 |
|
361 |
2r1011010110100000 |
|
362 |
2r0111101111000000 |
|
363 |
2r0000000000000000 |
|
364 |
2r0000000000000000 |
|
365 |
2r0000000000000000 |
|
366 |
2r0000000000000000 |
|
367 |
2r0000000000000000) |
|
368 |
maskArray: #( |
|
369 |
2r0001111000001111 |
|
370 |
2r0001111000011111 |
|
371 |
2r0011111000011111 |
|
372 |
2r0011100000111100 |
|
373 |
2r0111000000111000 |
|
374 |
2r1111111111110000 |
|
375 |
2r1111111111110000 |
|
376 |
2r1111111111110000 |
|
377 |
2r1111111111110000 |
|
378 |
2r1111111111110000 |
|
379 |
2r1111111111100000 |
|
380 |
2r0111111111000000 |
|
381 |
2r0000000000000000 |
|
382 |
2r0000000000000000 |
|
383 |
2r0000000000000000 |
|
384 |
2r0000000000000000) |
|
385 |
offset: -5 @ -7). |
|
386 |
||
387 |
"original from SMACK:" |
|
388 |
||
389 |
"/ WriteCursor := (Cursor |
|
390 |
"/ extent: 16@16 |
|
391 |
"/ fromArray: #( |
|
392 |
"/ 2r0000000000000110 |
|
393 |
"/ 2r0000000000001111 |
|
394 |
"/ 2r0000000000010110 |
|
395 |
"/ 2r0000000000100100 |
|
396 |
"/ 2r0000000001001000 |
|
397 |
"/ 2r0000000010010000 |
|
398 |
"/ 2r0000000100100000 |
|
399 |
"/ 2r0000001001000011 |
|
400 |
"/ 2r0000010010000010 |
|
401 |
"/ 2r0000100100000110 |
|
402 |
"/ 2r0001001000001000 |
|
403 |
"/ 2r0010010000001000 |
|
404 |
"/ 2r0111100001001000 |
|
405 |
"/ 2r0101000010111000 |
|
406 |
"/ 2r0110000110000000 |
|
407 |
"/ 2r1111111100000000) |
|
408 |
"/ offset: 0@0). |
|
409 |
||
410 |
"claus: added mask" |
|
411 |
||
412 |
WriteCursor := (Cursor |
|
413 |
extent: 16@16 |
|
414 |
sourceArray: #( |
|
415 |
2r0000000000000110 |
|
416 |
2r0000000000001111 |
|
417 |
2r0000000000010110 |
|
418 |
2r0000000000100100 |
|
419 |
2r0000000001001000 |
|
420 |
2r0000000010010000 |
|
421 |
2r0000000100100000 |
|
422 |
2r0000001001000011 |
|
423 |
2r0000010010000010 |
|
424 |
2r0000100100000110 |
|
425 |
2r0001001000001000 |
|
426 |
2r0010010000001000 |
|
427 |
2r0111100001001000 |
|
428 |
2r0101000010111000 |
|
429 |
2r0110000110000000 |
|
430 |
2r1111111100000000) |
|
431 |
maskArray: #( |
|
432 |
2r0000000000000111 |
|
433 |
2r0000000000001111 |
|
434 |
2r0000000000011110 |
|
435 |
2r0000000000111100 |
|
436 |
2r0000000001111000 |
|
437 |
2r0000000011110000 |
|
438 |
2r0000000111100001 |
|
439 |
2r0000001111000110 |
|
440 |
2r0000011110000110 |
|
441 |
2r0000111100001110 |
|
442 |
2r0001111000001100 |
|
443 |
2r0011110001001100 |
|
444 |
2r0111100011111000 |
|
445 |
2r0111000110111000 |
|
446 |
2r0111111110000000 |
|
447 |
2r1111111100000000) |
|
448 |
offset: 0@ -15). |
|
449 |
||
450 |
"original from SMACK:" |
|
451 |
||
452 |
"/ WaitCursor := |
|
453 |
"/ (Cursor |
|
454 |
"/ extent: 16@16 |
|
455 |
"/ fromArray: #( |
|
456 |
"/ 2r1111111111111111 |
|
457 |
"/ 2r1000000000000001 |
|
458 |
"/ 2r0100000000000010 |
|
459 |
"/ 2r0010000000000100 |
|
460 |
"/ 2r0001110000111000 |
|
461 |
"/ 2r0000111101110000 |
|
462 |
"/ 2r0000011011100000 |
|
463 |
"/ 2r0000001111000000 |
|
464 |
"/ 2r0000001111000000 |
|
465 |
"/ 2r0000010110100000 |
|
466 |
"/ 2r0000100010010000 |
|
467 |
"/ 2r0001000110001000 |
|
468 |
"/ 2r0010001101000100 |
|
469 |
"/ 2r0100111111110010 |
|
470 |
"/ 2r1011111111111101 |
|
471 |
"/ 2r1111111111111111) |
|
472 |
"/ offset: -8@ -8). |
|
473 |
||
474 |
"claus: added mask" |
|
475 |
||
476 |
WaitCursor := |
|
477 |
(Cursor |
|
478 |
extent: 16@16 |
|
479 |
sourceArray: #( |
|
480 |
2r1111111111111111 |
|
481 |
2r1000000000000001 |
|
482 |
2r0100000000000010 |
|
483 |
2r0010000000000100 |
|
484 |
2r0001110000111000 |
|
485 |
2r0000111101110000 |
|
486 |
2r0000011011100000 |
|
487 |
2r0000001111000000 |
|
488 |
2r0000001111000000 |
|
489 |
2r0000010110100000 |
|
490 |
2r0000100010010000 |
|
491 |
2r0001000110001000 |
|
492 |
2r0010001101000100 |
|
493 |
2r0100111111110010 |
|
494 |
2r1011111111111101 |
|
495 |
2r1111111111111111) |
|
496 |
maskArray: #( |
|
497 |
2r1111111111111111 |
|
498 |
2r1111111111111111 |
|
499 |
2r1111111111111111 |
|
500 |
2r0111111111111110 |
|
501 |
2r0011111111111100 |
|
502 |
2r0001111111111000 |
|
503 |
2r0000111111110000 |
|
504 |
2r0000011111100000 |
|
505 |
2r0000011111100000 |
|
506 |
2r0000111111110000 |
|
507 |
2r0001111111111000 |
|
508 |
2r0011111111111100 |
|
509 |
2r0111111111111110 |
|
510 |
2r1111111111111111 |
|
511 |
2r1111111111111111 |
|
512 |
2r1111111111111111) |
|
513 |
offset: -8@ -8). |
|
514 |
||
515 |
BlankCursor := Cursor new. |
|
516 |
||
517 |
"original from SMACK:" |
|
518 |
||
519 |
"/ XeqCursor := |
|
520 |
"/ (Cursor |
|
521 |
"/ extent: 16@16 |
|
522 |
"/ fromArray: #( |
|
523 |
"/ 2r1000000000010000 |
|
524 |
"/ 2r1100000000010000 |
|
525 |
"/ 2r1110000000111000 |
|
526 |
"/ 2r1111000111111111 |
|
527 |
"/ 2r1111100011000110 |
|
528 |
"/ 2r1111110001000100 |
|
529 |
"/ 2r1111111001111100 |
|
530 |
"/ 2r1111000001101100 |
|
531 |
"/ 2r1101100011000110 |
|
532 |
"/ 2r1001100010000010 |
|
533 |
"/ 2r0000110000000000 |
|
534 |
"/ 2r0000110000000000 |
|
535 |
"/ 2r0000011000000000 |
|
536 |
"/ 2r0000011000000000 |
|
537 |
"/ 2r0000001100000000 |
|
538 |
"/ 2r0000001100000000) |
|
539 |
"/ offset: 0@0). |
|
540 |
||
541 |
"claus: added mask" |
|
542 |
||
543 |
XeqCursor := |
|
544 |
(Cursor |
|
545 |
extent: 16@16 |
|
546 |
sourceArray: #( |
|
547 |
2r1000000000010000 |
|
548 |
2r1100000000010000 |
|
549 |
2r1110000000111000 |
|
550 |
2r1111000111111111 |
|
551 |
2r1111100011000110 |
|
552 |
2r1111110001000100 |
|
553 |
2r1111111001111100 |
|
554 |
2r1111000001101100 |
|
555 |
2r1101100011000110 |
|
556 |
2r1001100010000010 |
|
557 |
2r0000110000000000 |
|
558 |
2r0000110000000000 |
|
559 |
2r0000011000000000 |
|
560 |
2r0000011000000000 |
|
561 |
2r0000001100000000 |
|
562 |
2r0000001100000000) |
|
563 |
maskArray: #( |
|
564 |
2r1100000000111000 |
|
565 |
2r1110000000111000 |
|
566 |
2r1111000111111111 |
|
567 |
2r1111100111111111 |
|
568 |
2r1111110011111111 |
|
569 |
2r1111111001111110 |
|
570 |
2r1111111101111100 |
|
571 |
2r1111100001111110 |
|
572 |
2r1101110011100111 |
|
573 |
2r1001110011000010 |
|
574 |
2r0000111000000000 |
|
575 |
2r0000111000000000 |
|
576 |
2r0000011100000000 |
|
577 |
2r0000011100000000 |
|
578 |
2r0000001110000000 |
|
579 |
2r0000001110000000) |
|
580 |
offset: 0@0). |
|
581 |
||
582 |
"claus: already there in ST/X" |
|
583 |
||
584 |
"/ SquareCursor := |
|
585 |
"/ (Cursor |
|
586 |
"/ extent: 16@16 |
|
587 |
"/ fromArray: #( |
|
588 |
"/ 2r0000000000000000 |
|
589 |
"/ 2r0000000000000000 |
|
590 |
"/ 2r0000000000000000 |
|
591 |
"/ 2r0000000000000000 |
|
592 |
"/ 2r0000000000000000 |
|
593 |
"/ 2r0000001111000000 |
|
594 |
"/ 2r0000001111000000 |
|
595 |
"/ 2r0000001111000000 |
|
596 |
"/ 2r0000001111000000 |
|
597 |
"/ 2r0000000000000000 |
|
598 |
"/ 2r0000000000000000 |
|
599 |
"/ 2r0000000000000000 |
|
600 |
"/ 2r0000000000000000 |
|
601 |
"/ 2r0000000000000000 |
|
602 |
"/ 2r0000000000000000 |
|
603 |
"/ 2r0000000000000000) |
|
604 |
"/ offset: -8@ -8). |
|
605 |
||
606 |
||
607 |
"original from SMACK:" |
|
608 |
||
609 |
"/ NormalCursor := |
|
610 |
"/ (Cursor |
|
611 |
"/ extent: 16@16 |
|
612 |
"/ fromArray: #( |
|
613 |
"/ 2r1000000000000000 |
|
614 |
"/ 2r1100000000000000 |
|
615 |
"/ 2r1110000000000000 |
|
616 |
"/ 2r1111000000000000 |
|
617 |
"/ 2r1111100000000000 |
|
618 |
"/ 2r1111110000000000 |
|
619 |
"/ 2r1111111000000000 |
|
620 |
"/ 2r1111100000000000 |
|
621 |
"/ 2r1111100000000000 |
|
622 |
"/ 2r1001100000000000 |
|
623 |
"/ 2r0000110000000000 |
|
624 |
"/ 2r0000110000000000 |
|
625 |
"/ 2r0000011000000000 |
|
626 |
"/ 2r0000011000000000 |
|
627 |
"/ 2r0000001100000000 |
|
628 |
"/ 2r0000001100000000) |
|
629 |
"/ offset: 0@0). |
|
630 |
||
631 |
"claus: added mask" |
|
632 |
||
633 |
NormalCursor := |
|
634 |
(Cursor |
|
635 |
extent: 16@16 |
|
636 |
sourceArray: #( |
|
637 |
2r1000000000000000 |
|
638 |
2r1100000000000000 |
|
639 |
2r1110000000000000 |
|
640 |
2r1111000000000000 |
|
641 |
2r1111100000000000 |
|
642 |
2r1111110000000000 |
|
643 |
2r1111111000000000 |
|
644 |
2r1111100000000000 |
|
645 |
2r1111100000000000 |
|
646 |
2r1001100000000000 |
|
647 |
2r0000110000000000 |
|
648 |
2r0000110000000000 |
|
649 |
2r0000011000000000 |
|
650 |
2r0000011000000000 |
|
651 |
2r0000001100000000 |
|
652 |
2r0000001100000000) |
|
653 |
maskArray: #( |
|
654 |
2r1100000000000000 |
|
655 |
2r1110000000000000 |
|
656 |
2r1111000000000000 |
|
657 |
2r1111100000000000 |
|
658 |
2r1111110000000000 |
|
659 |
2r1111111000000000 |
|
660 |
2r1111111100000000 |
|
661 |
2r1111110000000000 |
|
662 |
2r1111110000000000 |
|
663 |
2r1001110000000000 |
|
664 |
2r0000111000000000 |
|
665 |
2r0000111000000000 |
|
666 |
2r0000011100000000 |
|
667 |
2r0000011100000000 |
|
668 |
2r0000001110000000 |
|
669 |
2r0000001110000000) |
|
670 |
offset: 0@0). |
|
671 |
||
672 |
"original from SMACK:" |
|
673 |
||
674 |
"/ CrossHairCursor := |
|
675 |
"/ (Cursor |
|
676 |
"/ extent: 16@16 |
|
677 |
"/ fromArray: #( |
|
678 |
"/ 2r0000000100000000 |
|
679 |
"/ 2r0000000100000000 |
|
680 |
"/ 2r0000000100000000 |
|
681 |
"/ 2r0000000100000000 |
|
682 |
"/ 2r0000000100000000 |
|
683 |
"/ 2r0000000100000000 |
|
684 |
"/ 2r0000000100000000 |
|
685 |
"/ 2r1111111111111110 |
|
686 |
"/ 2r0000000100000000 |
|
687 |
"/ 2r0000000100000000 |
|
688 |
"/ 2r0000000100000000 |
|
689 |
"/ 2r0000000100000000 |
|
690 |
"/ 2r0000000100000000 |
|
691 |
"/ 2r0000000100000000 |
|
692 |
"/ 2r0000000100000000 |
|
693 |
"/ 2r0) |
|
694 |
"/ offset: -7@ -7). |
|
695 |
||
696 |
"claus: added mask" |
|
697 |
||
698 |
"no: already there in ST/X" |
|
699 |
||
700 |
"/ CrossHairCursor := |
|
701 |
"/ (Cursor |
|
702 |
"/ extent: 16@16 |
|
703 |
"/ sourceArray: #( |
|
704 |
"/ 2r0000000100000000 |
|
705 |
"/ 2r0000000100000000 |
|
706 |
"/ 2r0000000100000000 |
|
707 |
"/ 2r0000000100000000 |
|
708 |
"/ 2r0000000100000000 |
|
709 |
"/ 2r0000000100000000 |
|
710 |
"/ 2r0000000100000000 |
|
711 |
"/ 2r1111111111111110 |
|
712 |
"/ 2r0000000100000000 |
|
713 |
"/ 2r0000000100000000 |
|
714 |
"/ 2r0000000100000000 |
|
715 |
"/ 2r0000000100000000 |
|
716 |
"/ 2r0000000100000000 |
|
717 |
"/ 2r0000000100000000 |
|
718 |
"/ 2r0000000100000000 |
|
719 |
"/ 2r0) |
|
720 |
"/ maskArray: #( |
|
721 |
"/ 2r0000000110000000 |
|
722 |
"/ 2r0000000110000000 |
|
723 |
"/ 2r0000000110000000 |
|
724 |
"/ 2r0000000110000000 |
|
725 |
"/ 2r0000000110000000 |
|
726 |
"/ 2r0000000110000000 |
|
727 |
"/ 2r0000000110000000 |
|
728 |
"/ 2r1111111111111110 |
|
729 |
"/ 2r1111111111111110 |
|
730 |
"/ 2r0000000110000000 |
|
731 |
"/ 2r0000000110000000 |
|
732 |
"/ 2r0000000110000000 |
|
733 |
"/ 2r0000000110000000 |
|
734 |
"/ 2r0000000110000000 |
|
735 |
"/ 2r0000000110000000 |
|
736 |
"/ 2r0) |
|
737 |
"/ offset: -7@ -7). |
|
738 |
||
739 |
MarkerCursor := |
|
740 |
Cursor |
|
741 |
extent: 16@16 |
|
742 |
fromArray: #( |
|
743 |
2r0000000000000000 |
|
744 |
2r0000000000000000 |
|
745 |
2r0000000000000000 |
|
746 |
2r0000001000000000 |
|
747 |
2r0000001110000000 |
|
748 |
2r0000001111100000 |
|
749 |
2r1111111111111000 |
|
750 |
2r1111111111111110 |
|
751 |
2r1111111111111000 |
|
752 |
2r0000001111100000 |
|
753 |
2r0000001110000000 |
|
754 |
2r0000001000000000 |
|
755 |
2r0000000000000000 |
|
756 |
2r0000000000000000 |
|
757 |
2r0000000000000000 |
|
758 |
2r0000000000000000) |
|
759 |
offset: -7@ -7. |
|
760 |
||
761 |
UpCursor := |
|
762 |
Cursor |
|
763 |
extent: 16@16 |
|
764 |
fromArray: #( |
|
765 |
2r1000000000000000 |
|
766 |
2r1100000000000000 |
|
767 |
2r1110000000000000 |
|
768 |
2r1111000000000000 |
|
769 |
2r1111100000000000 |
|
770 |
2r1111110000000000 |
|
771 |
2r1100000000000000 |
|
772 |
2r1100000000000000 |
|
773 |
2r1100000000000000 |
|
774 |
2r1100000000000000 |
|
775 |
2r1100000000000000 |
|
776 |
2r1100000000000000 |
|
777 |
2r1100000000000000 |
|
778 |
2r1100000000000000 |
|
779 |
2r1100000000000000 |
|
780 |
2r1100000000000000) |
|
781 |
offset: 0@ -7. |
|
782 |
||
783 |
DownCursor := |
|
784 |
Cursor |
|
785 |
extent: 16@16 |
|
786 |
fromArray: #( |
|
787 |
2r0000110000000000 |
|
788 |
2r0000110000000000 |
|
789 |
2r0000110000000000 |
|
790 |
2r0000110000000000 |
|
791 |
2r0000110000000000 |
|
792 |
2r0000110000000000 |
|
793 |
2r0000110000000000 |
|
794 |
2r0000110000000000 |
|
795 |
2r0000110000000000 |
|
796 |
2r0000110000000000 |
|
797 |
2r1111110000000000 |
|
798 |
2r0111110000000000 |
|
799 |
2r0011110000000000 |
|
800 |
2r0001110000000000 |
|
801 |
2r0000110000000000 |
|
802 |
2r0000010000000000) |
|
803 |
offset: -5@ -7. |
|
804 |
||
805 |
LeftCursor := |
|
806 |
Cursor |
|
807 |
extent: 16@16 |
|
808 |
fromArray: #( |
|
809 |
2r1111111111111111 |
|
810 |
2r0111111111111111 |
|
811 |
2r0011110000000000 |
|
812 |
2r0001110000000000 |
|
813 |
2r0000110000000000 |
|
814 |
2r0000010000000000 |
|
815 |
2r0000000000000000 |
|
816 |
2r0000000000000000 |
|
817 |
2r0000000000000000 |
|
818 |
2r0000000000000000 |
|
819 |
2r0000000000000000 |
|
820 |
2r0000000000000000 |
|
821 |
2r0000000000000000 |
|
822 |
2r0000000000000000 |
|
823 |
2r0000000000000000 |
|
824 |
2r0000000000000000) |
|
825 |
offset: -7@0. |
|
826 |
||
827 |
RightCursor := |
|
828 |
Cursor |
|
829 |
extent: 16@16 |
|
830 |
fromArray: #( |
|
831 |
2r0000000000100000 |
|
832 |
2r0000000000110000 |
|
833 |
2r0000000000111000 |
|
834 |
2r0000000000111100 |
|
835 |
2r1111111111111110 |
|
836 |
2r1111111111111111 |
|
837 |
2r0000000000000000 |
|
838 |
2r0000000000000000 |
|
839 |
2r0000000000000000 |
|
840 |
2r0000000000000000 |
|
841 |
2r0000000000000000 |
|
842 |
2r0000000000000000 |
|
843 |
2r0000000000000000 |
|
844 |
2r0000000000000000 |
|
845 |
2r0000000000000000 |
|
846 |
2r0000000000000000) |
|
847 |
offset: -7@ -5. |
|
848 |
XMarkerCursor := |
|
849 |
Cursor |
|
850 |
extent: 16@16 |
|
851 |
fromArray: #( |
|
852 |
2r0 |
|
853 |
2r0000000100000000 |
|
854 |
2r0000000100000000 |
|
855 |
2r0000001110000000 |
|
856 |
2r0000001110000000 |
|
857 |
2r0000011111000000 |
|
858 |
2r0000011111000000 |
|
859 |
2r0000111111100000 |
|
860 |
2r0000111111100000 |
|
861 |
2r0001111111110000 |
|
862 |
2r0000001110000000 |
|
863 |
2r0000001110000000 |
|
864 |
2r0000001110000000 |
|
865 |
2r0000001110000000 |
|
866 |
2r0000001110000000 |
|
867 |
2r0000001110000000) |
|
868 |
offset: -7@ -7. |
|
869 |
||
870 |
"original from SMACK:" |
|
871 |
||
872 |
"/ FourWayCursor := |
|
873 |
"/ Cursor |
|
874 |
"/ extent: 16@16 |
|
875 |
"/ fromArray: #( |
|
876 |
"/ 2r0000000100000000 |
|
877 |
"/ 2r0000001110000000 |
|
878 |
"/ 2r0000011111000000 |
|
879 |
"/ 2r0000111111100000 |
|
880 |
"/ 2r0001001110010000 |
|
881 |
"/ 2r0011001110011000 |
|
882 |
"/ 2r0111111111111100 |
|
883 |
"/ 2r1111111111111110 |
|
884 |
"/ 2r0111111111111100 |
|
885 |
"/ 2r0011001110011000 |
|
886 |
"/ 2r0001001110010000 |
|
887 |
"/ 2r0000111111100000 |
|
888 |
"/ 2r0000011111000000 |
|
889 |
"/ 2r0000001110000000 |
|
890 |
"/ 2r0000000100000000 |
|
891 |
"/ 2r0000000000000000) |
|
892 |
"/ offset: -7@ -7. |
|
893 |
"/ |
|
894 |
||
895 |
"claus: added mask" |
|
896 |
||
897 |
FourWayCursor := |
|
898 |
Cursor |
|
899 |
extent: 16@16 |
|
900 |
sourceArray: #( |
|
901 |
2r0000000100000000 |
|
902 |
2r0000001110000000 |
|
903 |
2r0000011111000000 |
|
904 |
2r0000111111100000 |
|
905 |
2r0001001110010000 |
|
906 |
2r0011001110011000 |
|
907 |
2r0111111111111100 |
|
908 |
2r1111111111111110 |
|
909 |
2r0111111111111100 |
|
910 |
2r0011001110011000 |
|
911 |
2r0001001110010000 |
|
912 |
2r0000111111100000 |
|
913 |
2r0000011111000000 |
|
914 |
2r0000001110000000 |
|
915 |
2r0000000100000000 |
|
916 |
2r0000000000000000) |
|
917 |
maskArray: #( |
|
918 |
2r0000001110000000 |
|
919 |
2r0000011111000000 |
|
920 |
2r0000111111100000 |
|
921 |
2r0001111111110000 |
|
922 |
2r0010111111101000 |
|
923 |
2r0111111111111100 |
|
924 |
2r1111111111111110 |
|
925 |
2r1111111111111110 |
|
926 |
2r1111111111111110 |
|
927 |
2r0111111111111100 |
|
928 |
2r0010111111101000 |
|
929 |
2r0001111111110000 |
|
930 |
2r0000111111100000 |
|
931 |
2r0000011111000000 |
|
932 |
2r0000001110000000 |
|
933 |
2r0000000000000000) |
|
934 |
offset: -7@ -7. |
|
935 |
||
936 |
ThumbsUpCursor := (Cursor |
|
937 |
extent: 16@16 |
|
938 |
sourceArray: #( |
|
939 |
2r0000000000100000 |
|
940 |
2r0000000001010000 |
|
941 |
2r0000000010010000 |
|
942 |
2r0000000011110000 |
|
943 |
2r0000000100010000 |
|
944 |
2r0000000100010000 |
|
945 |
2r0001111100011000 |
|
946 |
2r0010000100000110 |
|
947 |
2r0100000000000000 |
|
948 |
2r0111111000000000 |
|
949 |
2r0100000000000000 |
|
950 |
2r0111111000000000 |
|
951 |
2r0100000000000000 |
|
952 |
2r0011111000001110 |
|
953 |
2r0001000000010000 |
|
954 |
2r0001111111100000) |
|
955 |
maskArray: #( |
|
956 |
2r0000000000100000 |
|
957 |
2r0000000001110000 |
|
958 |
2r0000000011110000 |
|
959 |
2r0000000011110000 |
|
960 |
2r0000000111110000 |
|
961 |
2r0000000111110000 |
|
962 |
2r0001111111111000 |
|
963 |
2r0011111111111110 |
|
964 |
2r0111111111111110 |
|
965 |
2r0111111111111110 |
|
966 |
2r0111111111111110 |
|
967 |
2r0111111111111110 |
|
968 |
2r0111111111111110 |
|
969 |
2r0011111111111110 |
|
970 |
2r0001111111110000 |
|
971 |
2r0001111111100000) |
|
972 |
offset: -8@ -8). |
|
973 |
||
974 |
CaretCursor := (Cursor |
|
975 |
extent: 16@16 |
|
976 |
fromArray: #( |
|
977 |
2r0000000110000000 |
|
978 |
2r0000000110000000 |
|
979 |
2r0000001111000000 |
|
980 |
2r0000011111100000 |
|
981 |
2r0000011001100000 |
|
982 |
2r0000000000000000 |
|
983 |
2r0000000000000000 |
|
984 |
2r0000000000000000 |
|
985 |
2r0000000000000000 |
|
986 |
2r0000000000000000 |
|
987 |
2r0000000000000000 |
|
988 |
2r0000000000000000 |
|
989 |
2r0000000000000000 |
|
990 |
2r0000000000000000 |
|
991 |
2r0000000000000000 |
|
992 |
2r0000000000000000) |
|
993 |
offset: -8@0). |
|
994 |
||
995 |
ThumbsDownCursor := (Cursor |
|
996 |
extent: 16@16 |
|
997 |
sourceArray: #( |
|
998 |
2r0001111111100000 |
|
999 |
2r0001000000010000 |
|
1000 |
2r0011111000001110 |
|
1001 |
2r0100000000000000 |
|
1002 |
2r0111111000000000 |
|
1003 |
2r0100000000000000 |
|
1004 |
2r0111111000000000 |
|
1005 |
2r0100000000000000 |
|
1006 |
2r0010000100000110 |
|
1007 |
2r0001111100011000 |
|
1008 |
2r0000000100010000 |
|
1009 |
2r0000000100010000 |
|
1010 |
2r0000000011110000 |
|
1011 |
2r0000000010010000 |
|
1012 |
2r0000000001010000 |
|
1013 |
2r0000000000100000) |
|
1014 |
||
1015 |
maskArray: #( |
|
1016 |
2r0001111111100000 |
|
1017 |
2r0001111111110000 |
|
1018 |
2r0011111111111110 |
|
1019 |
2r0111111111111110 |
|
1020 |
2r0111111111111110 |
|
1021 |
2r0111111111111110 |
|
1022 |
2r0111111111111110 |
|
1023 |
2r0111111111111110 |
|
1024 |
2r0011111111111110 |
|
1025 |
2r0001111111111000 |
|
1026 |
2r0000000111110000 |
|
1027 |
2r0000000111110000 |
|
1028 |
2r0000000011110000 |
|
1029 |
2r0000000011110000 |
|
1030 |
2r0000000001110000 |
|
1031 |
2r0000000000100000) |
|
1032 |
offset: -8@ -8). |
|
1033 |
||
1034 |
StopCursor := (Cursor |
|
1035 |
extent: 16@16 |
|
1036 |
sourceArray: #( |
|
1037 |
2r0000000000000000 |
|
1038 |
2r0000011111000000 |
|
1039 |
2r0001111111110000 |
|
1040 |
2r0011111111111000 |
|
1041 |
2r0011111111111000 |
|
1042 |
2r0111111111111100 |
|
1043 |
2r0111111111111100 |
|
1044 |
2r0100000000000100 |
|
1045 |
2r0100000000000100 |
|
1046 |
2r0111111111111100 |
|
1047 |
2r0111111111111100 |
|
1048 |
2r0011111111111000 |
|
1049 |
2r0011111111111000 |
|
1050 |
2r0001111111110000 |
|
1051 |
2r0000011111000000 |
|
1052 |
2r0000000000000000 |
|
1053 |
) |
|
1054 |
maskArray: #( |
|
1055 |
2r0000011111000000 |
|
1056 |
2r0001111111110000 |
|
1057 |
2r0011111111111000 |
|
1058 |
2r0111111111111100 |
|
1059 |
2r0111111111111100 |
|
1060 |
2r1111111111111110 |
|
1061 |
2r1111111111111110 |
|
1062 |
2r1111111111111110 |
|
1063 |
2r1111111111111110 |
|
1064 |
2r1111111111111110 |
|
1065 |
2r1111111111111110 |
|
1066 |
2r0111111111111100 |
|
1067 |
2r0111111111111100 |
|
1068 |
2r0011111111111000 |
|
1069 |
2r0001111111110000 |
|
1070 |
2r0000011111000000 |
|
1071 |
) |
|
1072 |
offset: -8 @ -8). |
|
1073 |
||
1074 |
EyeCursor := (Cursor |
|
1075 |
extent: 16@16 |
|
1076 |
sourceArray: #( |
|
1077 |
2r0000000000000000 |
|
1078 |
2r0000000000000000 |
|
1079 |
2r0000000000000000 |
|
1080 |
2r0000011111000000 |
|
1081 |
2r0001111111110000 |
|
1082 |
2r0011000000011000 |
|
1083 |
2r0110001110001100 |
|
1084 |
2r1100011111000110 |
|
1085 |
2r1100011111000110 |
|
1086 |
2r0110001110001100 |
|
1087 |
2r0011000000011000 |
|
1088 |
2r0001111111110000 |
|
1089 |
2r0000011111000000 |
|
1090 |
2r0000000000000000 |
|
1091 |
2r0000000000000000 |
|
1092 |
2r0000000000000000 |
|
1093 |
) |
|
1094 |
maskArray: #( |
|
1095 |
2r0000000000000000 |
|
1096 |
2r0000000000000000 |
|
1097 |
2r0000000000000000 |
|
1098 |
2r0000011111000000 |
|
1099 |
2r0001111111110000 |
|
1100 |
2r0011111111111000 |
|
1101 |
2r0111111111111100 |
|
1102 |
2r1111111111111110 |
|
1103 |
2r1111111111111110 |
|
1104 |
2r0111111111111100 |
|
1105 |
2r0011111111111000 |
|
1106 |
2r0001111111110000 |
|
1107 |
2r0000011111000000 |
|
1108 |
2r0000000000000000 |
|
1109 |
2r0000000000000000 |
|
1110 |
2r0000000000000000 |
|
1111 |
) |
|
1112 |
offset: -8 @ -8). |
|
1113 |
||
1114 |
device := Display. |
|
1115 |
||
1116 |
FourWayCursor := FourWayCursor onDevice:device. |
|
1117 |
LeftCursor := LeftCursor onDevice:device. |
|
1118 |
RightCursor := RightCursor onDevice:device. |
|
1119 |
XMarkerCursor := XMarkerCursor onDevice:device. |
|
1120 |
||
1121 |
"/ OriginCursor := OriginCursor onDevice:device. |
|
1122 |
"/ CornerCursor := CornerCursor onDevice:device. |
|
1123 |
||
1124 |
ReadCursor := ReadCursor onDevice:device. |
|
1125 |
WriteCursor := WriteCursor onDevice:device. |
|
1126 |
WaitCursor := WaitCursor onDevice:device. |
|
1127 |
XeqCursor := XeqCursor onDevice:device. |
|
1128 |
||
1129 |
"/ SquareCursor := SquareCursor onDevice:device. |
|
1130 |
||
1131 |
NormalCursor := NormalCursor onDevice:device. |
|
1132 |
||
1133 |
"/ CrossHairCursor := CrossHairCursor onDevice:device. |
|
1134 |
||
1135 |
MarkerCursor := MarkerCursor onDevice:device. |
|
1136 |
UpCursor := UpCursor onDevice:device. |
|
1137 |
DownCursor := DownCursor onDevice:device. |
|
1138 |
LeftCursor := LeftCursor onDevice:device. |
|
1139 |
RightCursor := RightCursor onDevice:device. |
|
1140 |
XMarkerCursor := XMarkerCursor onDevice:device. |
|
1141 |
CaretCursor := CaretCursor onDevice:device. |
|
1142 |
||
1143 |
ThumbsUpCursor := ThumbsUpCursor onDevice:device. |
|
1144 |
ThumbsDownCursor := ThumbsDownCursor onDevice:device. |
|
1145 |
StopCursor := StopCursor onDevice:device. |
|
1146 |
EyeCursor := EyeCursor onDevice:device. |
|
1147 |
||
1148 |
"Cursor initializeNewCursors" |
|
1149 |
||
1150 |
"Modified: 28.3.1997 / 16:01:50 / cg" |
|
1151 |
! |
|
1152 |
||
864 | 1153 |
update:something with:aParameter from:changedObject |
0 | 1154 |
"sent when restarted after a snapIn" |
1155 |
||
1156 |
(something == #restarted) ifTrue:[ |
|
974 | 1157 |
self flushDeviceCursors |
0 | 1158 |
] |
864 | 1159 |
|
1160 |
"Created: 15.6.1996 / 15:18:47 / cg" |
|
0 | 1161 |
! ! |
1162 |
||
1140 | 1163 |
!Cursor class methodsFor:'instance creation'! |
0 | 1164 |
|
1165 |
extent:extent fromArray:array offset:offset |
|
1166 |
"create a new bitmap cursor from bits in the array argument |
|
1167 |
- ST-80 compatibility" |
|
1168 |
||
1169 |
|sourceForm| |
|
1170 |
||
1171 |
sourceForm := Form extent:extent fromArray:array offset:offset. |
|
1172 |
^ self sourceForm:sourceForm maskForm:sourceForm hotSpot:(offset negated) |
|
1173 |
! |
|
1174 |
||
1175 |
extent:extent sourceArray:sourceArray maskArray:maskArray offset:offset |
|
1176 |
"create a new bitmap cursor with mask from bits in sourceArray and |
|
1177 |
maskArray" |
|
1178 |
||
1179 |
|sourceForm maskForm| |
|
1180 |
||
1181 |
sourceForm := Form extent:extent fromArray:sourceArray offset:offset. |
|
1182 |
maskForm := Form extent:extent fromArray:maskArray offset:offset. |
|
1183 |
^ self sourceForm:sourceForm maskForm:maskForm hotSpot:(offset negated) |
|
1184 |
! |
|
1185 |
||
577 | 1186 |
fileCursorNamed:cursorName |
1187 |
"return a cursor read from the files 'cursorName_bits.bit' and |
|
1188 |
'cursorName_mask.bit' - return nil if file does not exist" |
|
1189 |
||
1190 |
|cursorBits maskBits| |
|
1191 |
||
1140 | 1192 |
cursorBits := Image fromFile:('bitmaps/' , cursorName , '_bits.bit'). |
577 | 1193 |
cursorBits notNil ifTrue:[ |
1140 | 1194 |
maskBits := Image fromFile:('bitmaps/' , cursorName , '_mask.bit'). |
1195 |
maskBits notNil ifTrue:[ |
|
1196 |
^ self sourceForm:cursorBits maskForm:maskBits |
|
1197 |
] |
|
577 | 1198 |
]. |
1199 |
^ nil |
|
1140 | 1200 |
|
1201 |
"Modified: 1.1.1970 / 13:57:27 / cg" |
|
577 | 1202 |
! |
1203 |
||
1414 | 1204 |
fromImage:anImage |
1205 |
"return a new cursor. |
|
1206 |
Source- and (optional) mask-Bits are taken from anImage; |
|
1207 |
hotSpot is center" |
|
1208 |
||
1209 |
|mask sourceForm maskForm| |
|
1210 |
||
1211 |
anImage depth ~~ 1 ifTrue:[ |
|
1212 |
sourceForm := anImage asMonochromeFormOn:Screen current. |
|
1213 |
] ifFalse:[ |
|
1214 |
sourceForm := anImage asFormOn:Screen current. |
|
1215 |
]. |
|
1216 |
mask := anImage mask. |
|
1217 |
mask isNil ifTrue:[ |
|
1218 |
maskForm := sourceForm |
|
1219 |
] ifFalse:[ |
|
1220 |
mask depth ~~ 1 ifTrue:[ |
|
1221 |
maskForm := mask asMonochromeFormOn:Screen current. |
|
1222 |
] ifFalse:[ |
|
1223 |
maskForm := mask asFormOn:Screen current |
|
1224 |
] |
|
1225 |
]. |
|
1226 |
^ self sourceForm:sourceForm |
|
1227 |
maskForm:maskForm |
|
1228 |
hotX:(anImage width // 2) |
|
1229 |
hotY:(anImage height // 2) |
|
1230 |
||
1231 |
" |
|
1232 |
|i c| |
|
1233 |
||
1234 |
i := Image fromFile:'bitmaps/xpmBitmaps/cursors/ul_br_arrow.xpm'. |
|
1235 |
c := Cursor fromImage:i. |
|
1236 |
WindowGroup activeGroup |
|
1237 |
withCursor:c |
|
1238 |
do:[(Delay forSeconds:5)wait] |
|
1239 |
" |
|
1240 |
||
1241 |
"Modified: 4.3.1997 / 14:23:43 / cg" |
|
1242 |
! |
|
1243 |
||
577 | 1244 |
imageArray:imageBits maskArray:maskBits |
1245 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1246 |
||
1247 |
"name is ignored ..." |
|
1248 |
||
1249 |
^ self imageArray:imageBits maskArray:maskBits hotSpot:8@8 |
|
1250 |
! |
|
1251 |
||
1252 |
imageArray:imageBits maskArray:maskBits hotSpot:hot |
|
1253 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1254 |
||
1255 |
^ self |
|
1256 |
extent:16@16 |
|
1257 |
sourceArray:imageBits |
|
1258 |
maskArray:maskBits |
|
1259 |
offset:hot negated |
|
1260 |
||
1261 |
" |
|
1262 |
|cursor| |
|
1263 |
||
1264 |
cursor := Cursor |
|
1265 |
imageArray: #( |
|
1266 |
2r0000000000000000 |
|
1267 |
2r0000000100001110 |
|
1268 |
2r0000000100001110 |
|
1269 |
2r0000000100001110 |
|
1270 |
2r0000000100000000 |
|
1271 |
2r0000000100000000 |
|
1272 |
2r0000000100000000 |
|
1273 |
2r0111111111111110 |
|
1274 |
2r0000000100000000 |
|
1275 |
2r0000000100000000 |
|
1276 |
2r0000000100000000 |
|
1277 |
2r0000000100000000 |
|
1278 |
2r0000000100000000 |
|
1279 |
2r0000000100000000 |
|
1280 |
2r0000000100000000 |
|
1281 |
2r0000000000000000) |
|
1282 |
maskArray: #( |
|
1283 |
2r0000001110011111 |
|
1284 |
2r0000001110011111 |
|
1285 |
2r0000001110011111 |
|
1286 |
2r0000001110011111 |
|
1287 |
2r0000001110011111 |
|
1288 |
2r0000001110000000 |
|
1289 |
2r1111111111111111 |
|
1290 |
2r1111111111111111 |
|
1291 |
2r1111111111111111 |
|
1292 |
2r0000001110000000 |
|
1293 |
2r0000001110000000 |
|
1294 |
2r0000001110000000 |
|
1295 |
2r0000001110000000 |
|
1296 |
2r0000001110000000 |
|
1297 |
2r0000001110000000 |
|
1298 |
2r0000001110000000) |
|
1299 |
hotSpot: 8@8. |
|
1300 |
||
1301 |
WindowGroup activeGroup |
|
1302 |
withCursor:cursor |
|
1303 |
do:[(Delay forSeconds:10)wait] |
|
1304 |
" |
|
1305 |
! |
|
1306 |
||
1307 |
imageArray:imageBits maskArray:maskBits hotSpot:hot name:aString |
|
1308 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1309 |
||
1310 |
"name is ignored ..." |
|
1311 |
||
1312 |
^ self imageArray:imageBits maskArray:maskBits hotSpot:hot |
|
1313 |
! |
|
1314 |
||
1315 |
shape:aShape |
|
1316 |
"return one of the standard cursors. |
|
1317 |
Each display may offer different shapes - see for example XWorkstation |
|
1318 |
for details (however a basic minimum set should be supported by all)" |
|
1319 |
||
1320 |
|newCursor| |
|
1321 |
||
1322 |
"first look if not already known" |
|
1323 |
Lobby isNil ifTrue:[ |
|
1324 |
self initialize |
|
1325 |
]. |
|
1326 |
Lobby do:[:aCursor | |
|
1327 |
(aCursor shape == aShape) ifTrue:[ |
|
1328 |
^ aCursor |
|
1329 |
] |
|
1330 |
]. |
|
1331 |
newCursor := self basicNew setShape:aShape. |
|
1332 |
Lobby register:newCursor. |
|
1333 |
^ newCursor |
|
1334 |
! |
|
1335 |
||
1336 |
shape:aShape on:aDevice |
|
1337 |
"return one of the standard cursors already associated to aDevice. |
|
1338 |
This is the same as '(Cursor shape:aShape) on:aDevice' but somwehat faster." |
|
1339 |
||
1340 |
|newCursor oldCursor| |
|
1341 |
||
1342 |
"first look if not already known" |
|
1343 |
Lobby isNil ifTrue:[ |
|
974 | 1344 |
self initialize |
577 | 1345 |
]. |
1346 |
Lobby do:[:aCursor | |
|
974 | 1347 |
(aCursor shape == aShape) ifTrue:[ |
1348 |
(aCursor graphicsDevice == aDevice) ifTrue:[^ aCursor]. |
|
1349 |
oldCursor := aCursor |
|
1350 |
]. |
|
577 | 1351 |
]. |
1352 |
||
1353 |
"found one with same shape, but different device" |
|
1354 |
oldCursor notNil ifTrue:[ |
|
974 | 1355 |
^ oldCursor newOn:aDevice |
577 | 1356 |
]. |
1357 |
||
1358 |
newCursor := self basicNew setShape:aShape. |
|
1359 |
Lobby register:newCursor. |
|
1360 |
^ newCursor |
|
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1361 |
|
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1362 |
"Modified: 5.7.1996 / 17:58:06 / cg" |
577 | 1363 |
! |
1364 |
||
0 | 1365 |
sourceForm:aForm |
1366 |
"return a new cursor. |
|
1367 |
Source- and mask-Bits are taken from aForm; hotSpot is center" |
|
1368 |
||
1369 |
^ self sourceForm:aForm |
|
80 | 1370 |
maskForm:aForm |
1371 |
hotX:(aForm width // 2) |
|
1372 |
hotY:(aForm height // 2) |
|
0 | 1373 |
! |
1374 |
||
1375 |
sourceForm:sourceForm maskForm:maskForm |
|
1376 |
"return a new cursor. hotSpot is center" |
|
1377 |
||
1378 |
^ self sourceForm:sourceForm |
|
80 | 1379 |
maskForm:maskForm |
1380 |
hotX:(sourceForm width // 2) |
|
1381 |
hotY:(sourceForm height // 2) |
|
0 | 1382 |
! |
1383 |
||
1384 |
sourceForm:sourceForm maskForm:maskForm hotSpot:aPoint |
|
1385 |
"return a new cursor" |
|
1386 |
||
1387 |
^ self sourceForm:sourceForm |
|
80 | 1388 |
maskForm:maskForm |
1389 |
hotX:(aPoint x) |
|
1390 |
hotY:(aPoint y) |
|
0 | 1391 |
! |
1392 |
||
1393 |
sourceForm:sourceForm maskForm:maskForm hotX:hotX hotY:hotY |
|
1394 |
"return a new cursor" |
|
1395 |
||
1396 |
|newCursor| |
|
1397 |
||
1398 |
"first look if not already known" |
|
223 | 1399 |
Lobby isNil ifTrue:[ |
499 | 1400 |
self initialize |
223 | 1401 |
]. |
115 | 1402 |
Lobby do:[:aCursor | |
80 | 1403 |
(aCursor sourceForm == sourceForm) ifTrue:[ |
1404 |
(aCursor maskForm == maskForm) ifTrue:[ |
|
1405 |
(aCursor hotX == hotX) ifTrue:[ |
|
1406 |
(aCursor hotY == hotY) ifTrue:[ |
|
1407 |
^ aCursor |
|
1408 |
] |
|
1409 |
] |
|
1410 |
] |
|
1411 |
] |
|
0 | 1412 |
]. |
35 | 1413 |
(sourceForm isNil or:[maskForm isNil]) ifTrue:[^ nil]. |
1414 |
||
2 | 1415 |
newCursor := self basicNew setSourceForm:sourceForm |
80 | 1416 |
maskForm:maskForm |
1417 |
hotX:hotX |
|
1418 |
hotY:hotY. |
|
23 | 1419 |
Lobby register:newCursor. |
0 | 1420 |
^ newCursor |
577 | 1421 |
! ! |
1422 |
||
1224
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1423 |
!Cursor class methodsFor:'cleanup'! |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1424 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1425 |
releaseResourcesOnDevice:aDevice |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1426 |
"this is sent when a display connection is closed, |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1427 |
to release all cached Cursors from that device" |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1428 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1429 |
Lobby unregisterAllForWhich:[:aCursor | aCursor graphicsDevice == aDevice] |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1430 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1431 |
"Created: 16.1.1997 / 16:43:59 / cg" |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1432 |
! ! |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1433 |
|
1140 | 1434 |
!Cursor class methodsFor:'default access'! |
577 | 1435 |
|
1436 |
defaultFgColor:fgColor defaultBgColor:bgColor |
|
1437 |
"set the default colors used for cursors" |
|
1438 |
||
1439 |
DefaultFgColor := fgColor. |
|
1440 |
DefaultBgColor := bgColor |
|
0 | 1441 |
! ! |
1442 |
||
1140 | 1443 |
!Cursor class methodsFor:'standard cursors'! |
0 | 1444 |
|
1445 |
arrow |
|
1446 |
"return an arrow (up-left-arrow) cursor" |
|
1447 |
||
71 | 1448 |
^ self shape:#upLeftArrow on:Display |
0 | 1449 |
! |
1450 |
||
577 | 1451 |
blank |
1452 |
"Answer the instance of me that is an invisible cursor." |
|
0 | 1453 |
|
577 | 1454 |
^BlankCursor! |
80 | 1455 |
|
1456 |
bottomLeft |
|
1457 |
"return a bottom-left corner cursor" |
|
1458 |
||
1459 |
^ self shape:#bottomLeft on:Display |
|
1460 |
! |
|
1461 |
||
1462 |
bottomRight |
|
1463 |
"return a bottom-right corner cursor" |
|
1464 |
||
1465 |
^ self corner |
|
1466 |
! |
|
1467 |
||
577 | 1468 |
caret |
1469 |
"return a caret cursor" |
|
1470 |
||
1471 |
^ CaretCursor! |
|
1472 |
||
1473 |
corner |
|
1474 |
"return a corner cursor" |
|
80 | 1475 |
|
577 | 1476 |
CornerCursor isNil ifTrue:[ |
1477 |
CornerCursor := self shape:#corner on:Display |
|
1478 |
]. |
|
1479 |
^ CornerCursor |
|
1480 |
! |
|
1481 |
||
1482 |
cross |
|
1483 |
"return a cross cursor" |
|
1484 |
||
1485 |
^ self shape:#cross on:Display |
|
80 | 1486 |
! |
1487 |
||
0 | 1488 |
crossHair |
1489 |
"return a crossHair cursor" |
|
1490 |
||
1491 |
CrossHairCursor isNil ifTrue:[ |
|
80 | 1492 |
CrossHairCursor := self shape:#crossHair on:Display |
0 | 1493 |
]. |
1494 |
^ CrossHairCursor |
|
1495 |
! |
|
1496 |
||
577 | 1497 |
down |
1498 |
"Answer the instance of me that is the shape of a down-arrow." |
|
0 | 1499 |
|
577 | 1500 |
^DownCursor! |
0 | 1501 |
|
577 | 1502 |
downLimitArrow |
1503 |
"return a down-arrow-to-limit cursor" |
|
0 | 1504 |
|
577 | 1505 |
^ self shape:#downLimitArrow on:Display |
0 | 1506 |
! |
1507 |
||
1508 |
execute |
|
157 | 1509 |
"return a execute cursor - (the default here is a wait-cursor)" |
0 | 1510 |
|
157 | 1511 |
XeqCursor notNil ifTrue:[ |
1512 |
^ XeqCursor |
|
1513 |
]. |
|
71 | 1514 |
^ self wait |
56 | 1515 |
! |
1516 |
||
577 | 1517 |
eye |
1518 |
"return an eye cursor" |
|
1519 |
||
1520 |
^ EyeCursor |
|
1521 |
! |
|
1522 |
||
1523 |
fourWay |
|
1524 |
"return a four-way arrow cursor" |
|
1525 |
||
1526 |
FourWayCursor isNil ifTrue:[ |
|
1527 |
FourWayCursor := self shape:#fourWay on:Display |
|
1528 |
]. |
|
1529 |
^ FourWayCursor |
|
1530 |
! |
|
1531 |
||
1532 |
hand |
|
1533 |
"return a hand cursor" |
|
1534 |
||
1535 |
HandCursor isNil ifTrue:[ |
|
1536 |
HandCursor := self shape:#upRightHand on:Display |
|
1537 |
]. |
|
1538 |
^ HandCursor |
|
1539 |
! |
|
1540 |
||
1541 |
left |
|
1542 |
"Answer the instance of me that is the shape of an arrow facing to the left." |
|
1543 |
||
1544 |
^LeftCursor! |
|
1545 |
||
1546 |
leftHand |
|
1547 |
"return a left-hand cursor" |
|
1548 |
||
1549 |
^ self shape:#leftHand |
|
1550 |
! |
|
1551 |
||
1552 |
leftLimitArrow |
|
1553 |
"return a left-arrow-to-limit cursor" |
|
1554 |
||
1555 |
^ self shape:#leftLimitArrow on:Display |
|
1556 |
! |
|
1557 |
||
1558 |
leftRightArrow |
|
1559 |
"return a left-right-arrow cursor" |
|
1560 |
||
1561 |
LeftRightArrowCursor isNil ifTrue:[ |
|
1562 |
LeftRightArrowCursor := self shape:#leftRightArrow on:Display |
|
1563 |
]. |
|
1564 |
^ LeftRightArrowCursor |
|
1565 |
! |
|
1566 |
||
1567 |
marker |
|
1568 |
"Answer the instance of me that is the shape of a horizontal arrow." |
|
1569 |
||
1570 |
^MarkerCursor! |
|
56 | 1571 |
|
577 | 1572 |
normal |
1573 |
"return the normal cursor; an arrow. |
|
1574 |
for ST-80 compatibility" |
|
1575 |
||
1576 |
NormalCursor isNil ifTrue:[ |
|
1577 |
NormalCursor := self arrow on:Display |
|
1578 |
]. |
|
1579 |
^ NormalCursor |
|
1580 |
! |
|
1581 |
||
1582 |
origin |
|
1583 |
"return an origin cursor" |
|
1584 |
||
1585 |
OriginCursor isNil ifTrue:[ |
|
1586 |
OriginCursor := self shape:#origin on:Display |
|
157 | 1587 |
]. |
577 | 1588 |
^ OriginCursor |
1589 |
! |
|
1590 |
||
1591 |
questionMark |
|
1592 |
"return a question-mark cursor" |
|
1593 |
||
1594 |
^ self shape:#questionMark on:Display |
|
1595 |
! |
|
1596 |
||
1597 |
read |
|
1598 |
"return a reading-file cursor (the default here is a wait-cursor)" |
|
1599 |
||
1600 |
ReadCursor notNil ifTrue:[ |
|
1601 |
^ ReadCursor |
|
1602 |
]. |
|
1603 |
^ self wait |
|
1604 |
! |
|
1605 |
||
1606 |
right |
|
1607 |
"Answer the instance of me that is the shape of an arrow facing to the right." |
|
1608 |
||
1609 |
^RightCursor! |
|
1610 |
||
1611 |
rightLimitArrowOn |
|
1612 |
"return a right-arrow-to-limit cursor" |
|
1613 |
||
1614 |
^ self shape:#rightLimitArrow on:Display |
|
1615 |
! |
|
1616 |
||
1617 |
stop |
|
1618 |
"return a stop cursor (the default here is a wait-cursor)" |
|
1619 |
||
1620 |
StopCursor notNil ifTrue:[ |
|
1621 |
^ StopCursor |
|
1622 |
]. |
|
1623 |
^ self wait |
|
1624 |
! |
|
1625 |
||
1626 |
text |
|
1627 |
"return a text-cursor" |
|
1628 |
||
1629 |
^ self shape:#text on:Display |
|
56 | 1630 |
! |
1631 |
||
1632 |
thumbsDown |
|
1633 |
"return a hand cursor - ST-80 compatibility" |
|
1634 |
||
157 | 1635 |
ThumbsDownCursor notNil ifTrue:[ |
1636 |
^ ThumbsDownCursor |
|
1637 |
]. |
|
56 | 1638 |
^ self hand |
577 | 1639 |
! |
1640 |
||
1641 |
thumbsUp |
|
1642 |
"return a hand cursor - ST-80 compatibility" |
|
1643 |
||
1644 |
ThumbsUpCursor notNil ifTrue:[ |
|
1645 |
^ ThumbsUpCursor |
|
1646 |
]. |
|
1647 |
^ self hand |
|
1648 |
! |
|
1649 |
||
1650 |
topLeft |
|
1651 |
"return a top-left corner cursor" |
|
0 | 1652 |
|
577 | 1653 |
^ self origin |
1654 |
! |
|
1655 |
||
1656 |
topRight |
|
1657 |
"return a top-right corner cursor" |
|
1658 |
||
1659 |
^ self shape:#topRight on:Display |
|
1660 |
! |
|
1661 |
||
1662 |
up |
|
1663 |
"Answer the instance of me that is the shape of an up-arrow." |
|
1664 |
||
1665 |
^UpCursor! |
|
71 | 1666 |
|
577 | 1667 |
upDownArrow |
1668 |
"return an up-down-arrow cursor" |
|
1669 |
||
1670 |
UpDownArrowCursor isNil ifTrue:[ |
|
1671 |
UpDownArrowCursor := self shape:#upDownArrow on:Display |
|
1672 |
]. |
|
1673 |
^ UpDownArrowCursor |
|
1674 |
! |
|
1675 |
||
1676 |
upLeftArrow |
|
1677 |
"return an up-right-arrow cursor" |
|
1678 |
||
1679 |
^ self shape:#upLeftArrow on:Display |
|
1680 |
! |
|
71 | 1681 |
|
577 | 1682 |
upLimitArrow |
1683 |
"return an up-arrow-to-limit cursor" |
|
1684 |
||
1685 |
^ self shape:#upLimitArrow on:Display |
|
1686 |
! |
|
0 | 1687 |
|
577 | 1688 |
upRightArrow |
1689 |
"return an up-right-arrow cursor" |
|
1690 |
||
1691 |
^ self shape:#upRightArrow on:Display |
|
1692 |
! |
|
1693 |
||
1694 |
upRightHand |
|
1695 |
"return an up-right-hand cursor" |
|
1696 |
||
1697 |
^ self shape:#upRightHand |
|
71 | 1698 |
! |
1699 |
||
577 | 1700 |
wait |
1701 |
"return a wait cursor" |
|
1702 |
||
1703 |
WaitCursor isNil ifTrue:[ |
|
1704 |
WaitCursor := self shape:#wait on:Display |
|
1705 |
]. |
|
1706 |
^ WaitCursor |
|
1707 |
! |
|
1708 |
||
1709 |
write |
|
1710 |
"return a writing-file cursor (the default here is a wait-cursor)" |
|
0 | 1711 |
|
577 | 1712 |
WriteCursor notNil ifTrue:[ |
1713 |
^ WriteCursor |
|
1714 |
]. |
|
1715 |
^ self wait |
|
1716 |
! |
|
1717 |
||
1718 |
xMarker |
|
1719 |
"Answer the instance of me that is displayed when thumb-scrolling on the x-axis." |
|
1720 |
||
1721 |
^XMarkerCursor! ! |
|
1722 |
||
1723 |
!Cursor methodsFor:'ST-80 displaying'! |
|
1724 |
||
1725 |
displayOn:aGC at:origin clippingBox:aRectangle rule:aRule mask:aMask |
|
1726 |
"ST-80 compatibility; |
|
1727 |
limited functionality: can only display bitmap cursors (yet)" |
|
1728 |
||
1729 |
sourceForm notNil ifTrue:[ |
|
1730 |
sourceForm displayOn:aGC at:origin clippingBox:aRectangle |
|
1731 |
rule:aRule mask:aMask |
|
0 | 1732 |
] |
2 | 1733 |
! |
1734 |
||
577 | 1735 |
show |
1736 |
"ST-80 mimicri: change cursors in active groups views to the receiver." |
|
2 | 1737 |
|
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1738 |
|wg| |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1739 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1740 |
(wg := WindowGroup activeGroup) notNil ifTrue:[ |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1741 |
wg showCursor:self |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1742 |
] |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1743 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1744 |
"Modified: 13.1.1997 / 20:10:01 / cg" |
577 | 1745 |
! |
1746 |
||
1747 |
showIn:aView |
|
1748 |
"ST-80 mimicri: install the receiver as aViews cursor" |
|
1749 |
||
1750 |
aView cursor:self |
|
2 | 1751 |
! |
1752 |
||
577 | 1753 |
showIn:aView while:aBlock |
1754 |
"ST-80 mimicri: change aViews cursors to the receiver, while evaluationg aBlock. |
|
1755 |
Return the value as returned by aBlock." |
|
1756 |
||
1757 |
|savedCursor| |
|
1758 |
||
1759 |
savedCursor := aView cursor. |
|
1760 |
aView cursor:self. |
|
1761 |
^ aBlock valueNowOrOnUnwindDo:[aView cursor:savedCursor] |
|
1762 |
! |
|
2 | 1763 |
|
577 | 1764 |
showWhile:aBlock |
1765 |
"ST-80 mimicri: change all views cursors to the receiver. |
|
1766 |
Return the value as returned by aBlock." |
|
1767 |
||
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1768 |
|wg| |
577 | 1769 |
|
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1770 |
(wg := WindowGroup activeGroup) notNil ifTrue:[ |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1771 |
^ wg withCursor:self do:aBlock |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1772 |
] ifFalse:[ |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1773 |
aBlock value |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1774 |
] |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1775 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
1776 |
"Modified: 13.1.1997 / 20:10:25 / cg" |
2 | 1777 |
! ! |
1778 |
||
0 | 1779 |
!Cursor methodsFor:'accessing'! |
1780 |
||
577 | 1781 |
device |
1782 |
"return the device I am associated with" |
|
1783 |
||
1784 |
^ device |
|
1785 |
! |
|
1786 |
||
1787 |
foreground:fgColor background:bgColor |
|
1788 |
"set the cursor colors" |
|
1789 |
||
1790 |
device colorCursor:cursorId foreground:fgColor background:bgColor |
|
1791 |
! |
|
1792 |
||
733 | 1793 |
graphicsDevice |
1794 |
"same as #device, for ST-80 compatibility naming. |
|
1795 |
Return the device I am associated with." |
|
1796 |
||
1797 |
^ device |
|
1798 |
||
1799 |
"Created: 28.5.1996 / 18:39:01 / cg" |
|
1800 |
! |
|
1801 |
||
577 | 1802 |
hotX |
1803 |
"return the hotspots x-coordinate of the receiver" |
|
1804 |
||
1805 |
^ hotX |
|
1806 |
! |
|
1807 |
||
1808 |
hotY |
|
1809 |
"return the hotspots y-coordinate of the receiver" |
|
1810 |
||
1811 |
^ hotY |
|
1812 |
! |
|
1813 |
||
0 | 1814 |
id |
1815 |
"return the cursors deviceId" |
|
1816 |
||
1817 |
^ cursorId |
|
1818 |
! |
|
1819 |
||
577 | 1820 |
maskForm |
1821 |
"return the mask-form of the receiver" |
|
0 | 1822 |
|
577 | 1823 |
^ maskForm |
1824 |
! |
|
1825 |
||
1826 |
maskForm:aForm |
|
1827 |
"set the mask-form of the receiver" |
|
1828 |
||
1829 |
maskForm := aForm |
|
0 | 1830 |
! |
1831 |
||
1832 |
shape |
|
1833 |
"return the shape" |
|
1834 |
||
1835 |
^ shape |
|
1836 |
! |
|
1837 |
||
1838 |
sourceForm |
|
1839 |
"return the source-form of the receiver" |
|
1840 |
||
1841 |
^ sourceForm |
|
1842 |
! |
|
1843 |
||
1844 |
sourceForm:aForm |
|
1845 |
"set the source-form of the receiver" |
|
1846 |
||
1847 |
sourceForm := aForm |
|
577 | 1848 |
! ! |
0 | 1849 |
|
577 | 1850 |
!Cursor methodsFor:'copying'! |
0 | 1851 |
|
577 | 1852 |
postCopy |
1853 |
sourceForm := sourceForm copy. |
|
1854 |
maskForm := maskForm copy. |
|
1855 |
device := cursorId := nil |
|
0 | 1856 |
! ! |
1857 |
||
1858 |
!Cursor methodsFor:'creating a device cursor'! |
|
1859 |
||
1860 |
on:aDevice |
|
1861 |
"create a new Cursor representing the same cursor as |
|
1862 |
myself on aDevice; if one already exists, return the one" |
|
1863 |
||
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1864 |
self obsoleteMethodWarning:'use #onDevice:'. |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1865 |
^ self onDevice:aDevice |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1866 |
|
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1867 |
"Modified: 28.3.1997 / 13:47:02 / cg" |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1868 |
! |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1869 |
|
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1870 |
onDevice:aDevice |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1871 |
"create a new Cursor representing the same cursor as |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1872 |
myself on aDevice; if one already exists, return the one" |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1873 |
|
0 | 1874 |
aDevice isNil ifTrue:[ |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1875 |
"this may not happen" |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1876 |
self error:'nil device' |
0 | 1877 |
]. |
1878 |
||
71 | 1879 |
"if I am already assigned to that device ..." |
0 | 1880 |
(device == aDevice) ifTrue:[^ self]. |
1881 |
||
1882 |
"first look if not already there" |
|
115 | 1883 |
Lobby do:[:aCursor | |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1884 |
(aCursor graphicsDevice == aDevice) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1885 |
shape notNil ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1886 |
(aCursor shape == shape) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1887 |
^ aCursor |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1888 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1889 |
] ifFalse:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1890 |
(aCursor sourceForm == sourceForm) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1891 |
(aCursor maskForm == maskForm) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1892 |
(aCursor hotX == hotX) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1893 |
(aCursor hotY == hotY) ifTrue:[ |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1894 |
^ aCursor |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1895 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1896 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1897 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1898 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1899 |
] |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1900 |
] |
0 | 1901 |
]. |
71 | 1902 |
^ self newOn:aDevice |
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1903 |
|
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1904 |
"Modified: 5.7.1996 / 17:58:00 / cg" |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
1905 |
"Created: 28.3.1997 / 13:46:38 / cg" |
71 | 1906 |
! ! |
1907 |
||
577 | 1908 |
!Cursor methodsFor:'instance release'! |
1909 |
||
1910 |
disposed |
|
1911 |
"some Cursor has been collected - tell it to the x-server" |
|
1912 |
||
1913 |
cursorId notNil ifTrue:[ |
|
1914 |
device destroyCursor:cursorId. |
|
1915 |
] |
|
1916 |
! |
|
1917 |
||
1918 |
shallowCopyForFinalization |
|
1919 |
"redefined to return a lightweight copy |
|
1920 |
- all we need is the device handle" |
|
1921 |
||
1922 |
^ self class basicNew setDevice:device id:cursorId |
|
1923 |
||
1924 |
"Modified: 20.4.1996 / 23:23:19 / cg" |
|
1925 |
! ! |
|
1926 |
||
71 | 1927 |
!Cursor methodsFor:'private'! |
1928 |
||
577 | 1929 |
device:aDevice |
1930 |
device := aDevice |
|
1931 |
! |
|
1932 |
||
1933 |
id:anId |
|
1934 |
"set the cursors deviceId" |
|
1935 |
||
1936 |
cursorId := anId |
|
1937 |
! |
|
1938 |
||
71 | 1939 |
newOn:aDevice |
1940 |
"create a new Cursor representing the same cursor as |
|
1941 |
myself on aDevice. Dont search the lobby." |
|
1942 |
||
974 | 1943 |
|newCursor id sF mF w h| |
0 | 1944 |
|
1945 |
"ask that device for the cursor" |
|
1946 |
shape notNil ifTrue:[ |
|
1140 | 1947 |
id := aDevice createCursorShape:shape. |
1948 |
id isNil ifTrue:[ |
|
1178
f04f14bc3c46
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1140
diff
changeset
|
1949 |
'Cursor [warning]: no cursor with shape:' errorPrint. shape errorPrintCR. |
1140 | 1950 |
^ self |
1951 |
]. |
|
0 | 1952 |
] ifFalse:[ |
1140 | 1953 |
aDevice needDeviceFormsForCursor ifTrue:[ |
1954 |
sourceForm notNil ifTrue:[ |
|
1955 |
sF := sourceForm asFormOn:aDevice. |
|
1956 |
]. |
|
1957 |
maskForm notNil ifTrue:[ |
|
1958 |
mF := maskForm asFormOn:aDevice. |
|
1959 |
]. |
|
1960 |
(sF notNil and:[mF notNil]) ifTrue:[ |
|
1961 |
sourceForm := sF. |
|
1962 |
maskForm := mF. |
|
1963 |
]. |
|
1964 |
] ifFalse:[ |
|
1965 |
sourceForm notNil ifTrue:[ |
|
1966 |
sF := sourceForm bits |
|
1967 |
]. |
|
1968 |
maskForm notNil ifTrue:[ |
|
1969 |
mF := maskForm bits. |
|
1970 |
]. |
|
1971 |
]. |
|
1972 |
(sF isNil or:[mF isNil]) ifTrue:[ |
|
1181 | 1973 |
'Cursor [warning]: cursor has no form' errorPrintCR. |
1140 | 1974 |
^ self |
1975 |
]. |
|
1976 |
w := sourceForm width. |
|
1977 |
h := sourceForm height. |
|
133 | 1978 |
|
1140 | 1979 |
id := aDevice createCursorSourceForm:sF |
1980 |
maskForm:mF |
|
1981 |
hotX:hotX |
|
1982 |
hotY:hotY |
|
1983 |
width:w |
|
1984 |
height:h. |
|
1985 |
id isNil ifTrue:[ |
|
1178
f04f14bc3c46
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1140
diff
changeset
|
1986 |
'Cursor [warning]: cannot create pixmap cursor' errorPrintCR. |
1140 | 1987 |
^ self |
1988 |
]. |
|
0 | 1989 |
]. |
1990 |
||
1991 |
"goody for IRIXs red cursor" |
|
1992 |
DefaultFgColor notNil ifTrue:[ |
|
1140 | 1993 |
aDevice colorCursor:id foreground:DefaultFgColor |
1994 |
background:DefaultBgColor |
|
0 | 1995 |
]. |
1996 |
||
1997 |
device isNil ifTrue:[ |
|
1140 | 1998 |
"receiver was not associated - do it now" |
1999 |
device := aDevice. |
|
2000 |
cursorId := id. |
|
0 | 2001 |
|
1140 | 2002 |
"must re-register, the old registration had a nil cursorId in it" |
2003 |
Lobby registerChange:self. |
|
2004 |
^ self |
|
0 | 2005 |
]. |
2006 |
||
2007 |
"receiver was already associated to another device - need a new cursor" |
|
2 | 2008 |
newCursor := self class basicNew. |
0 | 2009 |
shape notNil ifTrue:[ |
1140 | 2010 |
newCursor setShape:shape. |
0 | 2011 |
] ifFalse:[ |
1140 | 2012 |
newCursor setSourceForm:sourceForm |
2013 |
maskForm:maskForm |
|
2014 |
hotX:hotX |
|
2015 |
hotY:hotY |
|
0 | 2016 |
]. |
2 | 2017 |
newCursor setDevice:aDevice id:id. |
23 | 2018 |
Lobby register:newCursor. |
0 | 2019 |
^ newCursor |
1140 | 2020 |
|
1181 | 2021 |
"Modified: 10.1.1997 / 19:08:20 / cg" |
71 | 2022 |
! |
0 | 2023 |
|
2 | 2024 |
restored |
0 | 2025 |
"set both device and id" |
2026 |
||
2027 |
device := nil. |
|
2028 |
cursorId := nil |
|
2029 |
! ! |
|
2030 |
||
577 | 2031 |
!Cursor methodsFor:'private accessing'! |
0 | 2032 |
|
577 | 2033 |
setDevice:aDevice id:anId |
2034 |
"set the device and deviceId of the receiver" |
|
160 | 2035 |
|
577 | 2036 |
device := aDevice. |
2037 |
cursorId := anId |
|
0 | 2038 |
! |
2039 |
||
577 | 2040 |
setShape:aShapeSymbol |
2041 |
"set the shape" |
|
160 | 2042 |
|
577 | 2043 |
shape := aShapeSymbol. |
0 | 2044 |
! |
2045 |
||
577 | 2046 |
setSourceForm:sForm maskForm:mForm hotX:hx hotY:hy |
2047 |
"set the forms and hotspot" |
|
0 | 2048 |
|
577 | 2049 |
sourceForm := sForm. |
2050 |
maskForm := mForm. |
|
2051 |
hotX := hx. |
|
2052 |
hotY := hy. |
|
2053 |
! ! |
|
157 | 2054 |
|
1140 | 2055 |
!Cursor class methodsFor:'documentation'! |
0 | 2056 |
|
577 | 2057 |
version |
1495 | 2058 |
^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.48 1997-03-28 15:02:32 cg Exp $' |
0 | 2059 |
! ! |
577 | 2060 |
Cursor initialize! |