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