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