author | Claus Gittinger <cg@exept.de> |
Mon, 27 Jul 1998 20:22:45 +0200 | |
changeset 2194 | 9a1006b2d9de |
parent 2121 | 376a0d47257a |
child 2362 | e391d80efdb5 |
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 |
|
2121
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
20 |
LeftCursor RightCursor XMarkerCursor CaretCursor |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
21 |
UpRightHandCursor DocumentCursor FolderCursor' |
577 | 22 |
poolDictionaries:'' |
23 |
category:'Graphics-Support' |
|
0 | 24 |
! |
25 |
||
1140 | 26 |
!Cursor class methodsFor:'documentation'! |
0 | 27 |
|
46 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 1992 by Claus Gittinger |
|
80 | 31 |
All Rights Reserved |
46 | 32 |
|
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
0 | 42 |
documentation |
38 | 43 |
" |
44 |
I represents cursors in a device independent manner. |
|
144 | 45 |
Normally, cursors are defined at view creation time, |
601 | 46 |
via |
1929 | 47 |
'aView cursor:aCursor'. |
601 | 48 |
|
49 |
[Instance variables:] |
|
0 | 50 |
|
1929 | 51 |
shape <Symbol> a shape (i.e. #arrow, #hand, ...) or nil |
52 |
sourceForm <Form> if shape is nil, the source bits |
|
53 |
maskForm <Form> if shape is nil, the mask bits |
|
54 |
hotX <SmallInteger> if shape is nil, the hotSpot x of the cursor |
|
55 |
hotY <SmallInteger> if shape is nil, the hotSpot y of the cursor |
|
56 |
device <aDevice> the device, if associated to one |
|
57 |
cursorId <anObject> the device-specific id if device is nonNil |
|
0 | 58 |
|
601 | 59 |
[class variables:] |
60 |
||
1929 | 61 |
Lobby <Registry> keeps track of known device cursors |
62 |
(dont use it: this will be moved to the device) |
|
601 | 63 |
|
1929 | 64 |
DefaultFgColor <Color> default foreground color for cursors (usually black) |
65 |
DefaultBgColor <Color> default background color for cursors (usually white) |
|
0 | 66 |
|
1929 | 67 |
NormalCursor <Cursor> cached instance of normal (arrow) cursor |
68 |
... |
|
0 | 69 |
|
601 | 70 |
[see also:] |
1929 | 71 |
DeviceWorkstation |
72 |
DisplaySurface |
|
73 |
Font Color Image Form |
|
74 |
( introduction to view programming :html: programming/viewintro.html#CURSOR ) |
|
611 | 75 |
|
76 |
[author:] |
|
1929 | 77 |
Claus Gittinger |
38 | 78 |
" |
144 | 79 |
! |
80 |
||
81 |
examples |
|
82 |
" |
|
83 |
get a standard cursor: |
|
84 |
||
1929 | 85 |
Cursor wait |
86 |
Cursor stop |
|
87 |
Cursor normal |
|
144 | 88 |
|
89 |
create a custom cursor: |
|
90 |
||
1929 | 91 |
Cursor extent:16@16 |
92 |
fromArray:#[ 2r00000000 2r00000000 |
|
93 |
2r00000000 2r00000000 |
|
94 |
2r00000000 2r00000000 |
|
95 |
2r11111111 2r11111111 |
|
96 |
2r11111111 2r11111111 |
|
97 |
2r00000000 2r00000000 |
|
98 |
2r00000000 2r00000000 |
|
99 |
2r11111111 2r11111111 |
|
100 |
2r11111111 2r11111111 |
|
101 |
2r00000000 2r00000000 |
|
102 |
2r00000000 2r00000000 |
|
103 |
2r11111111 2r11111111 |
|
104 |
2r11111111 2r11111111 |
|
105 |
2r00000000 2r00000000 |
|
106 |
2r00000000 2r00000000 |
|
107 |
2r00000000 2r00000000] |
|
1934 | 108 |
offset:-8 @ -8 |
619 | 109 |
|
110 |
||
144 | 111 |
|
112 |
define a cursor for a view: |
|
1929 | 113 |
[exBegin] |
114 |
|v| |
|
144 | 115 |
|
1929 | 116 |
v := StandardSystemView extent:100@100. |
117 |
v cursor:Cursor stop. |
|
118 |
v open. |
|
119 |
[exEnd] |
|
619 | 120 |
|
144 | 121 |
|
122 |
with above custom cursor: |
|
1929 | 123 |
[exBegin] |
124 |
|v| |
|
125 |
||
126 |
v := StandardSystemView extent:100@100. |
|
127 |
v cursor:( |
|
128 |
Cursor extent:16@16 |
|
129 |
fromArray:#[ 2r00000000 2r00000000 |
|
130 |
2r00000000 2r00000000 |
|
131 |
2r00000000 2r00000000 |
|
132 |
2r11111111 2r11111111 |
|
133 |
2r11111111 2r11111111 |
|
134 |
2r00000000 2r00000000 |
|
135 |
2r00000000 2r00000000 |
|
136 |
2r11111111 2r11111111 |
|
137 |
2r11111111 2r11111111 |
|
138 |
2r00000000 2r00000000 |
|
139 |
2r00000000 2r00000000 |
|
140 |
2r11111111 2r11111111 |
|
141 |
2r11111111 2r11111111 |
|
142 |
2r00000000 2r00000000 |
|
143 |
2r00000000 2r00000000 |
|
144 |
2r00000000 2r00000000] |
|
1934 | 145 |
offset:-8 @ -8). |
1929 | 146 |
v open. |
147 |
[exEnd] |
|
148 |
||
149 |
||
150 |
a custom cursor with mask: |
|
151 |
[exBegin] |
|
152 |
|v| |
|
144 | 153 |
|
1929 | 154 |
v := StandardSystemView extent:100@100. |
155 |
v cursor:( |
|
156 |
Cursor |
|
157 |
extent:16@16 |
|
158 |
sourceArray:#[ |
|
159 |
2r00000000 2r00000000 |
|
160 |
2r00000000 2r00000000 |
|
161 |
2r00000000 2r00000000 |
|
162 |
2r11111111 2r11111111 |
|
163 |
2r11111111 2r11111111 |
|
164 |
2r00000000 2r00000000 |
|
165 |
2r00000000 2r00000000 |
|
166 |
2r00000000 2r00000000 |
|
167 |
2r00000000 2r00000000 |
|
168 |
2r00000000 2r00000000 |
|
169 |
2r00000000 2r00000000 |
|
170 |
2r11111111 2r11111111 |
|
171 |
2r11111111 2r11111111 |
|
172 |
2r00000000 2r00000000 |
|
173 |
2r00000000 2r00000000 |
|
174 |
2r00000000 2r00000000] |
|
175 |
maskArray:#[ |
|
176 |
2r00000000 2r00000000 |
|
177 |
2r00000000 2r00000000 |
|
178 |
2r11111111 2r11111111 |
|
179 |
2r11111111 2r11111111 |
|
180 |
2r11111111 2r11111111 |
|
181 |
2r11111111 2r11111111 |
|
182 |
2r00000000 2r00000000 |
|
183 |
2r00000000 2r00000000 |
|
184 |
2r00000000 2r00000000 |
|
185 |
2r00000000 2r00000000 |
|
186 |
2r11111111 2r11111111 |
|
187 |
2r11111111 2r11111111 |
|
188 |
2r11111111 2r11111111 |
|
189 |
2r11111111 2r11111111 |
|
190 |
2r00000000 2r00000000 |
|
191 |
2r00000000 2r00000000] |
|
1934 | 192 |
offset:-8 @ -8). |
1929 | 193 |
v open. |
194 |
[exEnd] |
|
195 |
||
196 |
||
197 |
a cursor from an image read from a file: |
|
198 |
[exBegin] |
|
199 |
|v img| |
|
200 |
||
201 |
v := StandardSystemView extent:100@100. |
|
202 |
img := Image fromFile:'bitmaps/xpmBitmaps/cursors/mouse.xpm'. |
|
203 |
v cursor:(Cursor fromImage:img). |
|
204 |
v open. |
|
205 |
[exEnd] |
|
619 | 206 |
|
144 | 207 |
|
208 |
with multiple views: |
|
1929 | 209 |
[exBegin] |
210 |
|v1 v2 top| |
|
144 | 211 |
|
1929 | 212 |
top := StandardSystemView new. |
213 |
top extent:300@300. |
|
214 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
215 |
v1 viewBackground:(Color grey:75). |
|
216 |
v1 cursor:Cursor thumbsUp. |
|
217 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
|
218 |
v2 viewBackground:(Color white). |
|
219 |
v2 cursor:Cursor wait. |
|
220 |
top open. |
|
221 |
[exEnd] |
|
144 | 222 |
|
223 |
||
702 | 224 |
show a cursor (in the active ST/X view) for a while: |
1929 | 225 |
[exBegin] |
619 | 226 |
|
1929 | 227 |
Cursor wait |
228 |
showWhile:[ |
|
229 |
Delay waitForSeconds:5 |
|
230 |
] |
|
231 |
[exEnd] |
|
144 | 232 |
|
233 |
||
151 | 234 |
show a cursor in all views belonging to a windowGroup: |
235 |
(have to wait until top is visible to access windowGroup) |
|
1929 | 236 |
[exBegin] |
237 |
|v1 v2 top| |
|
151 | 238 |
|
1929 | 239 |
top := StandardSystemView new. |
240 |
top extent:300@300. |
|
241 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
242 |
v1 viewBackground:(Color grey:75). |
|
243 |
v1 cursor:(Cursor normal). |
|
702 | 244 |
|
1929 | 245 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
246 |
v2 viewBackground:(Color white). |
|
247 |
v2 cursor:(Cursor crossHair). |
|
248 |
top openAndWait. |
|
151 | 249 |
|
1929 | 250 |
Delay waitForSeconds:3. |
151 | 251 |
|
1929 | 252 |
top windowGroup |
253 |
withCursor:Cursor wait |
|
254 |
do:[ |
|
255 |
Delay waitForSeconds:5 |
|
256 |
] |
|
257 |
[exEnd] |
|
151 | 258 |
|
259 |
||
144 | 260 |
show a cursor in a single view for a while: |
1929 | 261 |
[exBegin] |
262 |
|v1 v2 top| |
|
144 | 263 |
|
1929 | 264 |
top := StandardSystemView new. |
265 |
top extent:300@300. |
|
266 |
v1 := View origin:0.0@0.0 corner:1.0@0.5 in:top. |
|
267 |
v1 viewBackground:(Color grey:75). |
|
268 |
v1 cursor:(Cursor normal). |
|
702 | 269 |
|
1929 | 270 |
v2 := View origin:0.0@0.5 corner:1.0@1.0 in:top. |
271 |
v2 viewBackground:(Color white). |
|
272 |
v2 cursor:(Cursor crossHair). |
|
702 | 273 |
|
1929 | 274 |
top openAndWait. |
702 | 275 |
|
1929 | 276 |
Delay waitForSeconds:3. |
144 | 277 |
|
1929 | 278 |
v1 withCursor:Cursor wait |
279 |
do:[ |
|
280 |
Delay waitForSeconds:5 |
|
281 |
] |
|
282 |
[exEnd] |
|
144 | 283 |
" |
0 | 284 |
! ! |
285 |
||
1140 | 286 |
!Cursor class methodsFor:'initialization'! |
0 | 287 |
|
288 |
flushDeviceCursors |
|
289 |
"unassign all cursors from their device" |
|
290 |
||
223 | 291 |
Lobby notNil ifTrue:[ |
499 | 292 |
Lobby do:[:aCursor | |
223 | 293 |
aCursor restored. |
294 |
Lobby registerChange:aCursor |
|
499 | 295 |
] |
0 | 296 |
] |
297 |
! |
|
298 |
||
577 | 299 |
initialize |
300 |
Lobby isNil ifTrue:[ |
|
301 |
Lobby := Registry new. |
|
302 |
||
303 |
"want to be informed when returning from snapshot" |
|
304 |
ObjectMemory addDependent:self |
|
305 |
] |
|
306 |
! |
|
307 |
||
1495 | 308 |
initializeNewCursors |
1564 | 309 |
"Create the new cursors |
1934 | 310 |
Cursor blank |
311 |
Cursor down |
|
312 |
Cursor execute |
|
313 |
Cursor left |
|
314 |
Cursor marker |
|
315 |
Cursor normal |
|
316 |
Cursor read |
|
317 |
Cursor right |
|
318 |
Cursor square |
|
319 |
Cursor up |
|
320 |
Cursor wait |
|
321 |
Cursor write |
|
322 |
Cursor thumbsUp |
|
323 |
Cursor thumbsDown |
|
324 |
Cursor xMarker |
|
325 |
Cursor caret |
|
326 |
Cursor stop |
|
327 |
Cursor eye" |
|
1495 | 328 |
|
1564 | 329 |
|device builtIn| |
1495 | 330 |
|
1564 | 331 |
device := Display. |
332 |
builtIn := device builtInCursorShapes. |
|
1495 | 333 |
|
2121
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
334 |
(builtIn includes:#folder) ifFalse:[ |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
335 |
FolderCursor := |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
336 |
(Cursor |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
337 |
extent: 16@16 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
338 |
sourceArray: #( |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
339 |
2r0000000000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
340 |
2r0011111000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
341 |
2r0100000100000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
342 |
2r1111111111111110 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
343 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
344 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
345 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
346 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
347 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
348 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
349 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
350 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
351 |
2r1000000000000001 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
352 |
2r1010101010101011 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
353 |
2r0111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
354 |
2r0000000000000000) |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
355 |
maskArray: #( |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
356 |
2r0000000000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
357 |
2r0011111000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
358 |
2r0111111100000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
359 |
2r1111111111111110 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
360 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
361 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
362 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
363 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
364 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
365 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
366 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
367 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
368 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
369 |
2r1111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
370 |
2r0111111111111111 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
371 |
2r0000000000000000) |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
372 |
offset: 0@ -3). |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
373 |
]. |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
374 |
(builtIn includes:#document) ifFalse:[ |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
375 |
DocumentCursor := |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
376 |
(Cursor |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
377 |
extent: 16@16 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
378 |
sourceArray: #( |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
379 |
2r0000000000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
380 |
2r0011111111100000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
381 |
2r0010000000110000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
382 |
2r0010000000101000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
383 |
2r0010000000111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
384 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
385 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
386 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
387 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
388 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
389 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
390 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
391 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
392 |
2r0010000000000100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
393 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
394 |
2r0000000000000000) |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
395 |
maskArray: #( |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
396 |
2r0000000000000000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
397 |
2r0011111111100000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
398 |
2r0011111111110000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
399 |
2r0011111111111000 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
400 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
401 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
402 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
403 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
404 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
405 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
406 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
407 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
408 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
409 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
410 |
2r0011111111111100 |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
411 |
2r0000000000000000) |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
412 |
offset: -2@ -1). |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
413 |
]. |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
414 |
|
1564 | 415 |
(builtIn includes:#origin) ifFalse:[ |
1934 | 416 |
OriginCursor := |
417 |
(Cursor |
|
418 |
extent: 16@16 |
|
419 |
sourceArray: #( |
|
420 |
2r0000000000000000 |
|
421 |
2r0111111111111111 |
|
422 |
2r0111111111111111 |
|
423 |
2r0110000000000000 |
|
424 |
2r0110000000000000 |
|
425 |
2r0110000000000000 |
|
426 |
2r0110000000000000 |
|
427 |
2r0110000000000000 |
|
428 |
2r0110000000000000 |
|
429 |
2r0110000000000000 |
|
430 |
2r0110000000000000 |
|
431 |
2r0110000000000000 |
|
432 |
2r0110000000000000 |
|
433 |
2r0110000000000000 |
|
434 |
2r0110000000000000 |
|
435 |
2r0110000000000000) |
|
436 |
maskArray: #( |
|
437 |
2r1111111111111111 |
|
438 |
2r1111111111111111 |
|
439 |
2r1111111111111111 |
|
440 |
2r1111111111111111 |
|
441 |
2r1111000000000000 |
|
442 |
2r1111000000000000 |
|
443 |
2r1111000000000000 |
|
444 |
2r1111000000000000 |
|
445 |
2r1111000000000000 |
|
446 |
2r1111000000000000 |
|
447 |
2r1111000000000000 |
|
448 |
2r1111000000000000 |
|
449 |
2r1111000000000000 |
|
450 |
2r1111000000000000 |
|
451 |
2r1111000000000000 |
|
452 |
2r1111000000000000) |
|
453 |
offset: -1@ -1). |
|
1564 | 454 |
]. |
1495 | 455 |
|
1564 | 456 |
(builtIn includes:#corner) ifFalse:[ |
1934 | 457 |
CornerCursor := |
458 |
(Cursor |
|
459 |
extent: 16@16 |
|
460 |
sourceArray: #( |
|
461 |
2r0000000000000110 |
|
462 |
2r0000000000000110 |
|
463 |
2r0000000000000110 |
|
464 |
2r0000000000000110 |
|
465 |
2r0000000000000110 |
|
466 |
2r0000000000000110 |
|
467 |
2r0000000000000110 |
|
468 |
2r0000000000000110 |
|
469 |
2r0000000000000110 |
|
470 |
2r0000000000000110 |
|
471 |
2r0000000000000110 |
|
472 |
2r0000000000000110 |
|
473 |
2r0000000000000110 |
|
474 |
2r1111111111111110 |
|
475 |
2r1111111111111110 |
|
476 |
2r0000000000000000) |
|
477 |
maskArray: #( |
|
478 |
2r0000000000001111 |
|
479 |
2r0000000000001111 |
|
480 |
2r0000000000001111 |
|
481 |
2r0000000000001111 |
|
482 |
2r0000000000001111 |
|
483 |
2r0000000000001111 |
|
484 |
2r0000000000001111 |
|
485 |
2r0000000000001111 |
|
486 |
2r0000000000001111 |
|
487 |
2r0000000000001111 |
|
488 |
2r0000000000001111 |
|
489 |
2r0000000000001111 |
|
490 |
2r1111111111111111 |
|
491 |
2r1111111111111111 |
|
492 |
2r1111111111111111 |
|
493 |
2r1111111111111111) |
|
494 |
offset: -14@ -14). |
|
1564 | 495 |
]. |
1495 | 496 |
|
1564 | 497 |
(builtIn includes:#read) ifFalse:[ |
1934 | 498 |
ReadCursor := (Cursor |
499 |
extent: 16@16 |
|
500 |
sourceArray: #( |
|
501 |
2r0 |
|
502 |
2r0000110000000110 |
|
503 |
2r0001001000001001 |
|
504 |
2r0001001000001001 |
|
505 |
2r0010000000010000 |
|
506 |
2r0100000000100000 |
|
507 |
2r1111101111100000 |
|
508 |
2r1000010000100000 |
|
509 |
2r1000010000100000 |
|
510 |
2r1011010110100000 |
|
511 |
2r0111101111000000 |
|
512 |
2r0000000000000000 |
|
513 |
2r0000000000000000 |
|
514 |
2r0000000000000000 |
|
515 |
2r0000000000000000 |
|
516 |
2r0000000000000000) |
|
517 |
maskArray: #( |
|
518 |
2r0001111000001111 |
|
519 |
2r0001111000011111 |
|
520 |
2r0011111000011111 |
|
521 |
2r0011100000111100 |
|
522 |
2r0111000000111000 |
|
523 |
2r1111111111110000 |
|
524 |
2r1111111111110000 |
|
525 |
2r1111111111110000 |
|
526 |
2r1111111111110000 |
|
527 |
2r1111111111110000 |
|
528 |
2r1111111111100000 |
|
529 |
2r0111111111000000 |
|
530 |
2r0000000000000000 |
|
531 |
2r0000000000000000 |
|
532 |
2r0000000000000000 |
|
533 |
2r0000000000000000) |
|
534 |
offset: -5 @ -7). |
|
1564 | 535 |
]. |
1495 | 536 |
|
1564 | 537 |
(builtIn includes:#write) ifFalse:[ |
1934 | 538 |
WriteCursor := (Cursor |
539 |
extent: 16@16 |
|
540 |
sourceArray: #( |
|
541 |
2r0000000000000110 |
|
542 |
2r0000000000001111 |
|
543 |
2r0000000000010110 |
|
544 |
2r0000000000100100 |
|
545 |
2r0000000001001000 |
|
546 |
2r0000000010010000 |
|
547 |
2r0000000100100000 |
|
548 |
2r0000001001000011 |
|
549 |
2r0000010010000010 |
|
550 |
2r0000100100000110 |
|
551 |
2r0001001000001000 |
|
552 |
2r0010010000001000 |
|
553 |
2r0111100001001000 |
|
554 |
2r0101000010111000 |
|
555 |
2r0110000110000000 |
|
556 |
2r1111111100000000) |
|
557 |
maskArray: #( |
|
558 |
2r0000000000000111 |
|
559 |
2r0000000000001111 |
|
560 |
2r0000000000011110 |
|
561 |
2r0000000000111100 |
|
562 |
2r0000000001111000 |
|
563 |
2r0000000011110000 |
|
564 |
2r0000000111100001 |
|
565 |
2r0000001111000110 |
|
566 |
2r0000011110000110 |
|
567 |
2r0000111100001110 |
|
568 |
2r0001111000001100 |
|
569 |
2r0011110001001100 |
|
570 |
2r0111100011111000 |
|
571 |
2r0111000110111000 |
|
572 |
2r0111111110000000 |
|
573 |
2r1111111100000000) |
|
574 |
offset: 0@ -15). |
|
1564 | 575 |
]. |
1495 | 576 |
|
1564 | 577 |
(builtIn includes:#wait) ifFalse:[ |
1934 | 578 |
WaitCursor := |
579 |
(Cursor |
|
580 |
extent: 16@16 |
|
581 |
sourceArray: #( |
|
582 |
2r1111111111111111 |
|
583 |
2r1000000000000001 |
|
584 |
2r0100000000000010 |
|
585 |
2r0010000000000100 |
|
586 |
2r0001110000111000 |
|
587 |
2r0000111101110000 |
|
588 |
2r0000011011100000 |
|
589 |
2r0000001111000000 |
|
590 |
2r0000001111000000 |
|
591 |
2r0000010110100000 |
|
592 |
2r0000100010010000 |
|
593 |
2r0001000110001000 |
|
594 |
2r0010001101000100 |
|
595 |
2r0100111111110010 |
|
596 |
2r1011111111111101 |
|
597 |
2r1111111111111111) |
|
598 |
maskArray: #( |
|
599 |
2r1111111111111111 |
|
600 |
2r1111111111111111 |
|
601 |
2r1111111111111111 |
|
602 |
2r0111111111111110 |
|
603 |
2r0011111111111100 |
|
604 |
2r0001111111111000 |
|
605 |
2r0000111111110000 |
|
606 |
2r0000011111100000 |
|
607 |
2r0000011111100000 |
|
608 |
2r0000111111110000 |
|
609 |
2r0001111111111000 |
|
610 |
2r0011111111111100 |
|
611 |
2r0111111111111110 |
|
612 |
2r1111111111111111 |
|
613 |
2r1111111111111111 |
|
614 |
2r1111111111111111) |
|
615 |
offset: -8@ -8). |
|
1564 | 616 |
]. |
1495 | 617 |
|
1934 | 618 |
(builtIn includes:#blank) ifFalse:[ |
619 |
BlankCursor := |
|
620 |
(Cursor |
|
621 |
extent: 16@16 |
|
622 |
fromArray: #( |
|
623 |
2r0000000000000000 |
|
624 |
2r0000000000000000 |
|
625 |
2r0000000000000000 |
|
626 |
2r0000000000000000 |
|
627 |
2r0000000000000000 |
|
628 |
2r0000000000000000 |
|
629 |
2r0000000000000000 |
|
630 |
2r0000000000000000 |
|
631 |
2r0000000000000000 |
|
632 |
2r0000000000000000 |
|
633 |
2r0000000000000000 |
|
634 |
2r0000000000000000 |
|
635 |
2r0000000000000000 |
|
636 |
2r0000000000000000 |
|
637 |
2r0000000000000000 |
|
638 |
2r0000000000000000) |
|
639 |
offset: 0@0). |
|
640 |
]. |
|
1495 | 641 |
|
1564 | 642 |
(builtIn includes:#execute) ifFalse:[ |
1934 | 643 |
XeqCursor := |
644 |
(Cursor |
|
645 |
extent: 16@16 |
|
646 |
sourceArray: #( |
|
647 |
2r1000000000010000 |
|
648 |
2r1100000000010000 |
|
649 |
2r1110000000111000 |
|
650 |
2r1111000111111111 |
|
651 |
2r1111100011000110 |
|
652 |
2r1111110001000100 |
|
653 |
2r1111111001111100 |
|
654 |
2r1111000001101100 |
|
655 |
2r1101100011000110 |
|
656 |
2r1001100010000010 |
|
657 |
2r0000110000000000 |
|
658 |
2r0000110000000000 |
|
659 |
2r0000011000000000 |
|
660 |
2r0000011000000000 |
|
661 |
2r0000001100000000 |
|
662 |
2r0000001100000000) |
|
663 |
maskArray: #( |
|
664 |
2r1100000000111000 |
|
665 |
2r1110000000111000 |
|
666 |
2r1111000111111111 |
|
667 |
2r1111100111111111 |
|
668 |
2r1111110011111111 |
|
669 |
2r1111111001111110 |
|
670 |
2r1111111101111100 |
|
671 |
2r1111100001111110 |
|
672 |
2r1101110011100111 |
|
673 |
2r1001110011000010 |
|
674 |
2r0000111000000000 |
|
675 |
2r0000111000000000 |
|
676 |
2r0000011100000000 |
|
677 |
2r0000011100000000 |
|
678 |
2r0000001110000000 |
|
679 |
2r0000001110000000) |
|
680 |
offset: 0@0). |
|
1564 | 681 |
]. |
1495 | 682 |
|
1564 | 683 |
(builtIn includes:#square) ifFalse:[ |
1934 | 684 |
SquareCursor := |
685 |
(Cursor |
|
686 |
extent: 16@16 |
|
687 |
fromArray: #( |
|
688 |
2r0000000000000000 |
|
689 |
2r0000000000000000 |
|
690 |
2r0000000000000000 |
|
691 |
2r0000000000000000 |
|
692 |
2r0000000000000000 |
|
693 |
2r0000001111000000 |
|
694 |
2r0000001111000000 |
|
695 |
2r0000001111000000 |
|
696 |
2r0000001111000000 |
|
697 |
2r0000000000000000 |
|
698 |
2r0000000000000000 |
|
699 |
2r0000000000000000 |
|
700 |
2r0000000000000000 |
|
701 |
2r0000000000000000 |
|
702 |
2r0000000000000000 |
|
703 |
2r0000000000000000) |
|
704 |
offset: -8@ -8). |
|
1564 | 705 |
]. |
1495 | 706 |
|
1564 | 707 |
(builtIn includes:#upLeftArrow) ifFalse:[ |
1934 | 708 |
NormalCursor := |
709 |
(Cursor |
|
710 |
extent: 16@16 |
|
711 |
sourceArray: #( |
|
712 |
2r1000000000000000 |
|
713 |
2r1100000000000000 |
|
714 |
2r1110000000000000 |
|
715 |
2r1111000000000000 |
|
716 |
2r1111100000000000 |
|
717 |
2r1111110000000000 |
|
718 |
2r1111111000000000 |
|
719 |
2r1111100000000000 |
|
720 |
2r1111100000000000 |
|
721 |
2r1001100000000000 |
|
722 |
2r0000110000000000 |
|
723 |
2r0000110000000000 |
|
724 |
2r0000011000000000 |
|
725 |
2r0000011000000000 |
|
726 |
2r0000001100000000 |
|
727 |
2r0000001100000000) |
|
728 |
maskArray: #( |
|
729 |
2r1100000000000000 |
|
730 |
2r1110000000000000 |
|
731 |
2r1111000000000000 |
|
732 |
2r1111100000000000 |
|
733 |
2r1111110000000000 |
|
734 |
2r1111111000000000 |
|
735 |
2r1111111100000000 |
|
736 |
2r1111110000000000 |
|
737 |
2r1111110000000000 |
|
738 |
2r1001110000000000 |
|
739 |
2r0000111000000000 |
|
740 |
2r0000111000000000 |
|
741 |
2r0000011100000000 |
|
742 |
2r0000011100000000 |
|
743 |
2r0000001110000000 |
|
744 |
2r0000001110000000) |
|
745 |
offset: 0@0). |
|
1564 | 746 |
]. |
1495 | 747 |
|
748 |
||
1564 | 749 |
(builtIn includes:#crossHair) ifFalse:[ |
1934 | 750 |
CrossHairCursor := |
751 |
(Cursor |
|
752 |
extent: 16@16 |
|
753 |
sourceArray: #( |
|
754 |
2r0000000100000000 |
|
755 |
2r0000000100000000 |
|
756 |
2r0000000100000000 |
|
757 |
2r0000000100000000 |
|
758 |
2r0000000100000000 |
|
759 |
2r0000000100000000 |
|
760 |
2r0000000100000000 |
|
761 |
2r1111111111111110 |
|
762 |
2r0000000100000000 |
|
763 |
2r0000000100000000 |
|
764 |
2r0000000100000000 |
|
765 |
2r0000000100000000 |
|
766 |
2r0000000100000000 |
|
767 |
2r0000000100000000 |
|
768 |
2r0000000100000000 |
|
769 |
2r0) |
|
770 |
maskArray: #( |
|
771 |
2r0000000110000000 |
|
772 |
2r0000000110000000 |
|
773 |
2r0000000110000000 |
|
774 |
2r0000000110000000 |
|
775 |
2r0000000110000000 |
|
776 |
2r0000000110000000 |
|
777 |
2r0000000110000000 |
|
778 |
2r1111111111111110 |
|
779 |
2r1111111111111110 |
|
780 |
2r0000000110000000 |
|
781 |
2r0000000110000000 |
|
782 |
2r0000000110000000 |
|
783 |
2r0000000110000000 |
|
784 |
2r0000000110000000 |
|
785 |
2r0000000110000000 |
|
786 |
2r0) |
|
787 |
offset: -7@ -7). |
|
1564 | 788 |
]. |
1495 | 789 |
|
1564 | 790 |
(builtIn includes:#scrollMarkerH) ifFalse:[ |
1934 | 791 |
MarkerCursor := |
792 |
Cursor |
|
793 |
extent: 16@16 |
|
794 |
sourceArray: #( |
|
795 |
2r0000000000000000 |
|
796 |
2r0000000000000000 |
|
797 |
2r0000000000000000 |
|
798 |
2r0000001000000000 |
|
799 |
2r0000001110000000 |
|
800 |
2r0000001111100000 |
|
801 |
2r0111111111111000 |
|
802 |
2r0111111111111110 |
|
803 |
2r0111111111111000 |
|
804 |
2r0000001111100000 |
|
805 |
2r0000001110000000 |
|
806 |
2r0000001000000000 |
|
807 |
2r0000000000000000 |
|
808 |
2r0000000000000000 |
|
809 |
2r0000000000000000 |
|
810 |
2r0000000000000000) |
|
811 |
maskArray: #( |
|
812 |
2r0000000000000000 |
|
813 |
2r0000000000000000 |
|
814 |
2r0000000000000000 |
|
815 |
2r0000011100000000 |
|
816 |
2r0000011111000000 |
|
817 |
2r1111111111110000 |
|
818 |
2r1111111111111100 |
|
819 |
2r1111111111111111 |
|
820 |
2r1111111111111100 |
|
821 |
2r1111111111110000 |
|
822 |
2r0000011111000000 |
|
823 |
2r0000011100000000 |
|
824 |
2r0000011000000000 |
|
825 |
2r0000000000000000 |
|
826 |
2r0000000000000000 |
|
827 |
2r0000000000000000) |
|
828 |
offset: -14@ -7. |
|
1564 | 829 |
]. |
1495 | 830 |
|
1564 | 831 |
(builtIn includes:#scrollUp) ifFalse:[ |
1934 | 832 |
UpCursor := |
833 |
Cursor |
|
834 |
extent: 16@16 |
|
835 |
sourceArray: #( |
|
836 |
2r0000000000000000 |
|
837 |
2r0100000000000000 |
|
838 |
2r0110000000000000 |
|
839 |
2r0111000000000000 |
|
840 |
2r0111100000000000 |
|
841 |
2r0111110000000000 |
|
842 |
2r0111111000000000 |
|
843 |
2r0110000000000000 |
|
844 |
2r0110000000000000 |
|
845 |
2r0110000000000000 |
|
846 |
2r0110000000000000 |
|
847 |
2r0110000000000000 |
|
848 |
2r0110000000000000 |
|
849 |
2r0110000000000000 |
|
850 |
2r0110000000000000 |
|
851 |
2r0000000000000000) |
|
852 |
maskArray: #( |
|
853 |
2r1100000000000000 |
|
854 |
2r1110000000000000 |
|
855 |
2r1111000000000000 |
|
856 |
2r1111100000000000 |
|
857 |
2r1111110000000000 |
|
858 |
2r1111111000000000 |
|
859 |
2r1111111100000000 |
|
860 |
2r1111111100000000 |
|
861 |
2r1111000000000000 |
|
862 |
2r1111000000000000 |
|
863 |
2r1111000000000000 |
|
864 |
2r1111000000000000 |
|
865 |
2r1111000000000000 |
|
866 |
2r1111000000000000 |
|
867 |
2r1111000000000000 |
|
868 |
2r1111000000000000) |
|
869 |
offset: -1@ -1. |
|
1564 | 870 |
]. |
1495 | 871 |
|
1564 | 872 |
(builtIn includes:#scrollDown) ifFalse:[ |
1934 | 873 |
DownCursor := |
874 |
Cursor |
|
875 |
extent: 16@16 |
|
876 |
sourceArray: #( |
|
877 |
2r0000000000000000 |
|
878 |
2r0000011000000000 |
|
879 |
2r0000011000000000 |
|
880 |
2r0000011000000000 |
|
881 |
2r0000011000000000 |
|
882 |
2r0000011000000000 |
|
883 |
2r0000011000000000 |
|
884 |
2r0000011000000000 |
|
885 |
2r0000011000000000 |
|
886 |
2r0111111000000000 |
|
887 |
2r0011111000000000 |
|
888 |
2r0001111000000000 |
|
889 |
2r0000111000000000 |
|
890 |
2r0000011000000000 |
|
891 |
2r0000001000000000 |
|
892 |
2r0000000000000000) |
|
893 |
maskArray: #( |
|
894 |
2r0000111100000000 |
|
895 |
2r0000111100000000 |
|
896 |
2r0000111100000000 |
|
897 |
2r0000111100000000 |
|
898 |
2r0000111100000000 |
|
899 |
2r0000111100000000 |
|
900 |
2r0000111100000000 |
|
901 |
2r0000111100000000 |
|
902 |
2r1111111100000000 |
|
903 |
2r1111111100000000 |
|
904 |
2r0111111100000000 |
|
905 |
2r0011111100000000 |
|
906 |
2r0001111100000000 |
|
907 |
2r0000111100000000 |
|
908 |
2r0000011100000000 |
|
909 |
2r0000001100000000) |
|
910 |
offset: -7@ -15. |
|
1564 | 911 |
]. |
1495 | 912 |
|
1564 | 913 |
(builtIn includes:#scrollLeft) ifFalse:[ |
1934 | 914 |
LeftCursor := |
915 |
Cursor |
|
916 |
extent: 16@16 |
|
917 |
sourceArray: #( |
|
918 |
2r0000000000000000 |
|
919 |
2r0111111111111110 |
|
920 |
2r0011111111111110 |
|
921 |
2r0001111000000000 |
|
922 |
2r0000111000000000 |
|
923 |
2r0000011000000000 |
|
924 |
2r0000001000000000 |
|
925 |
2r0000000000000000 |
|
926 |
2r0000000000000000 |
|
927 |
2r0000000000000000 |
|
928 |
2r0000000000000000 |
|
929 |
2r0000000000000000 |
|
930 |
2r0000000000000000 |
|
931 |
2r0000000000000000 |
|
932 |
2r0000000000000000 |
|
933 |
2r0000000000000000) |
|
934 |
maskArray: #( |
|
935 |
2r1111111111111111 |
|
936 |
2r1111111111111111 |
|
937 |
2r0111111111111111 |
|
938 |
2r0011111111111111 |
|
939 |
2r0001111100000000 |
|
940 |
2r0000111100000000 |
|
941 |
2r0000011100000000 |
|
942 |
2r0000001100000000 |
|
943 |
2r0000000000000000 |
|
944 |
2r0000000000000000 |
|
945 |
2r0000000000000000 |
|
946 |
2r0000000000000000 |
|
947 |
2r0000000000000000 |
|
948 |
2r0000000000000000 |
|
949 |
2r0000000000000000 |
|
950 |
2r0000000000000000) |
|
951 |
offset: -1 @ -1. |
|
1564 | 952 |
]. |
1495 | 953 |
|
1564 | 954 |
(builtIn includes:#scrollRight) ifFalse:[ |
1934 | 955 |
RightCursor := |
956 |
Cursor |
|
957 |
extent: 16@16 |
|
958 |
sourceArray: #( |
|
959 |
2r0000000000000000 |
|
960 |
2r0000000001000000 |
|
961 |
2r0000000001100000 |
|
962 |
2r0000000001110000 |
|
963 |
2r0000000001111000 |
|
964 |
2r0111111111111100 |
|
965 |
2r0111111111111110 |
|
966 |
2r0000000000000000 |
|
967 |
2r0000000000000000 |
|
968 |
2r0000000000000000 |
|
969 |
2r0000000000000000 |
|
970 |
2r0000000000000000 |
|
971 |
2r0000000000000000 |
|
972 |
2r0000000000000000 |
|
973 |
2r0000000000000000 |
|
974 |
2r0000000000000000) |
|
975 |
maskArray: #( |
|
976 |
2r0000000011000000 |
|
977 |
2r0000000011100000 |
|
978 |
2r0000000011110000 |
|
979 |
2r0000000011111000 |
|
980 |
2r1111111111111100 |
|
981 |
2r1111111111111110 |
|
982 |
2r1111111111111111 |
|
983 |
2r1111111111111111 |
|
984 |
2r0000000000000000 |
|
985 |
2r0000000000000000 |
|
986 |
2r0000000000000000 |
|
987 |
2r0000000000000000 |
|
988 |
2r0000000000000000 |
|
989 |
2r0000000000000000 |
|
990 |
2r0000000000000000 |
|
991 |
2r0000000000000000) |
|
992 |
offset: -15@ -6. |
|
1564 | 993 |
]. |
994 |
||
995 |
(builtIn includes:#scrollMarkerV) ifFalse:[ |
|
1934 | 996 |
XMarkerCursor := |
997 |
Cursor |
|
998 |
extent: 16@16 |
|
999 |
sourceArray: #( |
|
1000 |
2r0000000000000000 |
|
1001 |
2r0000000100000000 |
|
1002 |
2r0000000100000000 |
|
1003 |
2r0000001110000000 |
|
1004 |
2r0000001110000000 |
|
1005 |
2r0000011111000000 |
|
1006 |
2r0000011111000000 |
|
1007 |
2r0000111111100000 |
|
1008 |
2r0000111111100000 |
|
1009 |
2r0001111111110000 |
|
1010 |
2r0000001110000000 |
|
1011 |
2r0000001110000000 |
|
1012 |
2r0000001110000000 |
|
1013 |
2r0000001110000000 |
|
1014 |
2r0000001110000000 |
|
1015 |
2r0000000000000000) |
|
1016 |
maskArray: #( |
|
1017 |
2r0000000100000000 |
|
1018 |
2r0000001110000000 |
|
1019 |
2r0000001110000000 |
|
1020 |
2r0000011111000000 |
|
1021 |
2r0000011111000000 |
|
1022 |
2r0000111111100000 |
|
1023 |
2r0000111111100000 |
|
1024 |
2r0001111111110000 |
|
1025 |
2r0001111111110000 |
|
1026 |
2r0011111111111000 |
|
1027 |
2r0011111111111000 |
|
1028 |
2r0000011111000000 |
|
1029 |
2r0000011111000000 |
|
1030 |
2r0000011111000000 |
|
1031 |
2r0000011111000000 |
|
1032 |
2r0000011111000000) |
|
1033 |
offset: -7@ -1. |
|
1564 | 1034 |
]. |
1495 | 1035 |
|
1564 | 1036 |
(builtIn includes:#fourWay) ifFalse:[ |
1934 | 1037 |
FourWayCursor := |
1038 |
Cursor |
|
1039 |
extent: 16@16 |
|
1040 |
sourceArray: #( |
|
1041 |
2r0000000100000000 |
|
1042 |
2r0000001110000000 |
|
1043 |
2r0000011111000000 |
|
1044 |
2r0000111111100000 |
|
1045 |
2r0001001110010000 |
|
1046 |
2r0011001110011000 |
|
1047 |
2r0111111111111100 |
|
1048 |
2r1111111111111110 |
|
1049 |
2r0111111111111100 |
|
1050 |
2r0011001110011000 |
|
1051 |
2r0001001110010000 |
|
1052 |
2r0000111111100000 |
|
1053 |
2r0000011111000000 |
|
1054 |
2r0000001110000000 |
|
1055 |
2r0000000100000000 |
|
1056 |
2r0000000000000000) |
|
1057 |
maskArray: #( |
|
1058 |
2r0000001110000000 |
|
1059 |
2r0000011111000000 |
|
1060 |
2r0000111111100000 |
|
1061 |
2r0001111111110000 |
|
1062 |
2r0010111111101000 |
|
1063 |
2r0111111111111100 |
|
1064 |
2r1111111111111110 |
|
1065 |
2r1111111111111110 |
|
1066 |
2r1111111111111110 |
|
1067 |
2r0111111111111100 |
|
1068 |
2r0010111111101000 |
|
1069 |
2r0001111111110000 |
|
1070 |
2r0000111111100000 |
|
1071 |
2r0000011111000000 |
|
1072 |
2r0000001110000000 |
|
1073 |
2r0000000000000000) |
|
1074 |
offset: -7@ -7. |
|
1564 | 1075 |
]. |
1495 | 1076 |
|
1564 | 1077 |
(builtIn includes:#thumbsUp) ifFalse:[ |
1934 | 1078 |
ThumbsUpCursor := (Cursor |
1079 |
extent: 16@16 |
|
1080 |
sourceArray: #( |
|
1081 |
2r0000000000100000 |
|
1082 |
2r0000000001010000 |
|
1083 |
2r0000000010010000 |
|
1084 |
2r0000000011110000 |
|
1085 |
2r0000000100010000 |
|
1086 |
2r0000000100010000 |
|
1087 |
2r0001111100011000 |
|
1088 |
2r0010000100000110 |
|
1089 |
2r0100000000000000 |
|
1090 |
2r0111111000000000 |
|
1091 |
2r0100000000000000 |
|
1092 |
2r0111111000000000 |
|
1093 |
2r0100000000000000 |
|
1094 |
2r0011111000001110 |
|
1095 |
2r0001000000010000 |
|
1096 |
2r0001111111100000) |
|
1097 |
maskArray: #( |
|
1098 |
2r0000000000100000 |
|
1099 |
2r0000000001110000 |
|
1100 |
2r0000000011110000 |
|
1101 |
2r0000000011110000 |
|
1102 |
2r0000000111110000 |
|
1103 |
2r0000000111110000 |
|
1104 |
2r0001111111111000 |
|
1105 |
2r0011111111111110 |
|
1106 |
2r0111111111111110 |
|
1107 |
2r0111111111111110 |
|
1108 |
2r0111111111111110 |
|
1109 |
2r0111111111111110 |
|
1110 |
2r0111111111111110 |
|
1111 |
2r0011111111111110 |
|
1112 |
2r0001111111110000 |
|
1113 |
2r0001111111100000) |
|
1114 |
offset: -8@ 0). |
|
1564 | 1115 |
]. |
1495 | 1116 |
|
1564 | 1117 |
(builtIn includes:#caret) ifFalse:[ |
1934 | 1118 |
CaretCursor := (Cursor |
1119 |
extent: 16@16 |
|
1120 |
sourceArray: #( |
|
1121 |
2r0000000000000000 |
|
1122 |
2r0000000110000000 |
|
1123 |
2r0000000110000000 |
|
1124 |
2r0000001111000000 |
|
1125 |
2r0000011111100000 |
|
1126 |
2r0000011001100000 |
|
1127 |
2r0000000000000000 |
|
1128 |
2r0000000000000000 |
|
1129 |
2r0000000000000000 |
|
1130 |
2r0000000000000000 |
|
1131 |
2r0000000000000000 |
|
1132 |
2r0000000000000000 |
|
1133 |
2r0000000000000000 |
|
1134 |
2r0000000000000000 |
|
1135 |
2r0000000000000000 |
|
1136 |
2r0000000000000000) |
|
1137 |
maskArray: #( |
|
1138 |
2r0000000110000000 |
|
1139 |
2r0000001111000000 |
|
1140 |
2r0000001111100000 |
|
1141 |
2r0000011111100000 |
|
1142 |
2r0000111111110000 |
|
1143 |
2r0000111111110000 |
|
1144 |
2r0000011001100000 |
|
1145 |
2r0000000000000000 |
|
1146 |
2r0000000000000000 |
|
1147 |
2r0000000000000000 |
|
1148 |
2r0000000000000000 |
|
1149 |
2r0000000000000000 |
|
1150 |
2r0000000000000000 |
|
1151 |
2r0000000000000000 |
|
1152 |
2r0000000000000000 |
|
1153 |
2r0000000000000000) |
|
1154 |
offset: -8@0). |
|
1564 | 1155 |
]. |
1495 | 1156 |
|
1564 | 1157 |
(builtIn includes:#thumbsDown) ifFalse:[ |
1934 | 1158 |
ThumbsDownCursor := (Cursor |
1159 |
extent: 16@16 |
|
1160 |
sourceArray: #( |
|
1161 |
2r0001111111100000 |
|
1162 |
2r0001000000010000 |
|
1163 |
2r0011111000001110 |
|
1164 |
2r0100000000000000 |
|
1165 |
2r0111111000000000 |
|
1166 |
2r0100000000000000 |
|
1167 |
2r0111111000000000 |
|
1168 |
2r0100000000000000 |
|
1169 |
2r0010000100000110 |
|
1170 |
2r0001111100011000 |
|
1171 |
2r0000000100010000 |
|
1172 |
2r0000000100010000 |
|
1173 |
2r0000000011110000 |
|
1174 |
2r0000000010010000 |
|
1175 |
2r0000000001010000 |
|
1176 |
2r0000000000100000) |
|
1177 |
||
1178 |
maskArray: #( |
|
1179 |
2r0001111111100000 |
|
1180 |
2r0001111111110000 |
|
1181 |
2r0011111111111110 |
|
1182 |
2r0111111111111110 |
|
1183 |
2r0111111111111110 |
|
1184 |
2r0111111111111110 |
|
1185 |
2r0111111111111110 |
|
1186 |
2r0111111111111110 |
|
1187 |
2r0011111111111110 |
|
1188 |
2r0001111111111000 |
|
1189 |
2r0000000111110000 |
|
1190 |
2r0000000111110000 |
|
1191 |
2r0000000011110000 |
|
1192 |
2r0000000011110000 |
|
1193 |
2r0000000001110000 |
|
1194 |
2r0000000000100000) |
|
1195 |
offset: -8@ -16). |
|
1564 | 1196 |
]. |
1495 | 1197 |
|
1564 | 1198 |
(builtIn includes:#stop) ifFalse:[ |
1934 | 1199 |
StopCursor := (Cursor |
1200 |
extent: 16@16 |
|
1201 |
sourceArray: #( |
|
1202 |
2r0000000000000000 |
|
1203 |
2r0000011111000000 |
|
1204 |
2r0001111111110000 |
|
1205 |
2r0011111111111000 |
|
1206 |
2r0011111111111000 |
|
1207 |
2r0111111111111100 |
|
1208 |
2r0111111111111100 |
|
1209 |
2r0100000000000100 |
|
1210 |
2r0100000000000100 |
|
1211 |
2r0111111111111100 |
|
1212 |
2r0111111111111100 |
|
1213 |
2r0011111111111000 |
|
1214 |
2r0011111111111000 |
|
1215 |
2r0001111111110000 |
|
1216 |
2r0000011111000000 |
|
1217 |
2r0000000000000000 |
|
1218 |
) |
|
1219 |
maskArray: #( |
|
1220 |
2r0000011111000000 |
|
1221 |
2r0001111111110000 |
|
1222 |
2r0011111111111000 |
|
1223 |
2r0111111111111100 |
|
1224 |
2r0111111111111100 |
|
1225 |
2r1111111111111110 |
|
1226 |
2r1111111111111110 |
|
1227 |
2r1111111111111110 |
|
1228 |
2r1111111111111110 |
|
1229 |
2r1111111111111110 |
|
1230 |
2r1111111111111110 |
|
1231 |
2r0111111111111100 |
|
1232 |
2r0111111111111100 |
|
1233 |
2r0011111111111000 |
|
1234 |
2r0001111111110000 |
|
1235 |
2r0000011111000000 |
|
1236 |
) |
|
1237 |
offset: -8 @ -8). |
|
1564 | 1238 |
]. |
1495 | 1239 |
|
1564 | 1240 |
(builtIn includes:#eyeBullet) ifFalse:[ |
1934 | 1241 |
EyeCursor := (Cursor |
1242 |
extent: 16@16 |
|
1243 |
sourceArray: #( |
|
1244 |
2r0000000000000000 |
|
1245 |
2r0000000000000000 |
|
1246 |
2r0000000000000000 |
|
1247 |
2r0000011111000000 |
|
1248 |
2r0001111111110000 |
|
1249 |
2r0011000000011000 |
|
1250 |
2r0110001110001100 |
|
1251 |
2r1100011111000110 |
|
1252 |
2r1100011111000110 |
|
1253 |
2r0110001110001100 |
|
1254 |
2r0011000000011000 |
|
1255 |
2r0001111111110000 |
|
1256 |
2r0000011111000000 |
|
1257 |
2r0000000000000000 |
|
1258 |
2r0000000000000000 |
|
1259 |
2r0000000000000000 |
|
1260 |
) |
|
1261 |
maskArray: #( |
|
1262 |
2r0000000000000000 |
|
1263 |
2r0000000000000000 |
|
1264 |
2r0000000000000000 |
|
1265 |
2r0000011111000000 |
|
1266 |
2r0001111111110000 |
|
1267 |
2r0011111111111000 |
|
1268 |
2r0111111111111100 |
|
1269 |
2r1111111111111110 |
|
1270 |
2r1111111111111110 |
|
1271 |
2r0111111111111100 |
|
1272 |
2r0011111111111000 |
|
1273 |
2r0001111111110000 |
|
1274 |
2r0000011111000000 |
|
1275 |
2r0000000000000000 |
|
1276 |
2r0000000000000000 |
|
1277 |
2r0000000000000000 |
|
1278 |
) |
|
1279 |
offset: -8 @ -8). |
|
1564 | 1280 |
]. |
1495 | 1281 |
|
1564 | 1282 |
FourWayCursor notNil ifTrue:[FourWayCursor := FourWayCursor onDevice:device]. |
1283 |
LeftCursor notNil ifTrue:[LeftCursor := LeftCursor onDevice:device]. |
|
1284 |
RightCursor notNil ifTrue:[RightCursor := RightCursor onDevice:device]. |
|
1285 |
XMarkerCursor notNil ifTrue:[XMarkerCursor := XMarkerCursor onDevice:device]. |
|
1495 | 1286 |
|
1564 | 1287 |
OriginCursor notNil ifTrue:[OriginCursor := OriginCursor onDevice:device]. |
1288 |
CornerCursor notNil ifTrue:[CornerCursor := CornerCursor onDevice:device]. |
|
1495 | 1289 |
|
1564 | 1290 |
ReadCursor notNil ifTrue:[ReadCursor := ReadCursor onDevice:device]. |
1291 |
WriteCursor notNil ifTrue:[WriteCursor := WriteCursor onDevice:device]. |
|
1292 |
WaitCursor notNil ifTrue:[WaitCursor := WaitCursor onDevice:device]. |
|
1293 |
XeqCursor notNil ifTrue:[XeqCursor := XeqCursor onDevice:device]. |
|
1495 | 1294 |
|
1564 | 1295 |
SquareCursor notNil ifTrue:[SquareCursor := SquareCursor onDevice:device]. |
1296 |
||
1297 |
NormalCursor notNil ifTrue:[NormalCursor := NormalCursor onDevice:device]. |
|
1495 | 1298 |
|
1564 | 1299 |
CrossHairCursor notNil ifTrue:[CrossHairCursor := CrossHairCursor onDevice:device]. |
1495 | 1300 |
|
1564 | 1301 |
MarkerCursor notNil ifTrue:[MarkerCursor := MarkerCursor onDevice:device]. |
1302 |
UpCursor notNil ifTrue:[UpCursor := UpCursor onDevice:device]. |
|
1303 |
DownCursor notNil ifTrue:[DownCursor := DownCursor onDevice:device]. |
|
1304 |
LeftCursor notNil ifTrue:[LeftCursor := LeftCursor onDevice:device]. |
|
1305 |
RightCursor notNil ifTrue:[RightCursor := RightCursor onDevice:device]. |
|
1306 |
XMarkerCursor notNil ifTrue:[XMarkerCursor := XMarkerCursor onDevice:device]. |
|
1307 |
CaretCursor notNil ifTrue:[CaretCursor := CaretCursor onDevice:device]. |
|
1495 | 1308 |
|
1564 | 1309 |
ThumbsUpCursor notNil ifTrue:[ThumbsUpCursor := ThumbsUpCursor onDevice:device]. |
1310 |
ThumbsDownCursor notNil ifTrue:[ThumbsDownCursor := ThumbsDownCursor onDevice:device]. |
|
1311 |
StopCursor notNil ifTrue:[StopCursor := StopCursor onDevice:device]. |
|
1312 |
EyeCursor notNil ifTrue:[EyeCursor := EyeCursor onDevice:device]. |
|
1495 | 1313 |
|
1564 | 1314 |
" |
1315 |
Cursor initializeNewCursors |
|
1316 |
" |
|
1495 | 1317 |
|
2121
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1318 |
"Modified: / 19.5.1998 / 17:23:10 / cg" |
1495 | 1319 |
! |
1320 |
||
864 | 1321 |
update:something with:aParameter from:changedObject |
0 | 1322 |
"sent when restarted after a snapIn" |
1323 |
||
1324 |
(something == #restarted) ifTrue:[ |
|
974 | 1325 |
self flushDeviceCursors |
0 | 1326 |
] |
864 | 1327 |
|
1328 |
"Created: 15.6.1996 / 15:18:47 / cg" |
|
0 | 1329 |
! ! |
1330 |
||
1140 | 1331 |
!Cursor class methodsFor:'instance creation'! |
0 | 1332 |
|
1333 |
extent:extent fromArray:array offset:offset |
|
1934 | 1334 |
"ST-80 compatibility |
1335 |
create a new bitmap cursor from bits in the array argument. |
|
1336 |
Here, the offset argument defines the hotSpot, but is given |
|
1337 |
as the negative of the hotSpot coordinate within the cursor (sigh - ST80 compatibility)." |
|
1338 |
||
1339 |
^ self |
|
1340 |
extent:extent sourceArray:array maskArray:array offset:offset |
|
1341 |
||
1342 |
"Modified: 22.10.1997 / 23:59:41 / cg" |
|
0 | 1343 |
! |
1344 |
||
1345 |
extent:extent sourceArray:sourceArray maskArray:maskArray offset:offset |
|
1346 |
"create a new bitmap cursor with mask from bits in sourceArray and |
|
1934 | 1347 |
maskArray. |
1348 |
The offset argument defines the hotSpot, but is given as the negative |
|
1349 |
of the hotSpots coordinate within the cursor (sigh - ST80 compatibility)" |
|
0 | 1350 |
|
1351 |
|sourceForm maskForm| |
|
1352 |
||
1353 |
sourceForm := Form extent:extent fromArray:sourceArray offset:offset. |
|
1934 | 1354 |
sourceArray ~~ maskArray ifTrue:[ |
1355 |
maskForm := Form extent:extent fromArray:maskArray offset:offset. |
|
1356 |
] ifFalse:[ |
|
1357 |
maskForm := sourceForm |
|
1358 |
]. |
|
0 | 1359 |
^ self sourceForm:sourceForm maskForm:maskForm hotSpot:(offset negated) |
1934 | 1360 |
|
1361 |
"Modified: 22.10.1997 / 23:58:36 / cg" |
|
0 | 1362 |
! |
1363 |
||
577 | 1364 |
fileCursorNamed:cursorName |
1365 |
"return a cursor read from the files 'cursorName_bits.bit' and |
|
1934 | 1366 |
'cursorName_mask.bit' - return nil if either file does not exist. |
1367 |
This method is going to be obsoleted in the future." |
|
1368 |
||
1369 |
|cursorBits maskBits fileNamePrefix| |
|
1370 |
||
1371 |
self obsoleteMethodWarning. |
|
1372 |
||
1373 |
fileNamePrefix := 'bitmaps/' , cursorName. |
|
1374 |
||
1375 |
cursorBits := Image fromFile:(fileNamePrefix , '_bits.bit'). |
|
577 | 1376 |
cursorBits notNil ifTrue:[ |
1934 | 1377 |
maskBits := Image fromFile:(fileNamePrefix , '_mask.bit'). |
1378 |
maskBits notNil ifTrue:[ |
|
1379 |
^ self sourceForm:cursorBits maskForm:maskBits |
|
1380 |
] |
|
577 | 1381 |
]. |
1382 |
^ nil |
|
1140 | 1383 |
|
1934 | 1384 |
"Modified: 23.10.1997 / 00:02:07 / cg" |
577 | 1385 |
! |
1386 |
||
1414 | 1387 |
fromImage:anImage |
1388 |
"return a new cursor. |
|
1389 |
Source- and (optional) mask-Bits are taken from anImage; |
|
1934 | 1390 |
The cursors hotSpot is the center of the image." |
1391 |
||
1392 |
^ self |
|
1393 |
fromImage:anImage hotSpot:(anImage center) |
|
1414 | 1394 |
|
1395 |
" |
|
1396 |
|i c| |
|
1397 |
||
1398 |
i := Image fromFile:'bitmaps/xpmBitmaps/cursors/ul_br_arrow.xpm'. |
|
1399 |
c := Cursor fromImage:i. |
|
1400 |
WindowGroup activeGroup |
|
1934 | 1401 |
withCursor:c |
1402 |
do:[(Delay forSeconds:5)wait] |
|
1414 | 1403 |
" |
1404 |
||
1934 | 1405 |
"Modified: 22.10.1997 / 23:55:01 / cg" |
1406 |
! |
|
1407 |
||
1408 |
fromImage:anImage hotSpot:aPoint |
|
1409 |
"return a new cursor. |
|
1410 |
Source- and (optional) mask-Bits are taken from anImage; |
|
1411 |
The cursors hotSpot is given as an offset from the top-left." |
|
1412 |
||
1413 |
|mask sourceForm maskForm| |
|
1414 |
||
1415 |
sourceForm := anImage asMonochromeFormOn:Screen current. |
|
1416 |
||
1417 |
mask := anImage mask. |
|
1418 |
mask isNil ifTrue:[ |
|
1419 |
maskForm := sourceForm |
|
1420 |
] ifFalse:[ |
|
1421 |
maskForm := mask asMonochromeFormOn:Screen current. |
|
1422 |
]. |
|
1423 |
^ self sourceForm:sourceForm |
|
1424 |
maskForm:maskForm |
|
1425 |
hotX:(aPoint x) |
|
1426 |
hotY:(aPoint y) |
|
1427 |
||
1428 |
" |
|
1429 |
|i c| |
|
1430 |
||
1431 |
i := Image fromFile:'bitmaps/xpmBitmaps/cursors/ul_br_arrow.xpm'. |
|
1432 |
c := Cursor fromImage:i hotSpot:(i center). |
|
1433 |
WindowGroup activeGroup |
|
1434 |
withCursor:c |
|
1435 |
do:[(Delay forSeconds:5)wait] |
|
1436 |
" |
|
1437 |
||
1438 |
"Modified: 22.10.1997 / 23:49:00 / cg" |
|
1439 |
"Created: 22.10.1997 / 23:51:32 / cg" |
|
1414 | 1440 |
! |
1441 |
||
577 | 1442 |
imageArray:imageBits maskArray:maskBits |
1443 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1444 |
||
1934 | 1445 |
^ self |
1446 |
imageArray:imageBits |
|
1447 |
maskArray:maskBits |
|
1448 |
hotSpot:8@8 |
|
1449 |
||
1450 |
" |
|
1451 |
|cursor| |
|
1452 |
||
1453 |
cursor := Cursor |
|
1454 |
imageArray: #( |
|
1455 |
2r0000000000000000 |
|
1456 |
2r0000000100001110 |
|
1457 |
2r0000000100001110 |
|
1458 |
2r0000000100001110 |
|
1459 |
2r0000000100000000 |
|
1460 |
2r0000000100000000 |
|
1461 |
2r0000000100000000 |
|
1462 |
2r0111111111111110 |
|
1463 |
2r0000000100000000 |
|
1464 |
2r0000000100000000 |
|
1465 |
2r0000000100000000 |
|
1466 |
2r0000000100000000 |
|
1467 |
2r0000000100000000 |
|
1468 |
2r0000000100000000 |
|
1469 |
2r0000000100000000 |
|
1470 |
2r0000000000000000) |
|
1471 |
maskArray: #( |
|
1472 |
2r0000001110011111 |
|
1473 |
2r0000001110011111 |
|
1474 |
2r0000001110011111 |
|
1475 |
2r0000001110011111 |
|
1476 |
2r0000001110011111 |
|
1477 |
2r0000001110000000 |
|
1478 |
2r1111111111111111 |
|
1479 |
2r1111111111111111 |
|
1480 |
2r1111111111111111 |
|
1481 |
2r0000001110000000 |
|
1482 |
2r0000001110000000 |
|
1483 |
2r0000001110000000 |
|
1484 |
2r0000001110000000 |
|
1485 |
2r0000001110000000 |
|
1486 |
2r0000001110000000 |
|
1487 |
2r0000001110000000). |
|
1488 |
||
1489 |
cursor showWhile:[ |
|
1490 |
(Delay forSeconds:10) wait |
|
1491 |
] |
|
1492 |
" |
|
1493 |
||
1494 |
"Modified: 23.10.1997 / 00:06:09 / cg" |
|
577 | 1495 |
! |
1496 |
||
1497 |
imageArray:imageBits maskArray:maskBits hotSpot:hot |
|
1498 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1499 |
||
1500 |
^ self |
|
1501 |
extent:16@16 |
|
1502 |
sourceArray:imageBits |
|
1503 |
maskArray:maskBits |
|
1504 |
offset:hot negated |
|
1505 |
||
1506 |
" |
|
1507 |
|cursor| |
|
1508 |
||
1509 |
cursor := Cursor |
|
1510 |
imageArray: #( |
|
1511 |
2r0000000000000000 |
|
1512 |
2r0000000100001110 |
|
1513 |
2r0000000100001110 |
|
1514 |
2r0000000100001110 |
|
1515 |
2r0000000100000000 |
|
1516 |
2r0000000100000000 |
|
1517 |
2r0000000100000000 |
|
1518 |
2r0111111111111110 |
|
1519 |
2r0000000100000000 |
|
1520 |
2r0000000100000000 |
|
1521 |
2r0000000100000000 |
|
1522 |
2r0000000100000000 |
|
1523 |
2r0000000100000000 |
|
1524 |
2r0000000100000000 |
|
1525 |
2r0000000100000000 |
|
1526 |
2r0000000000000000) |
|
1527 |
maskArray: #( |
|
1528 |
2r0000001110011111 |
|
1529 |
2r0000001110011111 |
|
1530 |
2r0000001110011111 |
|
1531 |
2r0000001110011111 |
|
1532 |
2r0000001110011111 |
|
1533 |
2r0000001110000000 |
|
1534 |
2r1111111111111111 |
|
1535 |
2r1111111111111111 |
|
1536 |
2r1111111111111111 |
|
1537 |
2r0000001110000000 |
|
1538 |
2r0000001110000000 |
|
1539 |
2r0000001110000000 |
|
1540 |
2r0000001110000000 |
|
1541 |
2r0000001110000000 |
|
1542 |
2r0000001110000000 |
|
1543 |
2r0000001110000000) |
|
1544 |
hotSpot: 8@8. |
|
1545 |
||
1546 |
WindowGroup activeGroup |
|
1547 |
withCursor:cursor |
|
1548 |
do:[(Delay forSeconds:10)wait] |
|
1549 |
" |
|
1550 |
! |
|
1551 |
||
1552 |
imageArray:imageBits maskArray:maskBits hotSpot:hot name:aString |
|
1553 |
"ST-80 compatible cursor creation - the extent is fixed to 16@16" |
|
1554 |
||
1555 |
"name is ignored ..." |
|
1556 |
||
1557 |
^ self imageArray:imageBits maskArray:maskBits hotSpot:hot |
|
1558 |
! |
|
1559 |
||
1560 |
shape:aShape |
|
1561 |
"return one of the standard cursors. |
|
1562 |
Each display may offer different shapes - see for example XWorkstation |
|
1563 |
for details (however a basic minimum set should be supported by all)" |
|
1564 |
||
1565 |
|newCursor| |
|
1566 |
||
1567 |
"first look if not already known" |
|
1568 |
Lobby isNil ifTrue:[ |
|
1569 |
self initialize |
|
1570 |
]. |
|
1571 |
Lobby do:[:aCursor | |
|
1572 |
(aCursor shape == aShape) ifTrue:[ |
|
1573 |
^ aCursor |
|
1574 |
] |
|
1575 |
]. |
|
1576 |
newCursor := self basicNew setShape:aShape. |
|
1577 |
Lobby register:newCursor. |
|
1578 |
^ newCursor |
|
1579 |
! |
|
1580 |
||
1581 |
shape:aShape on:aDevice |
|
1582 |
"return one of the standard cursors already associated to aDevice. |
|
1583 |
This is the same as '(Cursor shape:aShape) on:aDevice' but somwehat faster." |
|
1584 |
||
1585 |
|newCursor oldCursor| |
|
1586 |
||
1587 |
"first look if not already known" |
|
1588 |
Lobby isNil ifTrue:[ |
|
974 | 1589 |
self initialize |
577 | 1590 |
]. |
1591 |
Lobby do:[:aCursor | |
|
974 | 1592 |
(aCursor shape == aShape) ifTrue:[ |
1593 |
(aCursor graphicsDevice == aDevice) ifTrue:[^ aCursor]. |
|
1594 |
oldCursor := aCursor |
|
1595 |
]. |
|
577 | 1596 |
]. |
1597 |
||
1598 |
"found one with same shape, but different device" |
|
1599 |
oldCursor notNil ifTrue:[ |
|
974 | 1600 |
^ oldCursor newOn:aDevice |
577 | 1601 |
]. |
1602 |
||
1603 |
newCursor := self basicNew setShape:aShape. |
|
1604 |
Lobby register:newCursor. |
|
1605 |
^ newCursor |
|
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1606 |
|
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
1607 |
"Modified: 5.7.1996 / 17:58:06 / cg" |
577 | 1608 |
! |
1609 |
||
0 | 1610 |
sourceForm:aForm |
1611 |
"return a new cursor. |
|
1612 |
Source- and mask-Bits are taken from aForm; hotSpot is center" |
|
1613 |
||
1934 | 1614 |
^ self sourceForm:aForm maskForm:aForm |
1615 |
||
1616 |
"Modified: 23.10.1997 / 00:08:37 / cg" |
|
0 | 1617 |
! |
1618 |
||
1619 |
sourceForm:sourceForm maskForm:maskForm |
|
1620 |
"return a new cursor. hotSpot is center" |
|
1621 |
||
1622 |
^ self sourceForm:sourceForm |
|
80 | 1623 |
maskForm:maskForm |
1624 |
hotX:(sourceForm width // 2) |
|
1625 |
hotY:(sourceForm height // 2) |
|
0 | 1626 |
! |
1627 |
||
1628 |
sourceForm:sourceForm maskForm:maskForm hotSpot:aPoint |
|
1629 |
"return a new cursor" |
|
1630 |
||
1631 |
^ self sourceForm:sourceForm |
|
80 | 1632 |
maskForm:maskForm |
1633 |
hotX:(aPoint x) |
|
1634 |
hotY:(aPoint y) |
|
0 | 1635 |
! |
1636 |
||
1637 |
sourceForm:sourceForm maskForm:maskForm hotX:hotX hotY:hotY |
|
1638 |
"return a new cursor" |
|
1639 |
||
1640 |
|newCursor| |
|
1641 |
||
1642 |
"first look if not already known" |
|
223 | 1643 |
Lobby isNil ifTrue:[ |
499 | 1644 |
self initialize |
223 | 1645 |
]. |
115 | 1646 |
Lobby do:[:aCursor | |
80 | 1647 |
(aCursor sourceForm == sourceForm) ifTrue:[ |
1648 |
(aCursor maskForm == maskForm) ifTrue:[ |
|
1649 |
(aCursor hotX == hotX) ifTrue:[ |
|
1650 |
(aCursor hotY == hotY) ifTrue:[ |
|
1651 |
^ aCursor |
|
1652 |
] |
|
1653 |
] |
|
1654 |
] |
|
1655 |
] |
|
0 | 1656 |
]. |
35 | 1657 |
(sourceForm isNil or:[maskForm isNil]) ifTrue:[^ nil]. |
1658 |
||
2 | 1659 |
newCursor := self basicNew setSourceForm:sourceForm |
80 | 1660 |
maskForm:maskForm |
1661 |
hotX:hotX |
|
1662 |
hotY:hotY. |
|
23 | 1663 |
Lobby register:newCursor. |
0 | 1664 |
^ newCursor |
577 | 1665 |
! ! |
1666 |
||
1224
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1667 |
!Cursor class methodsFor:'cleanup'! |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1668 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1669 |
releaseResourcesOnDevice:aDevice |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1670 |
"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
|
1671 |
to release all cached Cursors from that device" |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1672 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1673 |
Lobby unregisterAllForWhich:[:aCursor | aCursor graphicsDevice == aDevice] |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1674 |
|
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1675 |
"Created: 16.1.1997 / 16:43:59 / cg" |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1676 |
! ! |
2a2270ec4236
added #releaseResourcesOnDevice:, to allow cleanup when
Claus Gittinger <cg@exept.de>
parents:
1188
diff
changeset
|
1677 |
|
1140 | 1678 |
!Cursor class methodsFor:'default access'! |
577 | 1679 |
|
1680 |
defaultFgColor:fgColor defaultBgColor:bgColor |
|
1681 |
"set the default colors used for cursors" |
|
1682 |
||
1683 |
DefaultFgColor := fgColor. |
|
1684 |
DefaultBgColor := bgColor |
|
0 | 1685 |
! ! |
1686 |
||
1140 | 1687 |
!Cursor class methodsFor:'standard cursors'! |
0 | 1688 |
|
1689 |
arrow |
|
1690 |
"return an arrow (up-left-arrow) cursor" |
|
1691 |
||
71 | 1692 |
^ self shape:#upLeftArrow on:Display |
1934 | 1693 |
|
1694 |
" |
|
1695 |
Cursor arrow |
|
1696 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1697 |
" |
|
1698 |
||
1699 |
"Modified: 23.10.1997 / 00:28:28 / cg" |
|
0 | 1700 |
! |
1701 |
||
577 | 1702 |
blank |
1934 | 1703 |
"Answer the instance of me that is an invisible cursor." |
1704 |
||
1705 |
^ BlankCursor |
|
1706 |
||
1707 |
" |
|
1708 |
Cursor blank |
|
1709 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1710 |
" |
|
1711 |
||
1712 |
"Modified: 23.10.1997 / 00:27:39 / cg" |
|
1713 |
! |
|
80 | 1714 |
|
1715 |
bottomLeft |
|
1716 |
"return a bottom-left corner cursor" |
|
1717 |
||
1718 |
^ self shape:#bottomLeft on:Display |
|
1934 | 1719 |
|
1720 |
" |
|
1721 |
Cursor bottomLeft |
|
1722 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1723 |
" |
|
1724 |
||
1725 |
"Modified: 23.10.1997 / 00:27:12 / cg" |
|
80 | 1726 |
! |
1727 |
||
1728 |
bottomRight |
|
1729 |
"return a bottom-right corner cursor" |
|
1730 |
||
1731 |
^ self corner |
|
1934 | 1732 |
|
1733 |
" |
|
1734 |
Cursor bottomRight |
|
1735 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1736 |
" |
|
1737 |
||
1738 |
"Modified: 23.10.1997 / 00:27:02 / cg" |
|
80 | 1739 |
! |
1740 |
||
577 | 1741 |
caret |
1934 | 1742 |
"return a caret cursor" |
1743 |
||
1744 |
^ CaretCursor |
|
1745 |
||
1746 |
" |
|
1747 |
Cursor caret |
|
1748 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1749 |
" |
|
1750 |
||
1751 |
"Modified: 23.10.1997 / 00:27:08 / cg" |
|
1752 |
! |
|
577 | 1753 |
|
1754 |
corner |
|
1934 | 1755 |
"return a corner (bottom-right) cursor" |
80 | 1756 |
|
577 | 1757 |
CornerCursor isNil ifTrue:[ |
1934 | 1758 |
CornerCursor := self shape:#corner on:Display |
577 | 1759 |
]. |
1760 |
^ CornerCursor |
|
1934 | 1761 |
|
1762 |
" |
|
1763 |
Cursor corner |
|
1764 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1765 |
" |
|
1766 |
||
1767 |
"Modified: 23.10.1997 / 00:26:53 / cg" |
|
577 | 1768 |
! |
1769 |
||
1770 |
cross |
|
1771 |
"return a cross cursor" |
|
1772 |
||
1773 |
^ self shape:#cross on:Display |
|
1934 | 1774 |
|
1775 |
" |
|
1776 |
Cursor cross |
|
1777 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1778 |
" |
|
1779 |
||
1780 |
"Modified: 23.10.1997 / 00:26:49 / cg" |
|
80 | 1781 |
! |
1782 |
||
0 | 1783 |
crossHair |
1784 |
"return a crossHair cursor" |
|
1785 |
||
1786 |
CrossHairCursor isNil ifTrue:[ |
|
1934 | 1787 |
CrossHairCursor := self shape:#crossHair on:Display |
0 | 1788 |
]. |
1789 |
^ CrossHairCursor |
|
1934 | 1790 |
|
1791 |
" |
|
1792 |
Cursor crossHair |
|
1793 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1794 |
" |
|
1795 |
||
1796 |
"Modified: 23.10.1997 / 00:26:42 / cg" |
|
0 | 1797 |
! |
1798 |
||
2121
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1799 |
document |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1800 |
"return a document cursor (dragging a document)" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1801 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1802 |
^ DocumentCursor |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1803 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1804 |
" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1805 |
Cursor document |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1806 |
showWhile:[ Delay waitForSeconds:3 ] |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1807 |
" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1808 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1809 |
"Modified: / 23.10.1997 / 00:27:08 / cg" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1810 |
"Created: / 19.5.1998 / 17:17:53 / cg" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1811 |
! |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1812 |
|
577 | 1813 |
down |
1934 | 1814 |
"Answer the instance of me that is the shape of a down-arrow." |
1815 |
||
1816 |
^ DownCursor |
|
1817 |
||
1818 |
" |
|
1819 |
Cursor down |
|
1820 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1821 |
" |
|
1822 |
||
1823 |
"Modified: 23.10.1997 / 00:26:34 / cg" |
|
1824 |
! |
|
0 | 1825 |
|
577 | 1826 |
downLimitArrow |
1827 |
"return a down-arrow-to-limit cursor" |
|
0 | 1828 |
|
577 | 1829 |
^ self shape:#downLimitArrow on:Display |
1934 | 1830 |
|
1831 |
" |
|
1832 |
Cursor downLimitArrow |
|
1833 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1834 |
" |
|
1835 |
||
1836 |
"Modified: 23.10.1997 / 00:26:29 / cg" |
|
0 | 1837 |
! |
1838 |
||
1839 |
execute |
|
157 | 1840 |
"return a execute cursor - (the default here is a wait-cursor)" |
0 | 1841 |
|
157 | 1842 |
XeqCursor notNil ifTrue:[ |
1934 | 1843 |
^ XeqCursor |
157 | 1844 |
]. |
71 | 1845 |
^ self wait |
1934 | 1846 |
|
1847 |
" |
|
1848 |
Cursor execute |
|
1849 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1850 |
" |
|
1851 |
||
1852 |
"Modified: 23.10.1997 / 00:26:19 / cg" |
|
56 | 1853 |
! |
1854 |
||
577 | 1855 |
eye |
1934 | 1856 |
"return an eye cursor" |
1857 |
||
1858 |
^ EyeCursor |
|
1859 |
||
1860 |
" |
|
1861 |
Cursor eye |
|
1862 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1863 |
" |
|
1864 |
||
1865 |
"Modified: 23.10.1997 / 00:26:06 / cg" |
|
577 | 1866 |
! |
1867 |
||
2121
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1868 |
folder |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1869 |
"return a folder cursor (dragging a folder)" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1870 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1871 |
^ FolderCursor |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1872 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1873 |
" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1874 |
Cursor folder |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1875 |
showWhile:[ Delay waitForSeconds:3 ] |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1876 |
" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1877 |
|
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1878 |
"Modified: / 23.10.1997 / 00:27:08 / cg" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1879 |
"Created: / 19.5.1998 / 17:18:17 / cg" |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1880 |
! |
376a0d47257a
two new standardCursors: #document & #folder
Claus Gittinger <cg@exept.de>
parents:
2096
diff
changeset
|
1881 |
|
577 | 1882 |
fourWay |
1883 |
"return a four-way arrow cursor" |
|
1884 |
||
1885 |
FourWayCursor isNil ifTrue:[ |
|
1934 | 1886 |
FourWayCursor := self shape:#fourWay on:Display |
577 | 1887 |
]. |
1888 |
^ FourWayCursor |
|
1934 | 1889 |
|
1890 |
" |
|
1891 |
Cursor fourWay |
|
1892 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1893 |
" |
|
1894 |
||
1895 |
"Modified: 23.10.1997 / 00:25:34 / cg" |
|
577 | 1896 |
! |
1897 |
||
1898 |
hand |
|
1899 |
"return a hand cursor" |
|
1900 |
||
1901 |
HandCursor isNil ifTrue:[ |
|
2063 | 1902 |
HandCursor := self shape:#upRightHand on:Display. |
1903 |
HandCursor isNil ifTrue:[ |
|
1904 |
HandCursor := self normal. |
|
1905 |
] |
|
577 | 1906 |
]. |
1907 |
^ HandCursor |
|
1934 | 1908 |
|
1909 |
" |
|
1910 |
Cursor hand |
|
1911 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1912 |
" |
|
1913 |
||
1914 |
"Modified: 23.10.1997 / 00:25:07 / cg" |
|
577 | 1915 |
! |
1916 |
||
1917 |
left |
|
1934 | 1918 |
"Answer the instance of me that is the shape of an arrow facing to the left." |
1919 |
||
1920 |
^ LeftCursor |
|
1921 |
||
1922 |
" |
|
1923 |
Cursor left |
|
1924 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1925 |
" |
|
1926 |
||
1927 |
"Modified: 23.10.1997 / 00:24:51 / cg" |
|
1928 |
! |
|
577 | 1929 |
|
1930 |
leftHand |
|
1931 |
"return a left-hand cursor" |
|
1932 |
||
1933 |
^ self shape:#leftHand |
|
1934 | 1934 |
|
1935 |
" |
|
1936 |
Cursor leftHand |
|
1937 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1938 |
" |
|
1939 |
||
1940 |
"Modified: 23.10.1997 / 00:24:31 / cg" |
|
577 | 1941 |
! |
1942 |
||
1943 |
leftLimitArrow |
|
1944 |
"return a left-arrow-to-limit cursor" |
|
1945 |
||
1946 |
^ self shape:#leftLimitArrow on:Display |
|
1934 | 1947 |
|
1948 |
" |
|
1949 |
Cursor leftLimitArrow |
|
1950 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1951 |
" |
|
1952 |
||
1953 |
"Modified: 23.10.1997 / 00:24:14 / cg" |
|
577 | 1954 |
! |
1955 |
||
1956 |
leftRightArrow |
|
1957 |
"return a left-right-arrow cursor" |
|
1958 |
||
1959 |
LeftRightArrowCursor isNil ifTrue:[ |
|
1934 | 1960 |
LeftRightArrowCursor := self shape:#leftRightArrow on:Display |
577 | 1961 |
]. |
1962 |
^ LeftRightArrowCursor |
|
1934 | 1963 |
|
1964 |
" |
|
1965 |
Cursor leftRightArrow |
|
1966 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1967 |
" |
|
1968 |
||
1969 |
"Modified: 23.10.1997 / 00:23:59 / cg" |
|
577 | 1970 |
! |
1971 |
||
1972 |
marker |
|
1934 | 1973 |
"Answer the instance of me that is the shape of a horizontal arrow." |
1974 |
||
1975 |
^ MarkerCursor |
|
1976 |
||
1977 |
" |
|
1978 |
Cursor marker |
|
1979 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1980 |
" |
|
1981 |
||
1982 |
"Modified: 23.10.1997 / 00:23:33 / cg" |
|
1983 |
! |
|
56 | 1984 |
|
577 | 1985 |
normal |
1986 |
"return the normal cursor; an arrow. |
|
1987 |
for ST-80 compatibility" |
|
1988 |
||
1989 |
NormalCursor isNil ifTrue:[ |
|
1934 | 1990 |
NormalCursor := self arrow |
577 | 1991 |
]. |
1992 |
^ NormalCursor |
|
1568 | 1993 |
|
1934 | 1994 |
|
1995 |
" |
|
1996 |
Cursor normal |
|
1997 |
showWhile:[ Delay waitForSeconds:3 ] |
|
1998 |
" |
|
1999 |
||
2000 |
"Modified: 23.10.1997 / 00:23:12 / cg" |
|
577 | 2001 |
! |
2002 |
||
2003 |
origin |
|
2004 |
"return an origin cursor" |
|
2005 |
||
2006 |
OriginCursor isNil ifTrue:[ |
|
1934 | 2007 |
OriginCursor := self shape:#origin on:Display |
157 | 2008 |
]. |
577 | 2009 |
^ OriginCursor |
1934 | 2010 |
|
2011 |
" |
|
2012 |
Cursor origin |
|
2013 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2014 |
" |
|
2015 |
||
2016 |
"Modified: 23.10.1997 / 00:22:58 / cg" |
|
577 | 2017 |
! |
2018 |
||
2019 |
questionMark |
|
2020 |
"return a question-mark cursor" |
|
2021 |
||
2194
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2022 |
|crsr| |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2023 |
|
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2024 |
crsr := self shape:#questionMark on:Display. |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2025 |
(crsr isNil |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2026 |
or:[crsr id isNil]) ifTrue:[ |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2027 |
crsr := self wait |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2028 |
]. |
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2029 |
^ crsr |
1934 | 2030 |
|
2031 |
" |
|
2032 |
Cursor questionMark |
|
2033 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2034 |
" |
|
2035 |
||
2194
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2036 |
"Modified: / 27.7.1998 / 20:20:44 / cg" |
577 | 2037 |
! |
2038 |
||
2039 |
read |
|
2040 |
"return a reading-file cursor (the default here is a wait-cursor)" |
|
2041 |
||
2042 |
ReadCursor notNil ifTrue:[ |
|
1934 | 2043 |
^ ReadCursor |
577 | 2044 |
]. |
2045 |
^ self wait |
|
1934 | 2046 |
|
2047 |
" |
|
2048 |
Cursor read |
|
2049 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2050 |
" |
|
2051 |
||
2052 |
"Modified: 23.10.1997 / 00:22:23 / cg" |
|
577 | 2053 |
! |
2054 |
||
2055 |
right |
|
1934 | 2056 |
"Answer the instance of me that is the shape of an arrow facing to the right." |
2057 |
||
2058 |
^ RightCursor |
|
2059 |
||
2060 |
" |
|
2061 |
Cursor right |
|
2062 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2063 |
" |
|
2064 |
||
2065 |
"Modified: 23.10.1997 / 00:22:05 / cg" |
|
2066 |
! |
|
2067 |
||
2068 |
rightLimitArrow |
|
577 | 2069 |
"return a right-arrow-to-limit cursor" |
2070 |
||
2071 |
^ self shape:#rightLimitArrow on:Display |
|
1934 | 2072 |
|
2073 |
||
2074 |
" |
|
2075 |
Cursor rightLimitArrow |
|
2076 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2077 |
" |
|
2078 |
||
2079 |
"Modified: 23.10.1997 / 00:15:12 / cg" |
|
2080 |
"Created: 23.10.1997 / 00:21:21 / cg" |
|
577 | 2081 |
! |
2082 |
||
2083 |
stop |
|
2084 |
"return a stop cursor (the default here is a wait-cursor)" |
|
2085 |
||
2086 |
StopCursor notNil ifTrue:[ |
|
1934 | 2087 |
^ StopCursor |
577 | 2088 |
]. |
2089 |
^ self wait |
|
1934 | 2090 |
|
2091 |
" |
|
2092 |
Cursor stop |
|
2093 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2094 |
" |
|
2095 |
||
2096 |
"Modified: 23.10.1997 / 00:20:52 / cg" |
|
577 | 2097 |
! |
2098 |
||
2099 |
text |
|
2100 |
"return a text-cursor" |
|
2101 |
||
2102 |
^ self shape:#text on:Display |
|
1934 | 2103 |
|
2104 |
" |
|
2105 |
Cursor text |
|
2106 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2107 |
" |
|
2108 |
||
2109 |
"Modified: 23.10.1997 / 00:20:37 / cg" |
|
56 | 2110 |
! |
2111 |
||
2112 |
thumbsDown |
|
2113 |
"return a hand cursor - ST-80 compatibility" |
|
2114 |
||
157 | 2115 |
ThumbsDownCursor notNil ifTrue:[ |
1934 | 2116 |
^ ThumbsDownCursor |
157 | 2117 |
]. |
56 | 2118 |
^ self hand |
1934 | 2119 |
|
2120 |
" |
|
2121 |
Cursor thumbsDown |
|
2122 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2123 |
" |
|
2124 |
||
2125 |
"Modified: 23.10.1997 / 00:20:20 / cg" |
|
577 | 2126 |
! |
2127 |
||
2128 |
thumbsUp |
|
2129 |
"return a hand cursor - ST-80 compatibility" |
|
2130 |
||
2131 |
ThumbsUpCursor notNil ifTrue:[ |
|
1934 | 2132 |
^ ThumbsUpCursor |
577 | 2133 |
]. |
2134 |
^ self hand |
|
1934 | 2135 |
|
2136 |
" |
|
2137 |
Cursor thumbsUp |
|
2138 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2139 |
" |
|
2140 |
||
2141 |
"Modified: 23.10.1997 / 00:20:04 / cg" |
|
577 | 2142 |
! |
2143 |
||
2144 |
topLeft |
|
2145 |
"return a top-left corner cursor" |
|
0 | 2146 |
|
577 | 2147 |
^ self origin |
1934 | 2148 |
|
2149 |
" |
|
2150 |
Cursor topLeft |
|
2151 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2152 |
" |
|
2153 |
||
2154 |
"Modified: 23.10.1997 / 00:19:50 / cg" |
|
577 | 2155 |
! |
2156 |
||
2157 |
topRight |
|
2158 |
"return a top-right corner cursor" |
|
2159 |
||
2160 |
^ self shape:#topRight on:Display |
|
1934 | 2161 |
|
2162 |
" |
|
2163 |
Cursor topRight |
|
2164 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2165 |
" |
|
2166 |
||
2167 |
"Modified: 23.10.1997 / 00:19:33 / cg" |
|
577 | 2168 |
! |
2169 |
||
2170 |
up |
|
1934 | 2171 |
"Answer the instance of me that is the shape of an up-arrow." |
2172 |
||
2173 |
^ UpCursor |
|
2174 |
||
2175 |
" |
|
2176 |
Cursor up |
|
2177 |
showWhile:[ Delay waitForSeconds:5 ] |
|
2178 |
" |
|
2179 |
||
2180 |
"Modified: 23.10.1997 / 00:19:14 / cg" |
|
2181 |
! |
|
71 | 2182 |
|
577 | 2183 |
upDownArrow |
2184 |
"return an up-down-arrow cursor" |
|
2185 |
||
2186 |
UpDownArrowCursor isNil ifTrue:[ |
|
1934 | 2187 |
UpDownArrowCursor := self shape:#upDownArrow on:Display |
577 | 2188 |
]. |
2189 |
^ UpDownArrowCursor |
|
1934 | 2190 |
|
2191 |
" |
|
2192 |
Cursor upDownArrow |
|
2193 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2194 |
" |
|
2195 |
||
2196 |
"Modified: 23.10.1997 / 00:18:53 / cg" |
|
577 | 2197 |
! |
2198 |
||
2199 |
upLeftArrow |
|
2200 |
"return an up-right-arrow cursor" |
|
2201 |
||
2202 |
^ self shape:#upLeftArrow on:Display |
|
1934 | 2203 |
|
2204 |
" |
|
2205 |
Cursor upLeftArrow |
|
2206 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2207 |
" |
|
2208 |
||
2209 |
"Modified: 23.10.1997 / 00:18:37 / cg" |
|
577 | 2210 |
! |
71 | 2211 |
|
577 | 2212 |
upLimitArrow |
2213 |
"return an up-arrow-to-limit cursor" |
|
2214 |
||
2215 |
^ self shape:#upLimitArrow on:Display |
|
1934 | 2216 |
|
2217 |
" |
|
2218 |
Cursor upLimitArrow |
|
2219 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2220 |
" |
|
2221 |
||
2222 |
"Modified: 23.10.1997 / 00:18:19 / cg" |
|
577 | 2223 |
! |
0 | 2224 |
|
577 | 2225 |
upRightArrow |
2226 |
"return an up-right-arrow cursor" |
|
2227 |
||
2228 |
^ self shape:#upRightArrow on:Display |
|
1934 | 2229 |
|
2230 |
" |
|
2231 |
Cursor upRightArrow |
|
2232 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2233 |
" |
|
2234 |
||
2235 |
"Modified: 23.10.1997 / 00:18:03 / cg" |
|
577 | 2236 |
! |
2237 |
||
2238 |
upRightHand |
|
2239 |
"return an up-right-hand cursor" |
|
2240 |
||
2063 | 2241 |
UpRightHandCursor isNil ifTrue:[ |
2242 |
UpRightHandCursor := self shape:#upRightHand on:Display. |
|
2243 |
UpRightHandCursor isNil ifTrue:[ |
|
2244 |
UpRightHandCursor := self normal |
|
2245 |
] |
|
2246 |
]. |
|
2247 |
^ UpRightHandCursor |
|
1934 | 2248 |
|
2249 |
" |
|
2250 |
Cursor upRightHand |
|
2251 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2252 |
" |
|
2253 |
||
2254 |
"Modified: 23.10.1997 / 00:17:46 / cg" |
|
71 | 2255 |
! |
2256 |
||
577 | 2257 |
wait |
2258 |
"return a wait cursor" |
|
2259 |
||
2260 |
WaitCursor isNil ifTrue:[ |
|
1934 | 2261 |
WaitCursor := self shape:#wait on:Display |
577 | 2262 |
]. |
2263 |
^ WaitCursor |
|
1934 | 2264 |
|
2265 |
" |
|
2266 |
Cursor wait |
|
2267 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2268 |
" |
|
2269 |
||
2270 |
"Modified: 23.10.1997 / 00:17:32 / cg" |
|
577 | 2271 |
! |
2272 |
||
2273 |
write |
|
2274 |
"return a writing-file cursor (the default here is a wait-cursor)" |
|
0 | 2275 |
|
577 | 2276 |
WriteCursor notNil ifTrue:[ |
1934 | 2277 |
^ WriteCursor |
577 | 2278 |
]. |
2279 |
^ self wait |
|
1934 | 2280 |
|
2281 |
" |
|
2282 |
Cursor write |
|
2283 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2284 |
" |
|
2285 |
||
2286 |
"Modified: 23.10.1997 / 00:17:22 / cg" |
|
577 | 2287 |
! |
2288 |
||
2289 |
xMarker |
|
1934 | 2290 |
"Answer the instance of me that is displayed when thumb-scrolling on the x-axis." |
2291 |
||
2292 |
^ XMarkerCursor |
|
2293 |
||
2294 |
" |
|
2295 |
Cursor xMarker |
|
2296 |
showWhile:[ Delay waitForSeconds:3 ] |
|
2297 |
" |
|
2298 |
||
2299 |
"Modified: 23.10.1997 / 00:16:44 / cg" |
|
2300 |
! ! |
|
577 | 2301 |
|
2302 |
!Cursor methodsFor:'ST-80 displaying'! |
|
2303 |
||
2304 |
displayOn:aGC at:origin clippingBox:aRectangle rule:aRule mask:aMask |
|
2305 |
"ST-80 compatibility; |
|
2306 |
limited functionality: can only display bitmap cursors (yet)" |
|
2307 |
||
2308 |
sourceForm notNil ifTrue:[ |
|
2309 |
sourceForm displayOn:aGC at:origin clippingBox:aRectangle |
|
2310 |
rule:aRule mask:aMask |
|
0 | 2311 |
] |
2 | 2312 |
! |
2313 |
||
577 | 2314 |
show |
2315 |
"ST-80 mimicri: change cursors in active groups views to the receiver." |
|
2 | 2316 |
|
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2317 |
|wg| |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2318 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2319 |
(wg := WindowGroup activeGroup) notNil ifTrue:[ |
1698 | 2320 |
wg showCursor:self |
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2321 |
] |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2322 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2323 |
"Modified: 13.1.1997 / 20:10:01 / cg" |
577 | 2324 |
! |
2325 |
||
2326 |
showIn:aView |
|
2327 |
"ST-80 mimicri: install the receiver as aViews cursor" |
|
2328 |
||
2329 |
aView cursor:self |
|
2 | 2330 |
! |
2331 |
||
577 | 2332 |
showIn:aView while:aBlock |
2333 |
"ST-80 mimicri: change aViews cursors to the receiver, while evaluationg aBlock. |
|
2334 |
Return the value as returned by aBlock." |
|
2335 |
||
2336 |
|savedCursor| |
|
2337 |
||
2338 |
savedCursor := aView cursor. |
|
2339 |
aView cursor:self. |
|
2340 |
^ aBlock valueNowOrOnUnwindDo:[aView cursor:savedCursor] |
|
2341 |
! |
|
2 | 2342 |
|
577 | 2343 |
showWhile:aBlock |
2344 |
"ST-80 mimicri: change all views cursors to the receiver. |
|
2345 |
Return the value as returned by aBlock." |
|
2346 |
||
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2347 |
|wg| |
577 | 2348 |
|
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2349 |
(wg := WindowGroup activeGroup) notNil ifTrue:[ |
1698 | 2350 |
^ wg withCursor:self do:aBlock |
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2351 |
] ifFalse:[ |
1698 | 2352 |
aBlock value |
1188
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2353 |
] |
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2354 |
|
2a4d644e8828
care for nil-windowGroup in #show and #showWhile:
Claus Gittinger <cg@exept.de>
parents:
1181
diff
changeset
|
2355 |
"Modified: 13.1.1997 / 20:10:25 / cg" |
2 | 2356 |
! ! |
2357 |
||
0 | 2358 |
!Cursor methodsFor:'accessing'! |
2359 |
||
577 | 2360 |
device |
2361 |
"return the device I am associated with" |
|
2362 |
||
2363 |
^ device |
|
2364 |
! |
|
2365 |
||
2366 |
foreground:fgColor background:bgColor |
|
2367 |
"set the cursor colors" |
|
2368 |
||
2369 |
device colorCursor:cursorId foreground:fgColor background:bgColor |
|
2370 |
! |
|
2371 |
||
733 | 2372 |
graphicsDevice |
2373 |
"same as #device, for ST-80 compatibility naming. |
|
2374 |
Return the device I am associated with." |
|
2375 |
||
2376 |
^ device |
|
2377 |
||
2378 |
"Created: 28.5.1996 / 18:39:01 / cg" |
|
2379 |
! |
|
2380 |
||
577 | 2381 |
hotX |
2382 |
"return the hotspots x-coordinate of the receiver" |
|
2383 |
||
2384 |
^ hotX |
|
2385 |
! |
|
2386 |
||
2387 |
hotY |
|
2388 |
"return the hotspots y-coordinate of the receiver" |
|
2389 |
||
2390 |
^ hotY |
|
2391 |
! |
|
2392 |
||
0 | 2393 |
id |
2394 |
"return the cursors deviceId" |
|
2395 |
||
2396 |
^ cursorId |
|
2397 |
! |
|
2398 |
||
577 | 2399 |
maskForm |
2400 |
"return the mask-form of the receiver" |
|
0 | 2401 |
|
577 | 2402 |
^ maskForm |
2403 |
! |
|
2404 |
||
2405 |
maskForm:aForm |
|
2406 |
"set the mask-form of the receiver" |
|
2407 |
||
2408 |
maskForm := aForm |
|
0 | 2409 |
! |
2410 |
||
2411 |
shape |
|
2412 |
"return the shape" |
|
2413 |
||
2414 |
^ shape |
|
2415 |
! |
|
2416 |
||
2417 |
sourceForm |
|
2418 |
"return the source-form of the receiver" |
|
2419 |
||
2420 |
^ sourceForm |
|
2421 |
! |
|
2422 |
||
2423 |
sourceForm:aForm |
|
2424 |
"set the source-form of the receiver" |
|
2425 |
||
2426 |
sourceForm := aForm |
|
577 | 2427 |
! ! |
0 | 2428 |
|
577 | 2429 |
!Cursor methodsFor:'copying'! |
0 | 2430 |
|
577 | 2431 |
postCopy |
2432 |
sourceForm := sourceForm copy. |
|
2433 |
maskForm := maskForm copy. |
|
2434 |
device := cursorId := nil |
|
0 | 2435 |
! ! |
2436 |
||
2437 |
!Cursor methodsFor:'creating a device cursor'! |
|
2438 |
||
2439 |
on:aDevice |
|
2440 |
"create a new Cursor representing the same cursor as |
|
2441 |
myself on aDevice; if one already exists, return the one" |
|
2442 |
||
1741 | 2443 |
"/ send out a warning: #on: is typically used to create viewa |
2444 |
"/ operating on a model. |
|
2445 |
"/ Please use #onDevice: to avoid confusion. |
|
2446 |
||
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2447 |
self obsoleteMethodWarning:'use #onDevice:'. |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2448 |
^ self onDevice:aDevice |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2449 |
|
1741 | 2450 |
"Modified: 5.6.1997 / 21:04:35 / cg" |
1494
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2451 |
! |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2452 |
|
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2453 |
onDevice:aDevice |
4faf11deec70
cursor #on: is obsoleted by #onDevice:.
Claus Gittinger <cg@exept.de>
parents:
1414
diff
changeset
|
2454 |
"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
|
2455 |
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
|
2456 |
|
0 | 2457 |
aDevice isNil ifTrue:[ |
1698 | 2458 |
"this may not happen" |
2459 |
self error:'nil device' |
|
0 | 2460 |
]. |
2461 |
||
71 | 2462 |
"if I am already assigned to that device ..." |
0 | 2463 |
(device == aDevice) ifTrue:[^ self]. |
2464 |
||
2465 |
"first look if not already there" |
|
115 | 2466 |
Lobby do:[:aCursor | |
1698 | 2467 |
(aCursor graphicsDevice == aDevice) ifTrue:[ |
2468 |
shape notNil ifTrue:[ |
|
2469 |
(aCursor shape == shape) ifTrue:[ |
|
2470 |
^ aCursor |
|
2471 |
] |
|
2472 |
] ifFalse:[ |
|
2473 |
(aCursor sourceForm == sourceForm) ifTrue:[ |
|
2474 |
(aCursor maskForm == maskForm) ifTrue:[ |
|
2475 |
(aCursor hotX == hotX) ifTrue:[ |
|
2476 |
(aCursor hotY == hotY) ifTrue:[ |
|
2477 |
^ aCursor |
|
2478 |
] |
|
2479 |
] |
|
2480 |
] |
|
2481 |
] |
|
2482 |
] |
|
2483 |
] |
|
0 | 2484 |
]. |
71 | 2485 |
^ self newOn:aDevice |
927
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
2486 |
|
c4bc2a7ff733
use #graphicsDevice instead of #device.
Claus Gittinger <cg@exept.de>
parents:
864
diff
changeset
|
2487 |
"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
|
2488 |
"Created: 28.3.1997 / 13:46:38 / cg" |
71 | 2489 |
! ! |
2490 |
||
577 | 2491 |
!Cursor methodsFor:'instance release'! |
2492 |
||
2493 |
disposed |
|
1698 | 2494 |
"some Cursor has been collected - tell it to the display" |
577 | 2495 |
|
2096 | 2496 |
|id| |
2497 |
||
2498 |
(id := cursorId) notNil ifTrue:[ |
|
1698 | 2499 |
cursorId := nil. |
2096 | 2500 |
device destroyCursor:id. |
577 | 2501 |
] |
2502 |
! |
|
2503 |
||
2504 |
shallowCopyForFinalization |
|
2505 |
"redefined to return a lightweight copy |
|
2506 |
- all we need is the device handle" |
|
2507 |
||
2508 |
^ self class basicNew setDevice:device id:cursorId |
|
2509 |
||
2510 |
"Modified: 20.4.1996 / 23:23:19 / cg" |
|
2511 |
! ! |
|
2512 |
||
71 | 2513 |
!Cursor methodsFor:'private'! |
2514 |
||
577 | 2515 |
device:aDevice |
1698 | 2516 |
"set the cursors device" |
2517 |
||
577 | 2518 |
device := aDevice |
2519 |
! |
|
2520 |
||
2521 |
id:anId |
|
1698 | 2522 |
"set the cursors id" |
577 | 2523 |
|
2524 |
cursorId := anId |
|
2525 |
! |
|
2526 |
||
71 | 2527 |
newOn:aDevice |
2528 |
"create a new Cursor representing the same cursor as |
|
2529 |
myself on aDevice. Dont search the lobby." |
|
2530 |
||
974 | 2531 |
|newCursor id sF mF w h| |
0 | 2532 |
|
2533 |
"ask that device for the cursor" |
|
2534 |
shape notNil ifTrue:[ |
|
1698 | 2535 |
id := aDevice createCursorShape:shape. |
2536 |
id isNil ifTrue:[ |
|
2537 |
'Cursor [warning]: no cursor with shape:' errorPrint. shape errorPrintCR. |
|
2538 |
^ self |
|
2539 |
]. |
|
0 | 2540 |
] ifFalse:[ |
1698 | 2541 |
aDevice needDeviceFormsForCursor ifTrue:[ |
2542 |
sourceForm notNil ifTrue:[ |
|
2543 |
sF := sourceForm asFormOn:aDevice. |
|
2544 |
]. |
|
2545 |
maskForm notNil ifTrue:[ |
|
2546 |
mF := maskForm asFormOn:aDevice. |
|
2547 |
] ifFalse:[ |
|
2548 |
mF := sF |
|
2549 |
]. |
|
2550 |
(sF notNil and:[mF notNil]) ifTrue:[ |
|
2551 |
sourceForm := sF. |
|
2552 |
maskForm := mF. |
|
2553 |
]. |
|
2554 |
] ifFalse:[ |
|
2555 |
sourceForm notNil ifTrue:[ |
|
2556 |
sF := sourceForm bits |
|
2557 |
]. |
|
2558 |
maskForm notNil ifTrue:[ |
|
2559 |
mF := maskForm bits. |
|
2560 |
] ifFalse:[ |
|
2561 |
mF := sF |
|
2562 |
]. |
|
2563 |
]. |
|
2564 |
(sF isNil or:[mF isNil]) ifTrue:[ |
|
2565 |
'Cursor [warning]: cursor has no form' errorPrintCR. |
|
2566 |
^ self |
|
2567 |
]. |
|
2568 |
w := sourceForm width. |
|
2569 |
h := sourceForm height. |
|
133 | 2570 |
|
1698 | 2571 |
id := aDevice createCursorSourceForm:sF |
2572 |
maskForm:mF |
|
2573 |
hotX:hotX |
|
2574 |
hotY:hotY |
|
2575 |
width:w |
|
2576 |
height:h. |
|
2577 |
id isNil ifTrue:[ |
|
2578 |
'Cursor [warning]: cannot create pixmap cursor' errorPrintCR. |
|
2579 |
^ self |
|
2580 |
]. |
|
0 | 2581 |
]. |
2582 |
||
2583 |
"goody for IRIXs red cursor" |
|
2584 |
DefaultFgColor notNil ifTrue:[ |
|
1698 | 2585 |
aDevice colorCursor:id foreground:DefaultFgColor |
2586 |
background:DefaultBgColor |
|
0 | 2587 |
]. |
2588 |
||
2589 |
device isNil ifTrue:[ |
|
1698 | 2590 |
"receiver was not associated - do it now" |
2591 |
device := aDevice. |
|
2592 |
cursorId := id. |
|
0 | 2593 |
|
1698 | 2594 |
"must re-register, the old registration had a nil cursorId in it" |
2595 |
Lobby registerChange:self. |
|
2596 |
^ self |
|
0 | 2597 |
]. |
2598 |
||
2599 |
"receiver was already associated to another device - need a new cursor" |
|
2 | 2600 |
newCursor := self class basicNew. |
0 | 2601 |
shape notNil ifTrue:[ |
1698 | 2602 |
newCursor setShape:shape. |
0 | 2603 |
] ifFalse:[ |
1698 | 2604 |
newCursor setSourceForm:sourceForm |
2605 |
maskForm:maskForm |
|
2606 |
hotX:hotX |
|
2607 |
hotY:hotY |
|
0 | 2608 |
]. |
2 | 2609 |
newCursor setDevice:aDevice id:id. |
23 | 2610 |
Lobby register:newCursor. |
0 | 2611 |
^ newCursor |
1140 | 2612 |
|
1181 | 2613 |
"Modified: 10.1.1997 / 19:08:20 / cg" |
71 | 2614 |
! |
0 | 2615 |
|
2 | 2616 |
restored |
0 | 2617 |
"set both device and id" |
2618 |
||
2619 |
device := nil. |
|
2620 |
cursorId := nil |
|
2621 |
! ! |
|
2622 |
||
577 | 2623 |
!Cursor methodsFor:'private accessing'! |
0 | 2624 |
|
577 | 2625 |
setDevice:aDevice id:anId |
2626 |
"set the device and deviceId of the receiver" |
|
160 | 2627 |
|
577 | 2628 |
device := aDevice. |
2629 |
cursorId := anId |
|
0 | 2630 |
! |
2631 |
||
577 | 2632 |
setShape:aShapeSymbol |
2633 |
"set the shape" |
|
160 | 2634 |
|
577 | 2635 |
shape := aShapeSymbol. |
0 | 2636 |
! |
2637 |
||
577 | 2638 |
setSourceForm:sForm maskForm:mForm hotX:hx hotY:hy |
2639 |
"set the forms and hotspot" |
|
0 | 2640 |
|
577 | 2641 |
sourceForm := sForm. |
2642 |
maskForm := mForm. |
|
2643 |
hotX := hx. |
|
2644 |
hotY := hy. |
|
2645 |
! ! |
|
157 | 2646 |
|
1811 | 2647 |
!Cursor methodsFor:'queries'! |
2648 |
||
2649 |
isAnimatedCursor |
|
2650 |
^ false |
|
2651 |
||
2652 |
"Created: 26.6.1997 / 11:12:48 / cg" |
|
2653 |
! ! |
|
2654 |
||
1140 | 2655 |
!Cursor class methodsFor:'documentation'! |
0 | 2656 |
|
577 | 2657 |
version |
2194
9a1006b2d9de
care for nil qustionMark shape.
Claus Gittinger <cg@exept.de>
parents:
2121
diff
changeset
|
2658 |
^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.59 1998-07-27 18:22:45 cg Exp $' |
0 | 2659 |
! ! |
577 | 2660 |
Cursor initialize! |