author | Claus Gittinger <cg@exept.de> |
Mon, 04 May 2020 19:16:37 +0200 | |
changeset 9043 | a69c50e2542c |
parent 8991 | 0b377f90ea63 |
permissions | -rw-r--r-- |
8626 | 1 |
"{ Encoding: utf8 }" |
2 |
||
26 | 3 |
" |
4 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 5 |
All Rights Reserved |
26 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
3294 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
7932 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
5275 | 18 |
Event subclass:#WindowEvent |
19 |
instanceVariableNames:'delegatedFrom consumed' |
|
356 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
5275 | 22 |
category:'Interface-Support-UI' |
11 | 23 |
! |
24 |
||
3680 | 25 |
WindowEvent subclass:#ApplicationEvent |
26 |
instanceVariableNames:'' |
|
27 |
classVariableNames:'' |
|
28 |
poolDictionaries:'' |
|
29 |
privateIn:WindowEvent |
|
30 |
! |
|
31 |
||
3011 | 32 |
WindowEvent subclass:#InputEvent |
33 |
instanceVariableNames:'modifierFlags' |
|
34 |
classVariableNames:'F_CTRL F_ALT F_META F_SHIFT F_BUTTON1 F_BUTTON2 F_BUTTON3' |
|
35 |
poolDictionaries:'' |
|
36 |
privateIn:WindowEvent |
|
37 |
! |
|
38 |
||
3680 | 39 |
WindowEvent::InputEvent subclass:#ButtonEvent |
40 |
instanceVariableNames:'' |
|
41 |
classVariableNames:'' |
|
42 |
poolDictionaries:'' |
|
43 |
privateIn:WindowEvent |
|
44 |
! |
|
45 |
||
46 |
WindowEvent::ButtonEvent subclass:#ButtonPressEvent |
|
47 |
instanceVariableNames:'' |
|
48 |
classVariableNames:'' |
|
49 |
poolDictionaries:'' |
|
50 |
privateIn:WindowEvent |
|
51 |
! |
|
52 |
||
53 |
WindowEvent::ButtonPressEvent subclass:#ButtonMultiPressEvent |
|
54 |
instanceVariableNames:'' |
|
55 |
classVariableNames:'' |
|
56 |
poolDictionaries:'' |
|
57 |
privateIn:WindowEvent |
|
58 |
! |
|
59 |
||
60 |
WindowEvent::ButtonEvent subclass:#ButtonReleaseEvent |
|
61 |
instanceVariableNames:'' |
|
62 |
classVariableNames:'' |
|
63 |
poolDictionaries:'' |
|
64 |
privateIn:WindowEvent |
|
65 |
! |
|
66 |
||
3465 | 67 |
WindowEvent subclass:#ClientEvent |
68 |
instanceVariableNames:'eventData' |
|
69 |
classVariableNames:'' |
|
70 |
poolDictionaries:'' |
|
71 |
privateIn:WindowEvent |
|
72 |
! |
|
73 |
||
3680 | 74 |
WindowEvent subclass:#ConfigureEvent |
75 |
instanceVariableNames:'' |
|
76 |
classVariableNames:'' |
|
77 |
poolDictionaries:'' |
|
78 |
privateIn:WindowEvent |
|
79 |
! |
|
80 |
||
3465 | 81 |
WindowEvent subclass:#DamageEvent |
3297 | 82 |
instanceVariableNames:'' |
83 |
classVariableNames:'' |
|
84 |
poolDictionaries:'' |
|
85 |
privateIn:WindowEvent |
|
86 |
! |
|
87 |
||
3680 | 88 |
WindowEvent::InputEvent subclass:#DropEvent |
89 |
instanceVariableNames:'' |
|
90 |
classVariableNames:'' |
|
91 |
poolDictionaries:'' |
|
92 |
privateIn:WindowEvent |
|
93 |
! |
|
94 |
||
95 |
WindowEvent::InputEvent subclass:#EnterLeaveEvent |
|
96 |
instanceVariableNames:'' |
|
97 |
classVariableNames:'' |
|
98 |
poolDictionaries:'' |
|
99 |
privateIn:WindowEvent |
|
100 |
! |
|
101 |
||
3465 | 102 |
WindowEvent::InputEvent subclass:#FocusEvent |
103 |
instanceVariableNames:'' |
|
104 |
classVariableNames:'' |
|
105 |
poolDictionaries:'' |
|
106 |
privateIn:WindowEvent |
|
107 |
! |
|
108 |
||
5962 | 109 |
WindowEvent::InputEvent subclass:#KeyboardEvent |
110 |
instanceVariableNames:'rawKey' |
|
111 |
classVariableNames:'' |
|
112 |
poolDictionaries:'' |
|
113 |
privateIn:WindowEvent |
|
114 |
! |
|
115 |
||
3680 | 116 |
WindowEvent::ButtonEvent subclass:#ButtonMotionEvent |
3294 | 117 |
instanceVariableNames:'' |
118 |
classVariableNames:'' |
|
119 |
poolDictionaries:'' |
|
120 |
privateIn:WindowEvent |
|
121 |
! |
|
122 |
||
5962 | 123 |
WindowEvent::KeyboardEvent subclass:#KeyPressEvent |
124 |
instanceVariableNames:'' |
|
3294 | 125 |
classVariableNames:'' |
126 |
poolDictionaries:'' |
|
127 |
privateIn:WindowEvent |
|
128 |
! |
|
129 |
||
3680 | 130 |
WindowEvent::KeyboardEvent subclass:#KeyReleaseEvent |
131 |
instanceVariableNames:'' |
|
132 |
classVariableNames:'' |
|
133 |
poolDictionaries:'' |
|
134 |
privateIn:WindowEvent |
|
135 |
! |
|
136 |
||
5962 | 137 |
WindowEvent::KeyboardEvent subclass:#HotKeyEvent |
138 |
instanceVariableNames:'hotkeyIdentifier' |
|
3680 | 139 |
classVariableNames:'' |
140 |
poolDictionaries:'' |
|
141 |
privateIn:WindowEvent |
|
142 |
! |
|
143 |
||
3376 | 144 |
WindowEvent::InputEvent subclass:#KeyboardFocusEvent |
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
145 |
instanceVariableNames:'' |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
146 |
classVariableNames:'' |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
147 |
poolDictionaries:'' |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
148 |
privateIn:WindowEvent |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
149 |
! |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
150 |
|
3465 | 151 |
WindowEvent subclass:#MessageSendEvent |
8991 | 152 |
instanceVariableNames:'generatedBy' |
153 |
classVariableNames:'Debug' |
|
3376 | 154 |
poolDictionaries:'' |
155 |
privateIn:WindowEvent |
|
156 |
! |
|
157 |
||
4988 | 158 |
WindowEvent::ButtonEvent subclass:#MouseWheelMotionEvent |
159 |
instanceVariableNames:'' |
|
160 |
classVariableNames:'' |
|
161 |
poolDictionaries:'' |
|
162 |
privateIn:WindowEvent |
|
163 |
! |
|
164 |
||
4144 | 165 |
WindowEvent::InputEvent subclass:#NativeWidgetCommandEvent |
4233 | 166 |
instanceVariableNames:'' |
4144 | 167 |
classVariableNames:'' |
168 |
poolDictionaries:'' |
|
169 |
privateIn:WindowEvent |
|
170 |
! |
|
171 |
||
4044 | 172 |
WindowEvent subclass:#NewDamageEvent |
173 |
instanceVariableNames:'' |
|
174 |
classVariableNames:'' |
|
175 |
poolDictionaries:'' |
|
176 |
privateIn:WindowEvent |
|
177 |
! |
|
178 |
||
3758 | 179 |
WindowEvent subclass:#SelectionEvent |
180 |
instanceVariableNames:'' |
|
181 |
classVariableNames:'' |
|
182 |
poolDictionaries:'' |
|
183 |
privateIn:WindowEvent |
|
184 |
! |
|
185 |
||
186 |
WindowEvent::SelectionEvent subclass:#SelectionClearEvent |
|
187 |
instanceVariableNames:'' |
|
188 |
classVariableNames:'' |
|
189 |
poolDictionaries:'' |
|
190 |
privateIn:WindowEvent |
|
191 |
! |
|
192 |
||
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
193 |
WindowEvent subclass:#TerminateEvent |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
194 |
instanceVariableNames:'' |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
195 |
classVariableNames:'' |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
196 |
poolDictionaries:'' |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
197 |
privateIn:WindowEvent |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
198 |
! |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
199 |
|
4817 | 200 |
WindowEvent::InputEvent subclass:#TrayActionEvent |
201 |
instanceVariableNames:'' |
|
202 |
classVariableNames:'' |
|
203 |
poolDictionaries:'' |
|
204 |
privateIn:WindowEvent |
|
205 |
! |
|
206 |
||
5838
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
207 |
WindowEvent subclass:#VisibilityChangeEvent |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
208 |
instanceVariableNames:'visibility' |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
209 |
classVariableNames:'' |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
210 |
poolDictionaries:'' |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
211 |
privateIn:WindowEvent |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
212 |
! |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
213 |
|
8550 | 214 |
WindowEvent subclass:#WidgetSelectionEvent |
8549 | 215 |
instanceVariableNames:'' |
216 |
classVariableNames:'' |
|
217 |
poolDictionaries:'' |
|
218 |
privateIn:WindowEvent |
|
219 |
! |
|
220 |
||
3680 | 221 |
WindowEvent subclass:#WindowMapUnmapEvent |
222 |
instanceVariableNames:'' |
|
223 |
classVariableNames:'' |
|
224 |
poolDictionaries:'' |
|
225 |
privateIn:WindowEvent |
|
226 |
! |
|
227 |
||
46 | 228 |
!WindowEvent class methodsFor:'documentation'! |
229 |
||
230 |
copyright |
|
231 |
" |
|
232 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 233 |
All Rights Reserved |
46 | 234 |
|
235 |
This software is furnished under a license and may be used |
|
236 |
only in accordance with the terms of that license and with the |
|
237 |
inclusion of the above copyright notice. This software may not |
|
238 |
be provided or otherwise made available to, or used by, any |
|
239 |
other person. No title to or ownership of the software is |
|
240 |
hereby transferred. |
|
241 |
" |
|
242 |
! |
|
243 |
||
244 |
documentation |
|
245 |
" |
|
5752 | 246 |
Instances of WindowEvent are created for every event coming from the graphics device. |
144 | 247 |
Usually, they are enqueued by the event dispatcher process into |
8781 | 248 |
a sensor's input queue, and dequeued & processed by a windowGroup process |
144 | 249 |
in its event loop. |
250 |
||
251 |
WindowEvents hold the event type and additional information (such as key, |
|
252 |
x/y coordinates etc). Also, windowEvents know how to send themself to some |
|
253 |
destination. To provide a common (single) place where event dispatching is |
|
1421 | 254 |
implemented, this forwarding is done by a class method here (i.e. not by the |
144 | 255 |
window group itself). |
256 |
||
257 |
The algorithm for event dispatching is: |
|
258 |
||
5752 | 259 |
- if the destination view has a keyboard focus set, |
260 |
AND the event is a keyboard event, |
|
261 |
THEN recursively invoke the event dispatching method, |
|
262 |
sending the event to the focus view (or its delegate, as below) |
|
144 | 263 |
|
5752 | 264 |
- if the destination view has a delegate, |
265 |
AND its a keyboard, button or pointer event, |
|
266 |
AND the delegate is interested in that event |
|
267 |
(i.e. implements & responds to #handlesXXX with true) |
|
268 |
THEN send the event to the delegate, passing the original view |
|
269 |
as additional argument |
|
144 | 270 |
|
5752 | 271 |
- if the view has a nonNil controller, |
272 |
AND its a key, button or pointer event, |
|
273 |
THEN send the event to the controller |
|
144 | 274 |
|
5752 | 275 |
- otherwise send the event to the view |
144 | 276 |
|
277 |
||
278 |
If the view has a non-nil transformation, the event is sent as a |
|
279 |
#deviceXXX message, passing device coordinates. Typically, subclasses |
|
280 |
of view do not redefine this method and the inherited default method |
|
281 |
translates these device coordinates into logical coordinates and resends |
|
282 |
an XXX message. |
|
283 |
If the view has no transformation, the XXX message is directly sent here. |
|
284 |
||
285 |
For example, a 'buttonPress:button x:x y:y' event leads to sending of |
|
286 |
'aView deviceButtonPress:button x:x y:y' which resends |
|
287 |
'aView buttonPress:button x:(x-logical) y:(y-logical)' |
|
288 |
||
320
b7b8dc88fe9f
interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
289 |
This allows views which are interested in deviceCoordinates to get them |
144 | 290 |
(by redefining #deviceXXX) and other views to transparently get & use |
291 |
logical coordinates. |
|
292 |
||
293 |
Therefore, for a delegated keyPress messages, the flow is: |
|
294 |
||
5752 | 295 |
sendEvent |
296 |
view has delegate |
|
297 |
------> ask delegate via 'handlesKeyPress:key inView:view' |
|
298 |
<------ returns true |
|
299 |
------> 'delegate keyPress:key x:x y:y view:view' |
|
300 |
-----> delegate does whatever it wants to do |
|
301 |
(typically sends the event to some other view) |
|
144 | 302 |
|
303 |
for an undelegated message: |
|
304 |
||
5752 | 305 |
sendEvent |
306 |
view has delegate |
|
307 |
------> ask delegate via 'handlesKeyPress:key inView:view' |
|
308 |
<------ returns false |
|
309 |
view has controller |
|
310 |
------> 'controller keyPress:key x:x y:y' |
|
311 |
view has no controller |
|
312 |
view has transformation |
|
313 |
----> 'view deviceKeyPress:key x:x y:y' |
|
314 |
inverse transform x/y |
|
315 |
----> 'self keyPress:key x:xLogical y:yLogical' |
|
316 |
view has no transformation |
|
317 |
----> 'view keyPress:key x:x y:y' |
|
598 | 318 |
|
612 | 319 |
[author:] |
5752 | 320 |
Claus Gittinger |
612 | 321 |
|
598 | 322 |
[see also:] |
5752 | 323 |
WindowGroup WindowSensor |
324 |
DeviceWorkstation View |
|
325 |
KeyboardMap KeyboardForwarder EventListener |
|
598 | 326 |
|
46 | 327 |
" |
328 |
! ! |
|
329 |
||
11 | 330 |
!WindowEvent class methodsFor:'instance creation'! |
331 |
||
4960 | 332 |
buttonMotion:buttonAndModifierState x:x y:y view:aView |
3680 | 333 |
^ (ButtonMotionEvent new) |
334 |
for:aView |
|
335 |
type:#buttonMotion:x:y: |
|
4960 | 336 |
arguments:(Array with:buttonAndModifierState with:x with:y) |
3680 | 337 |
! |
338 |
||
339 |
buttonMultiPress:button x:x y:y view:aView |
|
340 |
^ (ButtonMultiPressEvent new) |
|
341 |
for:aView |
|
342 |
type:#buttonMultiPress:x:y: |
|
343 |
arguments:(Array with:button with:x with:y) |
|
344 |
! |
|
345 |
||
346 |
buttonPress:button x:x y:y view:aView |
|
347 |
^ (ButtonPressEvent new) |
|
348 |
for:aView |
|
349 |
type:#buttonPress:x:y: |
|
350 |
arguments:(Array with:button with:x with:y) |
|
351 |
! |
|
352 |
||
353 |
buttonRelease:button x:x y:y view:aView |
|
354 |
^ (ButtonReleaseEvent new) |
|
355 |
for:aView |
|
356 |
type:#buttonRelease:x:y: |
|
357 |
arguments:(Array with:button with:x with:y) |
|
358 |
! |
|
359 |
||
360 |
clientMessageEvent:type format:format eventData:data view:aView |
|
5000
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
361 |
"this one is only used with X-Windows" |
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
362 |
|
3680 | 363 |
^ ClientEvent |
364 |
for:aView |
|
365 |
type:#clientMessage:format:eventData: |
|
366 |
arguments:(Array with:type with:format with:data) |
|
367 |
! |
|
368 |
||
369 |
configureX:x y:y width:w height:h view:aView |
|
370 |
^ ConfigureEvent |
|
371 |
for:aView |
|
372 |
type:#configureX:y:width:height: |
|
373 |
arguments:(Array with:x with:y with:w with:h) |
|
374 |
! |
|
375 |
||
5020
f8ba55bc9b95
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5000
diff
changeset
|
376 |
copyDataEvent:parameter eventData:data view:aView |
5000
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
377 |
"this one is only used with Win32" |
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
378 |
|
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
379 |
^ ClientEvent |
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
380 |
for:aView |
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
381 |
type:#copyDataEvent:eventData: |
5020
f8ba55bc9b95
changed #copyDataEvent:eventData:view:
Claus Gittinger <cg@exept.de>
parents:
5000
diff
changeset
|
382 |
arguments:(Array with:parameter with:data) |
5000
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
383 |
! |
e0ec909988e9
hooks for client and copyData events
Claus Gittinger <cg@exept.de>
parents:
4991
diff
changeset
|
384 |
|
3680 | 385 |
coveredBy:coveringSiblingView view:coveredView |
386 |
^ (WindowEvent basicNew) |
|
387 |
for:coveredView |
|
388 |
type:#coveredBy: |
|
389 |
arguments:(Array with:coveringSiblingView) |
|
390 |
! |
|
391 |
||
5751 | 392 |
createWindow:view x:x y:y width:w height:h |
393 |
||
394 |
^ (self basicNew) |
|
395 |
for: view |
|
396 |
type:#createWindowX:y:width:height: |
|
397 |
arguments: (Array with: x with: y with: w with: h) |
|
398 |
||
399 |
"Created: / 30-05-2011 / 19:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
400 |
"Modified: / 01-06-2011 / 13:05:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
401 |
! |
|
402 |
||
244 | 403 |
damageFor:aView rectangle:aRectangle |
404 |
"create and return a new damage Event for aRectangle |
|
405 |
in aView" |
|
11 | 406 |
|
4044 | 407 |
^ DamageEvent for:aView type:#damage arguments:aRectangle |
3680 | 408 |
! |
409 |
||
410 |
destroyedView:aView |
|
411 |
^ (self basicNew) |
|
412 |
for:aView |
|
413 |
type:#destroyed |
|
414 |
! |
|
415 |
||
4459 | 416 |
dropFiles:files view:view position:dropPositionOrNil handle:dropHandleOrNil |
4648
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
417 |
^ self |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
418 |
dropMessage:(self dropType_files) |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
419 |
data:files |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
420 |
view:view |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
421 |
position:dropPositionOrNil |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
422 |
handle:dropHandleOrNil |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
423 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
424 |
"Modified: / 13-10-2006 / 10:11:47 / cg" |
4456 | 425 |
! |
426 |
||
4459 | 427 |
dropMessage:dropTypeSymbol data:dropValue view:aView position:positionOrNil handle:dropHandleOrNil |
3680 | 428 |
^ DropEvent |
429 |
for:aView |
|
4461 | 430 |
type:#dropMessage:data:position:handle: |
4458 | 431 |
arguments:(Array with:dropTypeSymbol with:dropValue with:positionOrNil with:dropHandleOrNil) |
3680 | 432 |
! |
433 |
||
434 |
focusInView:aView |
|
435 |
^ FocusEvent |
|
436 |
for:aView |
|
437 |
type:#focusIn |
|
438 |
! |
|
439 |
||
440 |
focusOutView:aView |
|
441 |
^ FocusEvent |
|
442 |
for:aView |
|
443 |
type:#focusOut |
|
444 |
! |
|
445 |
||
5962 | 446 |
hotkeyWithId:aHotkeyId rawKey:keyWithModifier view:aView |
447 |
||
448 |
|ev| |
|
449 |
||
450 |
ev := (HotKeyEvent new) |
|
451 |
for:aView |
|
452 |
type:#hotkeyWithId:rawKey: |
|
453 |
arguments:(Array with:keyWithModifier with:0 with:0). |
|
454 |
ev rawKey:keyWithModifier. |
|
455 |
ev hotkeyIdentifier:aHotkeyId. |
|
456 |
^ ev |
|
457 |
! |
|
458 |
||
3680 | 459 |
keyPress:key rawKey:untranslatedKey |
460 |
hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown |
|
461 |
button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown |
|
462 |
x:x y:y view:aView |
|
244 | 463 |
|
3680 | 464 |
|ev| |
465 |
||
466 |
ev := self keyPress:key x:x y:y view:aView. |
|
467 |
ev rawKey:untranslatedKey. |
|
468 |
ev hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown |
|
469 |
button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown. |
|
470 |
^ ev |
|
471 |
! |
|
472 |
||
473 |
keyPress:key x:x y:y view:aView |
|
474 |
^ (KeyPressEvent new) |
|
475 |
for:aView |
|
476 |
type:#keyPress:x:y: |
|
477 |
arguments:(Array with:key with:x with:y) |
|
478 |
! |
|
479 |
||
480 |
keyRelease:key rawKey:untranslatedKey |
|
481 |
hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown |
|
482 |
button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown |
|
483 |
x:x y:y view:aView |
|
484 |
||
485 |
|ev| |
|
486 |
||
487 |
ev := self keyRelease:key x:x y:y view:aView. |
|
488 |
ev rawKey:untranslatedKey. |
|
489 |
ev hasShift:shiftDown ctrl:ctrlDown alt:altDown meta:metaDown |
|
490 |
button1:leftButtonDown button2:middleButtonDown button3:rightButtonDown. |
|
491 |
^ ev |
|
492 |
! |
|
493 |
||
494 |
keyRelease:key x:x y:y view:aView |
|
495 |
^ (KeyReleaseEvent new) |
|
496 |
for:aView |
|
497 |
type:#keyRelease:x:y: |
|
498 |
arguments:(Array with:key with:x with:y) |
|
46 | 499 |
! |
500 |
||
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
501 |
keyboardFocus:arg view:aView |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
502 |
|
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
503 |
^ KeyboardFocusEvent |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
504 |
for:aView type:#hasKeyboardFocus: arguments:(Array with:arg). |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
505 |
! |
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
506 |
|
3680 | 507 |
mappedView:aView |
508 |
^ WindowMapUnmapEvent |
|
509 |
for:aView |
|
510 |
type:#mapped |
|
511 |
! |
|
512 |
||
513 |
messageSend:receiver selector:aSelector arguments:arguments |
|
8991 | 514 |
"create and return a new messageSend for sending |
515 |
aSelector-message with arguments to receiver. |
|
516 |
Usually, these are placed into the eventQueue, to ensure synchronized operation of change-update notifications" |
|
517 |
||
518 |
^ MessageSendEvent for:receiver type:aSelector arguments:arguments |
|
3680 | 519 |
! |
72 | 520 |
|
3680 | 521 |
mouseWheelMotion:state x:x y:y amount:amount deltaTime:deltaTime view:aView |
4988 | 522 |
^ MouseWheelMotionEvent |
3680 | 523 |
for:aView |
524 |
type:#mouseWheelMotion:x:y:amount:deltaTime: |
|
525 |
arguments:(Array with:state with:x with:y with:amount with:deltaTime). |
|
526 |
! |
|
527 |
||
4233 | 528 |
nativeWidgetCommand:command arguments:argVector view:aView |
4144 | 529 |
^ (NativeWidgetCommandEvent new) |
530 |
for:aView |
|
4233 | 531 |
type:command |
532 |
arguments:argVector |
|
4144 | 533 |
! |
534 |
||
4044 | 535 |
newDamageFor:aView |
536 |
"create and return a new damage Event for aView" |
|
537 |
||
538 |
^ NewDamageEvent for:aView type:#newDamage |
|
539 |
! |
|
540 |
||
3680 | 541 |
pasteFromClipBoard:something view:aView |
542 |
^ (self basicNew) |
|
543 |
for:aView |
|
544 |
type:#pasteFromClipBoard: |
|
545 |
arguments:(Array with:something). |
|
546 |
! |
|
547 |
||
548 |
pointerEnter:state x:x y:y view:aView |
|
549 |
^ EnterLeaveEvent |
|
550 |
for:aView |
|
551 |
type:#pointerEnter:x:y: |
|
552 |
arguments:(Array with:state with:x with:y). |
|
72 | 553 |
! |
554 |
||
3680 | 555 |
pointerLeave:state view:aView |
556 |
^ EnterLeaveEvent |
|
557 |
for:aView |
|
558 |
type:#pointerLeave: |
|
559 |
arguments:(Array with:state). |
|
560 |
! |
|
561 |
||
562 |
postViewCreateNotification:aView |
|
563 |
^ (self basicNew) |
|
564 |
for:aView |
|
565 |
type:#postCreateView |
|
566 |
! |
|
28 | 567 |
|
3680 | 568 |
preViewCreateNotification:aView |
569 |
^ (self basicNew) |
|
570 |
for:aView |
|
571 |
type:#preCreateView |
|
572 |
! |
|
573 |
||
5751 | 574 |
propertyChange:view property:propertyId state:aSymbol time:time |
575 |
^ (self basicNew) |
|
576 |
for: view |
|
577 |
type:#propertyChange:state: |
|
578 |
arguments: (Array with: propertyId with: aSymbol) |
|
579 |
||
580 |
"Created: / 01-06-2011 / 13:36:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
581 |
! |
|
582 |
||
3680 | 583 |
saveAndTerminateView:aView |
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
584 |
^ (TerminateEvent basicNew) |
3680 | 585 |
for:aView |
586 |
type:#saveAndTerminate |
|
587 |
! |
|
588 |
||
589 |
terminateView:aView |
|
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
590 |
^ (TerminateEvent basicNew) |
3680 | 591 |
for:aView |
592 |
type:#terminate |
|
593 |
! |
|
594 |
||
4817 | 595 |
trayAction:event arguments:argVector view:aView |
596 |
^ (TrayActionEvent new) |
|
597 |
for:aView |
|
598 |
type:event |
|
599 |
arguments:argVector |
|
600 |
||
601 |
"Created: / 31-10-2007 / 01:23:53 / cg" |
|
602 |
! |
|
603 |
||
3680 | 604 |
unmappedView:aView |
605 |
^ WindowMapUnmapEvent |
|
606 |
for:aView |
|
607 |
type:#unmapped |
|
5838
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
608 |
! |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
609 |
|
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
610 |
visibilityOf:aView changedTo:how |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
611 |
^ EnterLeaveEvent |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
612 |
for:aView |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
613 |
type:#visibilityChange: |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
614 |
arguments:(Array with:how). |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
615 |
|
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
616 |
"Created: / 23-01-2012 / 09:51:03 / cg" |
28 | 617 |
! ! |
618 |
||
8626 | 619 |
!WindowEvent class methodsFor:'class access'! |
620 |
||
621 |
buttonMotionEvent |
|
622 |
^ ButtonMotionEvent |
|
623 |
||
624 |
"Created: / 13-02-2019 / 12:55:25 / Claus Gittinger" |
|
625 |
! |
|
626 |
||
627 |
buttonPressEvent |
|
628 |
^ ButtonPressEvent |
|
629 |
||
630 |
"Created: / 13-02-2019 / 12:54:38 / Claus Gittinger" |
|
631 |
! |
|
632 |
||
633 |
buttonReleaseEvent |
|
634 |
^ ButtonReleaseEvent |
|
635 |
||
636 |
"Created: / 13-02-2019 / 12:54:31 / Claus Gittinger" |
|
637 |
! ! |
|
638 |
||
4648
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
639 |
!WindowEvent class methodsFor:'constants'! |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
640 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
641 |
dropType_directory |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
642 |
^ #directory |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
643 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
644 |
"Created: / 13-10-2006 / 10:08:59 / cg" |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
645 |
! |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
646 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
647 |
dropType_file |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
648 |
^ #file |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
649 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
650 |
"Created: / 13-10-2006 / 10:08:52 / cg" |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
651 |
! |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
652 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
653 |
dropType_files |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
654 |
^ #files |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
655 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
656 |
"Created: / 13-10-2006 / 10:09:04 / cg" |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
657 |
! |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
658 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
659 |
dropType_text |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
660 |
^ #text |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
661 |
|
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
662 |
"Created: / 13-10-2006 / 10:09:36 / cg" |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
663 |
! ! |
87368f2f69fc
eliminated magic symbol constants
Claus Gittinger <cg@exept.de>
parents:
4628
diff
changeset
|
664 |
|
5929 | 665 |
!WindowEvent class methodsFor:'instance creation-basic'! |
3680 | 666 |
|
667 |
for:aView type:aSymbol |
|
668 |
"create and return a new windowEvent for sending |
|
669 |
aSymbol-message with no arguments to aView" |
|
670 |
||
8991 | 671 |
self == WindowEvent ifTrue:[ |
672 |
'----------------' errorPrint. |
|
673 |
'WindowEvent is abstract - use/add explicit creation message' errorPrintCR. |
|
674 |
thisContext fullPrintAll. |
|
675 |
self abstractClassInstantiationError. |
|
676 |
]. |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
677 |
^ self new for:aView type:aSymbol |
3680 | 678 |
! |
679 |
||
680 |
for:aView type:aSymbol arguments:argArray |
|
681 |
"create and return a new windowEvent for sending |
|
682 |
aSymbol-message with arguments to aView" |
|
683 |
||
8991 | 684 |
self == WindowEvent ifTrue:[ |
685 |
'----------------' errorPrint. |
|
686 |
'WindowEvent is abstract - use/add explicit creation message' errorPrintCR. |
|
687 |
thisContext fullPrintAll. |
|
688 |
self abstractClassInstantiationError. |
|
689 |
]. |
|
3856
45fccc92d834
Use SynchronousWindoeSensor if no windowGroup
Stefan Vogel <sv@exept.de>
parents:
3773
diff
changeset
|
690 |
^ self new for:aView type:aSymbol arguments:argArray |
3680 | 691 |
! |
692 |
||
693 |
new |
|
694 |
self == WindowEvent ifTrue:[ |
|
5929 | 695 |
'----------------' errorPrint. |
696 |
'WindowEvent is abstract - use/add explicit creation message' errorPrintCR. |
|
697 |
thisContext fullPrintAll. |
|
5949 | 698 |
self abstractClassInstantiationError. |
3680 | 699 |
]. |
700 |
^ super new |
|
5929 | 701 |
|
702 |
"Modified (format): / 31-08-2012 / 19:44:41 / cg" |
|
3680 | 703 |
! ! |
704 |
||
244 | 705 |
!WindowEvent methodsFor:'accessing'! |
706 |
||
3465 | 707 |
consumed |
708 |
"return the value of the instance variable 'consumed' (automatically generated)" |
|
709 |
||
710 |
^ consumed |
|
711 |
! |
|
712 |
||
713 |
consumed:aBoolean |
|
714 |
"set the value of the instance variable 'consumed' (automatically generated)" |
|
715 |
||
716 |
consumed := aBoolean. |
|
717 |
! |
|
718 |
||
3089 | 719 |
delegatedFrom |
720 |
"return the value of the instance variable 'delegatedFrom' (automatically generated)" |
|
721 |
||
3376 | 722 |
^ delegatedFrom |
723 |
! |
|
3089 | 724 |
|
8805 | 725 |
delegatedFrom:someOne |
3089 | 726 |
"set the value of the instance variable 'delegatedFrom' (automatically generated)" |
727 |
||
8805 | 728 |
delegatedFrom := someOne. |
3376 | 729 |
! |
3089 | 730 |
|
244 | 731 |
key |
1841 | 732 |
"return the key - nil is returned here. |
733 |
This is redefined in KeyboardEvent." |
|
244 | 734 |
|
735 |
^ nil |
|
1841 | 736 |
|
737 |
"Created: 1.8.1997 / 13:56:21 / cg" |
|
244 | 738 |
! |
739 |
||
740 |
rectangle |
|
741 |
"return the damage rectangle" |
|
742 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
743 |
^ args "consider this a kludge" |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
744 |
! |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
745 |
|
244 | 746 |
type |
747 |
"return the type of the event" |
|
748 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
749 |
^ selector |
244 | 750 |
! |
751 |
||
752 |
view |
|
753 |
"return the view, for which the event is for" |
|
754 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
755 |
^ receiver |
244 | 756 |
! |
757 |
||
758 |
view:aView |
|
759 |
"set the view, for which the event is for" |
|
760 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
761 |
receiver := aView |
3089 | 762 |
! |
763 |
||
764 |
x |
|
765 |
"the x coordinate - if any. |
|
766 |
nil returned for all but button- and keyEvents" |
|
767 |
||
768 |
^ nil |
|
769 |
! |
|
770 |
||
771 |
x:ignoredInteger |
|
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
772 |
"set the x coordinate - ignored here. |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
773 |
only for button- and keyEvents" |
3089 | 774 |
! |
775 |
||
776 |
y |
|
777 |
"the y coordinate - if any. |
|
778 |
nil returned for all but button- and keyEvents" |
|
779 |
||
780 |
^ nil |
|
781 |
! |
|
782 |
||
783 |
y:ignoredInteger |
|
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
784 |
"set the y coordinate - ignored here. |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
785 |
only for button- and keyEvents" |
244 | 786 |
! ! |
787 |
||
3011 | 788 |
!WindowEvent methodsFor:'dispatching'! |
789 |
||
790 |
dispatchTo:anObject |
|
791 |
"send this event to anObject" |
|
792 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
793 |
^ anObject perform:selector withArguments:args |
3011 | 794 |
! |
795 |
||
796 |
dispatchWithViewArgumentTo:anObject |
|
797 |
"send this event to anObject, and pass an additional view argument" |
|
798 |
||
8797 | 799 |
args size == 0 ifTrue:[ |
3011 | 800 |
^ anObject |
6312 | 801 |
perform:selector asMutator |
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
802 |
with:receiver |
3011 | 803 |
]. |
804 |
||
805 |
^ anObject |
|
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
806 |
perform:(selector , 'view:') asSymbol |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
807 |
withArguments:(args copyWith:receiver) |
3011 | 808 |
! ! |
809 |
||
511
233dabfcc81c
added #displayString (for eventTracing)
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
810 |
!WindowEvent methodsFor:'printing & storing'! |
233dabfcc81c
added #displayString (for eventTracing)
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
811 |
|
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
812 |
displayOn:aGCOrStream |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
813 |
"Compatibility |
7932 | 814 |
append a printed desription on some stream (Dolphin, Squeak) |
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
815 |
OR: |
7932 | 816 |
display the receiver in a graphicsContext at 0@0 (ST80). |
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
817 |
This method allows for any object to be displayed in some view |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
818 |
(although the fallBack is to display its printString ...)" |
1905 | 819 |
|
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
820 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
7932 | 821 |
"/ old ST80 means: draw-yourself on a GC. |
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
822 |
aGCOrStream isStream ifFalse:[ |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
823 |
^ super displayOn:aGCOrStream. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
824 |
]. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
825 |
|
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
826 |
aGCOrStream |
8716 | 827 |
nextPutAll:self className; |
5925
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
828 |
nextPut:$(. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
829 |
|
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
830 |
selector storeOn:aGCOrStream. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
831 |
aGCOrStream |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
832 |
nextPutAll:' view: '; |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
833 |
nextPutAll:receiver class name; |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
834 |
nextPutAll:' args: '. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
835 |
|
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
836 |
args displayOn:aGCOrStream. |
a3db9f9f6502
Implement #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5838
diff
changeset
|
837 |
aGCOrStream nextPut:$) |
511
233dabfcc81c
added #displayString (for eventTracing)
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
838 |
|
7932 | 839 |
"Created: / 07-03-1996 / 14:55:50 / cg" |
840 |
"Modified: / 20-09-1997 / 11:42:11 / cg" |
|
841 |
"Modified (comment): / 22-02-2017 / 16:53:02 / cg" |
|
8716 | 842 |
"Modified: / 28-06-2019 / 09:23:38 / Claus Gittinger" |
511
233dabfcc81c
added #displayString (for eventTracing)
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
843 |
! ! |
233dabfcc81c
added #displayString (for eventTracing)
Claus Gittinger <cg@exept.de>
parents:
356
diff
changeset
|
844 |
|
3879 | 845 |
!WindowEvent methodsFor:'private-accessing'! |
244 | 846 |
|
3680 | 847 |
for:aView type:aSymbol |
848 |
"set the instance variables of the event" |
|
849 |
||
850 |
receiver := aView. |
|
851 |
selector := aSymbol. |
|
4991 | 852 |
args := #(). |
853 |
timeStamp := Timestamp now. |
|
3680 | 854 |
! |
855 |
||
244 | 856 |
for:aView type:aSymbol arguments:argArray |
857 |
"set the instance variables of the event" |
|
858 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
859 |
receiver := aView. |
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
860 |
selector := aSymbol. |
4991 | 861 |
args := argArray. |
862 |
timeStamp := Timestamp now. |
|
244 | 863 |
! ! |
864 |
||
865 |
!WindowEvent methodsFor:'queries'! |
|
866 |
||
1588
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
867 |
hasAlt |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
868 |
"return true, if this is a keyboard event, with ALT pressed" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
869 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
870 |
^ false |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
871 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
872 |
"Created: 12.4.1997 / 11:04:10 / cg" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
873 |
! |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
874 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
875 |
hasCtrl |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
876 |
"return true, if this is a keyboard event, with CTRL pressed" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
877 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
878 |
^ false |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
879 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
880 |
"Created: 12.4.1997 / 11:04:03 / cg" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
881 |
! |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
882 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
883 |
hasMeta |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
884 |
"return true, if this is a keyboard event, with META pressed" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
885 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
886 |
^ false |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
887 |
|
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
888 |
"Created: 12.4.1997 / 11:04:16 / cg" |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
889 |
! |
8f9468059ef7
keep modifierKey information in keyboardEvents
Claus Gittinger <cg@exept.de>
parents:
1541
diff
changeset
|
890 |
|
1590 | 891 |
hasShift |
892 |
"return true, if this is a keyboard event, with SHIFT pressed" |
|
893 |
||
894 |
^ false |
|
895 |
||
896 |
"Created: 12.4.1997 / 11:30:59 / cg" |
|
897 |
! |
|
898 |
||
5249 | 899 |
targetView |
900 |
"return the view which will eventually handle the event; |
|
901 |
for most events, this is the same as the view, for which the event was |
|
902 |
originally generated. |
|
903 |
Except, if an explicit focus has been assigned (i.e. tabbed into a component), |
|
904 |
AND the event is a keyboard event. In this case, the targetView might be different. |
|
905 |
Notice: this method might return nil, for synthetic (app-related) or display screen related |
|
906 |
events" |
|
907 |
||
908 |
^ self view. |
|
909 |
! ! |
|
910 |
||
911 |
!WindowEvent methodsFor:'testing'! |
|
912 |
||
3680 | 913 |
isApplicationEvent |
914 |
"return true, if this event is application related (i.e. not for a particular view)" |
|
915 |
||
916 |
^ false |
|
917 |
! |
|
918 |
||
244 | 919 |
isButtonEvent |
920 |
"return true, if this event is a button event" |
|
921 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
922 |
^ false |
244 | 923 |
! |
924 |
||
1730 | 925 |
isButtonMotionEvent |
926 |
"return true, if this event is a buttonMotion event" |
|
927 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
928 |
^ false |
1730 | 929 |
|
930 |
"Created: 5.3.1997 / 12:25:43 / cg" |
|
931 |
! |
|
932 |
||
4628 | 933 |
isButtonMultiPressEvent |
934 |
"return true, if this event is a buttonMulti-Press event" |
|
935 |
||
936 |
^ false |
|
937 |
||
938 |
"Created: 5.3.1997 / 12:25:43 / cg" |
|
939 |
! |
|
940 |
||
1420 | 941 |
isButtonPressEvent |
942 |
"return true, if this event is a buttonPress event" |
|
943 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
944 |
^ false |
1420 | 945 |
|
946 |
"Created: 5.3.1997 / 12:25:43 / cg" |
|
947 |
! |
|
948 |
||
3011 | 949 |
isButtonReleaseEvent |
950 |
"return true, if this event is a buttonPress event" |
|
951 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
952 |
^ false |
3011 | 953 |
|
954 |
"Created: 5.3.1997 / 12:25:43 / cg" |
|
955 |
! |
|
956 |
||
2811 | 957 |
isConfigureEvent |
3680 | 958 |
"return true, if this is a window geometry change event" |
2811 | 959 |
|
3680 | 960 |
^ false. |
2811 | 961 |
! |
962 |
||
5751 | 963 |
isCreateWindowEvent |
964 |
"return true, if this event is a CreateWindow event" |
|
965 |
||
966 |
^selector == #createWindowX:y:width:height: |
|
967 |
||
968 |
"Created: / 01-06-2011 / 13:01:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
969 |
! |
|
970 |
||
244 | 971 |
isDamage |
972 |
"return true, if this is a damage event" |
|
973 |
||
3680 | 974 |
^ false. |
244 | 975 |
! |
976 |
||
2471 | 977 |
isDamageForView:aView |
3680 | 978 |
"return true, if this is a damage event for a View" |
2471 | 979 |
|
3680 | 980 |
^ false. |
2471 | 981 |
! |
982 |
||
5204
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
983 |
isDelegatedToFocusView |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
984 |
"return true, if this event will be forwarded to a focusView." |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
985 |
|
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
986 |
^ false. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
987 |
! |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
988 |
|
1420 | 989 |
isFocusEvent |
990 |
"return true, if this event is a focusIn/focusOut event" |
|
991 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
992 |
^ false |
1420 | 993 |
|
994 |
"Created: 5.3.1997 / 12:12:37 / cg" |
|
995 |
! |
|
996 |
||
997 |
isFocusInEvent |
|
998 |
"return true, if this event is a focusIn event" |
|
999 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1000 |
^ false |
1420 | 1001 |
|
1002 |
"Created: 5.3.1997 / 12:18:10 / cg" |
|
1003 |
! |
|
1004 |
||
4980 | 1005 |
isFocusOutEvent |
1006 |
"return true, if this event is a focusOut event" |
|
1007 |
||
1008 |
^ false |
|
1009 |
||
1010 |
"Created: 5.3.1997 / 12:18:10 / cg" |
|
1011 |
! |
|
1012 |
||
5962 | 1013 |
isHotKeyEvent |
1014 |
"return true, if this event is a hotkey event" |
|
1015 |
||
1016 |
^ false |
|
1017 |
! |
|
1018 |
||
2707 | 1019 |
isInputEvent |
1020 |
"return true, if this event is an input (pointer, key or button) event" |
|
1021 |
||
1022 |
^ false |
|
1023 |
||
1024 |
"Created: / 21.5.1999 / 19:49:42 / cg" |
|
1025 |
"Modified: / 21.5.1999 / 19:50:11 / cg" |
|
1026 |
! |
|
1027 |
||
244 | 1028 |
isKeyEvent |
1029 |
"return true, if this event is a keyboard event" |
|
1030 |
||
2028 | 1031 |
^ false |
1032 |
||
1033 |
"Modified: / 28.1.1998 / 00:03:17 / cg" |
|
244 | 1034 |
! |
1035 |
||
1036 |
isKeyPressEvent |
|
2028 | 1037 |
"return true, if this event is a keyboard press event" |
1038 |
||
1039 |
^ false |
|
1040 |
||
1041 |
"Modified: / 28.1.1998 / 00:03:24 / cg" |
|
1042 |
! |
|
244 | 1043 |
|
2028 | 1044 |
isKeyReleaseEvent |
1045 |
"return true, if this event is a keyboard release event" |
|
1046 |
||
1047 |
^ false |
|
1048 |
||
1049 |
"Modified: / 28.1.1998 / 00:03:31 / cg" |
|
356 | 1050 |
! |
1051 |
||
3376 | 1052 |
isKeyboardFocusEvent |
1053 |
"return true, if this event is a keyboard focus event" |
|
1054 |
||
1055 |
^ false |
|
1056 |
! |
|
1057 |
||
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1058 |
isMapEvent |
4842 | 1059 |
"return true, if this is a map event" |
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1060 |
|
3680 | 1061 |
^ false |
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1062 |
|
4842 | 1063 |
"Created: / 29-01-1998 / 21:52:54 / cg" |
1064 |
"Modified: / 09-11-2007 / 13:10:25 / cg" |
|
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1065 |
! |
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1066 |
|
3297 | 1067 |
isMessageSendEvent |
1068 |
"return true, if this event is a general messageSend event" |
|
1069 |
||
1070 |
^ false |
|
1071 |
! |
|
1072 |
||
3011 | 1073 |
isMouseWheelEvent |
3680 | 1074 |
^ false |
3011 | 1075 |
! |
1076 |
||
356 | 1077 |
isPointerEnterEvent |
1078 |
"return true, if this event is a pointer-enter event" |
|
1079 |
||
3680 | 1080 |
^ false |
356 | 1081 |
|
1082 |
"Created: 9.1.1996 / 15:51:24 / cg" |
|
1083 |
"Modified: 9.1.1996 / 15:51:40 / cg" |
|
1084 |
! |
|
1085 |
||
1086 |
isPointerEnterLeaveEvent |
|
1087 |
"return true, if this event is a pointer-enter/leave event" |
|
1088 |
||
3680 | 1089 |
^ false |
356 | 1090 |
|
1091 |
"Created: 9.1.1996 / 15:51:18 / cg" |
|
1092 |
! |
|
1093 |
||
1094 |
isPointerLeaveEvent |
|
1095 |
"return true, if this event is a pointer-leave event" |
|
1096 |
||
3680 | 1097 |
^ false |
356 | 1098 |
|
1099 |
"Created: 9.1.1996 / 15:51:36 / cg" |
|
1158 | 1100 |
! |
1101 |
||
5751 | 1102 |
isPropertyChangeEvent |
1103 |
"return true, if this event is a CreateWindow event" |
|
1104 |
||
1105 |
^selector == #propertyChange:state: |
|
1106 |
||
1107 |
"Created: / 01-06-2011 / 13:36:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1108 |
! |
|
1109 |
||
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1110 |
isTerminateEvent |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1111 |
^ false |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1112 |
! |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1113 |
|
4842 | 1114 |
isTrayEvent |
1115 |
"return true, if this is an event from the tray (WIN32 only, for now)" |
|
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1116 |
|
3680 | 1117 |
^ false |
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1118 |
|
4842 | 1119 |
"Created: / 09-11-2007 / 13:09:29 / cg" |
1120 |
! |
|
1121 |
||
1122 |
isUnmapEvent |
|
1123 |
"return true, if this is an unmap event" |
|
1124 |
||
1125 |
^ false |
|
1126 |
||
1127 |
"Modified: / 09-11-2007 / 13:10:07 / cg" |
|
2034
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1128 |
! |
9fd5b2a4d315
added isMapEvent / isUnmapEvent
Claus Gittinger <cg@exept.de>
parents:
2028
diff
changeset
|
1129 |
|
1158 | 1130 |
isUserEvent |
1131 |
"return true, if this event is a user event (i.e. mouse, keyboard or button)" |
|
1132 |
||
1133 |
^ false |
|
1134 |
||
8308 | 1135 |
"Modified: / 05-03-1997 / 11:27:40 / cg" |
1136 |
"Modified: / 16-03-2018 / 11:07:59 / stefan" |
|
244 | 1137 |
! ! |
1138 |
||
3680 | 1139 |
!WindowEvent::ApplicationEvent methodsFor:'blocked'! |
1140 |
||
1141 |
view |
|
1142 |
^ nil |
|
1143 |
! ! |
|
1144 |
||
5249 | 1145 |
!WindowEvent::ApplicationEvent methodsFor:'testing'! |
3680 | 1146 |
|
1147 |
isApplicationEvent |
|
1148 |
^ true |
|
1149 |
! ! |
|
1150 |
||
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1151 |
!WindowEvent::InputEvent class methodsFor:'class initialization'! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1152 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1153 |
initialize |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1154 |
F_SHIFT := 16r001. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1155 |
F_CTRL := 16r002. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1156 |
F_ALT := 16r004. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1157 |
F_META := 16r008. |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1158 |
|
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1159 |
F_BUTTON1 := 16r100. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1160 |
F_BUTTON2 := 16r200. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1161 |
F_BUTTON3 := 16r400. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1162 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1163 |
" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1164 |
self initialize |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1165 |
" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1166 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1167 |
"Modified: 13.8.1997 / 22:16:17 / cg" |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1168 |
! ! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1169 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1170 |
!WindowEvent::InputEvent methodsFor:'accessing'! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1171 |
|
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1172 |
hasShift:shift ctrl:ctrl alt:alt meta:meta button1:b1 button2:b2 button3:b3 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1173 |
|f "{ Class: SmallInteger }"| |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1174 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1175 |
f := 0. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1176 |
shift ifTrue:[f := f bitOr:F_SHIFT]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1177 |
ctrl ifTrue:[f := f bitOr:F_CTRL]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1178 |
alt ifTrue:[f := f bitOr:F_ALT]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1179 |
meta ifTrue:[f := f bitOr:F_META]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1180 |
b1 ifTrue:[f := f bitOr:F_BUTTON1]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1181 |
b2 ifTrue:[f := f bitOr:F_BUTTON2]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1182 |
b3 ifTrue:[f := f bitOr:F_BUTTON3]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1183 |
modifierFlags := f. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1184 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1185 |
"Created: 13.8.1997 / 22:17:56 / cg" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1186 |
! |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1187 |
|
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1188 |
hasShift:shift hasCtrl:ctrl hasAlt:alt hasMeta:meta |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1189 |
|f "{ Class: SmallInteger }"| |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1190 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1191 |
f := 0. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1192 |
shift ifTrue:[f := f bitOr:F_SHIFT]. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1193 |
ctrl ifTrue:[f := f bitOr:F_CTRL]. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1194 |
alt ifTrue:[f := f bitOr:F_ALT]. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1195 |
meta ifTrue:[f := f bitOr:F_META]. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1196 |
modifierFlags := f. |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1197 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1198 |
"Created: 13.8.1997 / 22:02:09 / cg" |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1199 |
! |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1200 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1201 |
hasShift:shift hasCtrl:ctrl hasAlt:alt hasMeta:meta hasButton1:b1 hasButton2:b2 hasButton3:b3 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1202 |
|f "{ Class: SmallInteger }"| |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1203 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1204 |
f := 0. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1205 |
shift ifTrue:[f := f bitOr:F_SHIFT]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1206 |
ctrl ifTrue:[f := f bitOr:F_CTRL]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1207 |
alt ifTrue:[f := f bitOr:F_ALT]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1208 |
meta ifTrue:[f := f bitOr:F_META]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1209 |
b1 ifTrue:[f := f bitOr:F_BUTTON1]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1210 |
b2 ifTrue:[f := f bitOr:F_BUTTON2]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1211 |
b3 ifTrue:[f := f bitOr:F_BUTTON3]. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1212 |
modifierFlags := f. |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1213 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1214 |
"Created: 13.8.1997 / 22:17:25 / cg" |
2761 | 1215 |
! |
1216 |
||
1217 |
modifierFlags |
|
1218 |
^ modifierFlags |
|
1219 |
! |
|
1220 |
||
1221 |
modifierFlags:flagBits |
|
1222 |
modifierFlags := flagBits |
|
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1223 |
! ! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1224 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1225 |
!WindowEvent::InputEvent methodsFor:'queries'! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1226 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1227 |
hasAlt |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1228 |
"return true, if this is an event, with ALT pressed" |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1229 |
|
1885 | 1230 |
modifierFlags isNil ifTrue:[^ false]. |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1231 |
^ (modifierFlags bitAnd:F_ALT) ~~ 0 |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1232 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1233 |
"Created: 13.8.1997 / 22:02:23 / cg" |
1885 | 1234 |
"Modified: 21.8.1997 / 19:41:11 / cg" |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1235 |
! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1236 |
|
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1237 |
hasButton1 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1238 |
"return true, if this is an event, with the left mouse button pressed" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1239 |
|
1885 | 1240 |
modifierFlags isNil ifTrue:[^ false]. |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1241 |
^ (modifierFlags bitAnd:F_BUTTON1) ~~ 0 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1242 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1243 |
"Created: 13.8.1997 / 22:16:35 / cg" |
1885 | 1244 |
"Modified: 21.8.1997 / 19:41:40 / cg" |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1245 |
! |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1246 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1247 |
hasButton2 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1248 |
"return true, if this is an event, with the middle mouse button pressed" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1249 |
|
1885 | 1250 |
modifierFlags isNil ifTrue:[^ false]. |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1251 |
^ (modifierFlags bitAnd:F_BUTTON2) ~~ 0 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1252 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1253 |
"Created: 13.8.1997 / 22:16:43 / cg" |
1885 | 1254 |
"Modified: 21.8.1997 / 19:41:47 / cg" |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1255 |
! |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1256 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1257 |
hasButton3 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1258 |
"return true, if this is an event, with the right mouse button pressed" |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1259 |
|
1885 | 1260 |
modifierFlags isNil ifTrue:[^ false]. |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1261 |
^ (modifierFlags bitAnd:F_BUTTON3) ~~ 0 |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1262 |
|
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1263 |
"Created: 13.8.1997 / 22:16:49 / cg" |
1885 | 1264 |
"Modified: 21.8.1997 / 19:41:52 / cg" |
1862
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1265 |
! |
e56d9a7389bb
also remember buttonStates in keyEvents.
Claus Gittinger <cg@exept.de>
parents:
1861
diff
changeset
|
1266 |
|
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1267 |
hasCtrl |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1268 |
"return true, if this is an event, with CTRL pressed" |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1269 |
|
1885 | 1270 |
modifierFlags isNil ifTrue:[^ false]. |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1271 |
^ (modifierFlags bitAnd:F_CTRL) ~~ 0 |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1272 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1273 |
"Created: 13.8.1997 / 22:02:29 / cg" |
1885 | 1274 |
"Modified: 21.8.1997 / 19:41:21 / cg" |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1275 |
! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1276 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1277 |
hasMeta |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1278 |
"return true, if this is an event, with META pressed" |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1279 |
|
1885 | 1280 |
modifierFlags isNil ifTrue:[^ false]. |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1281 |
^ (modifierFlags bitAnd:F_META) ~~ 0 |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1282 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1283 |
"Created: 13.8.1997 / 22:02:59 / cg" |
1885 | 1284 |
"Modified: 21.8.1997 / 19:41:27 / cg" |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1285 |
! |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1286 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1287 |
hasShift |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1288 |
"return true, if this is an event, with SHIFT pressed" |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1289 |
|
1885 | 1290 |
modifierFlags isNil ifTrue:[^ false]. |
1861
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1291 |
^ (modifierFlags bitAnd:F_SHIFT) ~~ 0 |
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1292 |
|
1b1e49147380
remember shift,meta,alt & ctrl state in buttonEvents
Claus Gittinger <cg@exept.de>
parents:
1841
diff
changeset
|
1293 |
"Created: 13.8.1997 / 22:03:09 / cg" |
1885 | 1294 |
"Modified: 21.8.1997 / 19:41:34 / cg" |
2707 | 1295 |
! |
1296 |
||
5204
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1297 |
targetView |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1298 |
"return the view which will eventually handle the event; |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1299 |
for most events, this is the same as the view, for which the event was |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1300 |
originally generated. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1301 |
Except, if an explicit focus has been assigned (i.e. tabbed into a component), |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1302 |
AND the event is a keyboard event. In this case, the targetView might be different. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1303 |
Notice: this method might return nil, for synthetic (app-related) or display screen related |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1304 |
events" |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1305 |
|
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1306 |
|evView group focusView| |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1307 |
|
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1308 |
evView := self view. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1309 |
self isDelegatedToFocusView ifTrue:[ |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1310 |
evView notNil ifTrue:[ |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1311 |
group := evView windowGroup. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1312 |
group notNil ifTrue:[ |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1313 |
focusView := group focusView. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1314 |
focusView notNil ifTrue:[^ focusView]. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1315 |
]. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1316 |
]. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1317 |
]. |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1318 |
^ evView |
3465 | 1319 |
! ! |
1320 |
||
5249 | 1321 |
!WindowEvent::InputEvent methodsFor:'testing'! |
1322 |
||
1323 |
isInputEvent |
|
1324 |
^ true |
|
1325 |
||
1326 |
"Created: / 21.5.1999 / 19:49:30 / cg" |
|
1327 |
! ! |
|
1328 |
||
3297 | 1329 |
!WindowEvent::ButtonEvent methodsFor:'accessing'! |
1330 |
||
1331 |
button |
|
1332 |
"return the button nr of the button-event" |
|
1333 |
||
1334 |
^ args at:1 |
|
1335 |
! |
|
1336 |
||
1337 |
state |
|
1338 |
"return the button state of the button-event |
|
1339 |
(mouse button bits at the time of the event)." |
|
1340 |
||
1341 |
^ args at:1 |
|
1342 |
||
1343 |
"Created: / 12.11.1998 / 16:21:18 / cg" |
|
1344 |
! |
|
1345 |
||
1346 |
x |
|
1347 |
"return the x coordinate of the button-event |
|
1348 |
(mouse position at the time of the event)." |
|
1349 |
||
1350 |
^ args at:2 |
|
1351 |
||
1352 |
"Created: 1.8.1997 / 13:58:15 / cg" |
|
1353 |
! |
|
1354 |
||
1355 |
x:anInteger |
|
1356 |
"change the x coordinate of the button-event" |
|
1357 |
||
1358 |
args at:2 put:anInteger |
|
1359 |
||
1360 |
"Created: 1.8.1997 / 13:58:15 / cg" |
|
1361 |
! |
|
1362 |
||
1363 |
y |
|
1364 |
"return the y coordinate of the button-event |
|
1365 |
(mouse position at the time of the event)." |
|
1366 |
||
1367 |
^ args at:3 |
|
1368 |
||
1369 |
"Created: 1.8.1997 / 13:58:07 / cg" |
|
1370 |
! |
|
1371 |
||
1372 |
y:anInteger |
|
1373 |
"change the y coordinate of the button-event" |
|
1374 |
||
1375 |
^ args at:3 put:anInteger |
|
1376 |
||
1377 |
"Created: 1.8.1997 / 13:58:15 / cg" |
|
1378 |
! ! |
|
1379 |
||
5249 | 1380 |
!WindowEvent::ButtonEvent methodsFor:'testing'! |
3297 | 1381 |
|
1382 |
isButtonEvent |
|
1383 |
"return true, if this event is a button event" |
|
1384 |
||
1385 |
^ true |
|
1386 |
||
1387 |
"Created: 4.4.1997 / 13:44:11 / cg" |
|
8308 | 1388 |
! |
1389 |
||
1390 |
isUserEvent |
|
1391 |
"return true, if this event from a user" |
|
1392 |
||
1393 |
^ true |
|
1394 |
||
1395 |
"Created: / 16-03-2018 / 11:05:26 / stefan" |
|
3680 | 1396 |
! ! |
1397 |
||
5249 | 1398 |
!WindowEvent::ButtonPressEvent methodsFor:'testing'! |
3680 | 1399 |
|
1400 |
isButtonPressEvent |
|
1401 |
"return true, if this event is a buttonPress event" |
|
1402 |
||
1403 |
^ true |
|
1404 |
! ! |
|
1405 |
||
5249 | 1406 |
!WindowEvent::ButtonMultiPressEvent methodsFor:'testing'! |
3680 | 1407 |
|
4628 | 1408 |
isButtonMultiPressEvent |
1409 |
^ true |
|
1410 |
! |
|
1411 |
||
3680 | 1412 |
isButtonPressEvent |
1413 |
"/ ATTENTION: temporary for bw. compatibility, since due to a bug, |
|
1414 |
"/ multi-presses returned false to this query |
|
1415 |
||
1416 |
"/'----------------' errorPrint. |
|
1417 |
"/'oops multipressEvent asked for isButtonPress' errorPrintCR. |
|
1418 |
"/thisContext fullPrintAll. |
|
1419 |
^ false |
|
1420 |
! ! |
|
1421 |
||
5249 | 1422 |
!WindowEvent::ButtonReleaseEvent methodsFor:'testing'! |
3680 | 1423 |
|
1424 |
isButtonReleaseEvent |
|
1425 |
"return true, if this event is a buttonRelease event" |
|
1426 |
||
1427 |
^ true |
|
1428 |
! ! |
|
1429 |
||
1430 |
!WindowEvent::ClientEvent methodsFor:'accessing'! |
|
1431 |
||
1432 |
eventData |
|
1433 |
"return the value of the instance variable 'eventData' (automatically generated)" |
|
1434 |
||
1435 |
^ eventData |
|
1436 |
||
1437 |
"Created: 4.4.1997 / 17:41:50 / cg" |
|
3297 | 1438 |
! |
1439 |
||
3680 | 1440 |
eventData:something |
1441 |
"set the value of the instance variable 'eventData' (automatically generated)" |
|
1442 |
||
1443 |
eventData := something. |
|
1444 |
||
1445 |
"Created: 4.4.1997 / 17:41:57 / cg" |
|
1446 |
! ! |
|
1447 |
||
5249 | 1448 |
!WindowEvent::ConfigureEvent methodsFor:'testing'! |
3680 | 1449 |
|
1450 |
isConfigureEvent |
|
1451 |
^ true |
|
1452 |
! ! |
|
1453 |
||
5249 | 1454 |
!WindowEvent::DamageEvent methodsFor:'testing'! |
3680 | 1455 |
|
1456 |
isDamage |
|
1457 |
"return true, if this is a damage event" |
|
1458 |
||
1459 |
^ true |
|
1460 |
! |
|
1461 |
||
1462 |
isDamageForView:aView |
|
1463 |
"return true, if this is a damage event for aView" |
|
1464 |
||
1465 |
^ (receiver == aView) |
|
1466 |
! ! |
|
1467 |
||
4988 | 1468 |
!WindowEvent::EnterLeaveEvent methodsFor:'accessing'! |
1469 |
||
1470 |
state |
|
1471 |
||
1472 |
^ args at:1 |
|
1473 |
! |
|
1474 |
||
1475 |
x |
|
1476 |
||
1477 |
^ args at:2 ifAbsent:nil |
|
1478 |
! |
|
1479 |
||
1480 |
y |
|
1481 |
||
1482 |
^ args at:3 ifAbsent:nil |
|
1483 |
! ! |
|
1484 |
||
5249 | 1485 |
!WindowEvent::EnterLeaveEvent methodsFor:'testing'! |
3680 | 1486 |
|
1487 |
isPointerEnterEvent |
|
1488 |
"return true, if this event is a pointer-enter event" |
|
1489 |
||
1490 |
^ (selector == #'pointerEnter:x:y:') |
|
1491 |
||
1492 |
"Created: 9.1.1996 / 15:51:24 / cg" |
|
1493 |
"Modified: 9.1.1996 / 15:51:40 / cg" |
|
1494 |
! |
|
1495 |
||
1496 |
isPointerEnterLeaveEvent |
|
1497 |
"return true, if this event is a pointer-enter/leave event" |
|
1498 |
||
1499 |
^ true |
|
1500 |
||
1501 |
"Created: 9.1.1996 / 15:51:18 / cg" |
|
1502 |
! |
|
1503 |
||
1504 |
isPointerLeaveEvent |
|
1505 |
"return true, if this event is a pointer-leave event" |
|
1506 |
||
1507 |
^ selector == #'pointerLeave:' |
|
1508 |
||
1509 |
"Created: 9.1.1996 / 15:51:36 / cg" |
|
8308 | 1510 |
! |
1511 |
||
1512 |
isUserEvent |
|
1513 |
"return true, if this event from a user" |
|
1514 |
||
1515 |
^ self isPointerEnterEvent |
|
1516 |
"why not true for pointerLeave?" |
|
1517 |
||
1518 |
"Created: / 16-03-2018 / 11:07:04 / stefan" |
|
3680 | 1519 |
! ! |
1520 |
||
5249 | 1521 |
!WindowEvent::FocusEvent methodsFor:'testing'! |
3680 | 1522 |
|
1523 |
isFocusEvent |
|
1524 |
"return true, if this event is a focus event" |
|
1525 |
||
1526 |
^ true |
|
1527 |
||
1528 |
"Created: / 21.5.1999 / 19:44:47 / cg" |
|
1529 |
! |
|
1530 |
||
1531 |
isFocusInEvent |
|
1532 |
"return true, if this event is a focusIn event" |
|
1533 |
||
1534 |
^ (selector == #focusIn) |
|
1535 |
||
1536 |
"Created: / 21.5.1999 / 19:45:04 / cg" |
|
4980 | 1537 |
! |
1538 |
||
1539 |
isFocusOutEvent |
|
1540 |
"return true, if this event is a focusOut event" |
|
1541 |
||
1542 |
^ (selector == #focusOut) |
|
1543 |
||
1544 |
"Created: / 21.5.1999 / 19:45:04 / cg" |
|
3680 | 1545 |
! ! |
1546 |
||
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1547 |
!WindowEvent::KeyboardEvent methodsFor:'accessing'! |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1548 |
|
1841 | 1549 |
key |
1550 |
"return the key of the key-event." |
|
1551 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1552 |
^ args at:1 |
1841 | 1553 |
|
1554 |
"Created: 1.8.1997 / 13:55:19 / cg" |
|
1555 |
! |
|
1556 |
||
2852 | 1557 |
key:aCharacterOrSymbol |
1558 |
"change the key of the key-event." |
|
1559 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1560 |
args at:1 put:aCharacterOrSymbol |
2852 | 1561 |
|
1562 |
"Created: 1.8.1997 / 13:55:19 / cg" |
|
1563 |
! |
|
1564 |
||
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1565 |
rawKey |
8801 | 1566 |
rawKey isNil ifTrue:[^ self key]. |
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1567 |
^ rawKey |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1568 |
|
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1569 |
"Created: 4.4.1997 / 13:47:15 / cg" |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1570 |
! |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1571 |
|
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1572 |
rawKey:aKey |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1573 |
rawKey := aKey |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1574 |
|
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1575 |
"Created: 4.4.1997 / 13:47:10 / cg" |
1841 | 1576 |
! |
1577 |
||
1578 |
x |
|
1579 |
"return the x coordinate of the key-event |
|
1580 |
(mouse position at the time of the key-event)." |
|
1581 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1582 |
^ args at:2 |
1841 | 1583 |
|
1584 |
"Created: 1.8.1997 / 13:57:27 / cg" |
|
1585 |
! |
|
1586 |
||
5209 | 1587 |
x:anInteger |
3089 | 1588 |
"change the x coordinate of the key-event" |
1589 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1590 |
^ args at:2 put:anInteger |
3089 | 1591 |
! |
1592 |
||
1841 | 1593 |
y |
1594 |
"return the y coordinate of the key-event |
|
1595 |
(mouse position at the time of the key-event)." |
|
1596 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1597 |
^ args at:3 |
1841 | 1598 |
|
1599 |
"Created: 1.8.1997 / 13:55:19 / cg" |
|
1600 |
"Modified: 1.8.1997 / 13:57:42 / cg" |
|
3089 | 1601 |
! |
1602 |
||
1603 |
y:anInteger |
|
1604 |
"change the y coordinate of the key-event" |
|
1605 |
||
3295
84de6d18b9d1
code cleanup - now a subclass of MessageSend - thats what it is really
Claus Gittinger <cg@exept.de>
parents:
3294
diff
changeset
|
1606 |
^ args at:3 put:anInteger |
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1607 |
! ! |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1608 |
|
5249 | 1609 |
!WindowEvent::KeyboardEvent methodsFor:'testing'! |
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1610 |
|
5204
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1611 |
isDelegatedToFocusView |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1612 |
"return true, if this event will be forwarded to a focusView." |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1613 |
|
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1614 |
^ true |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1615 |
! |
748c8f2954e9
fixed mouseWheelScroll bug due to changed targetView code
Claus Gittinger <cg@exept.de>
parents:
5201
diff
changeset
|
1616 |
|
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1617 |
isKeyEvent |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1618 |
"return true, if this event is a keyboard event" |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1619 |
|
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1620 |
^ true |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1621 |
|
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1622 |
"Created: 4.4.1997 / 13:39:59 / cg" |
8308 | 1623 |
! |
1624 |
||
1625 |
isUserEvent |
|
1626 |
"return true, if this event from a user" |
|
1627 |
||
1628 |
^ true |
|
1629 |
||
1630 |
"Created: / 16-03-2018 / 11:05:50 / stefan" |
|
3686 | 1631 |
! ! |
1632 |
||
5962 | 1633 |
!WindowEvent::ButtonMotionEvent methodsFor:'testing'! |
1634 |
||
1635 |
isButtonMotionEvent |
|
1636 |
"return true, if this event is a buttonMotion event" |
|
1637 |
||
1638 |
^ true |
|
1639 |
! ! |
|
1640 |
||
1641 |
!WindowEvent::KeyPressEvent methodsFor:'testing'! |
|
1642 |
||
1643 |
isKeyPressEvent |
|
1644 |
"return true, if this event is a keyboard press event" |
|
1645 |
||
1646 |
^ true |
|
1647 |
! ! |
|
1648 |
||
5249 | 1649 |
!WindowEvent::KeyReleaseEvent methodsFor:'testing'! |
3686 | 1650 |
|
1651 |
isKeyReleaseEvent |
|
1652 |
"return true, if this event is a keyboard press event" |
|
1653 |
||
1654 |
^ true |
|
1655 |
! ! |
|
1656 |
||
5962 | 1657 |
!WindowEvent::HotKeyEvent methodsFor:'accessing'! |
1658 |
||
1659 |
hotkeyIdentifier |
|
1660 |
^ hotkeyIdentifier |
|
1661 |
! |
|
2028 | 1662 |
|
5962 | 1663 |
hotkeyIdentifier:something |
1664 |
hotkeyIdentifier := something. |
|
1665 |
! ! |
|
1666 |
||
1667 |
!WindowEvent::HotKeyEvent methodsFor:'testing'! |
|
1668 |
||
1669 |
isHotKeyEvent |
|
1670 |
"return true, if this event is a hotkey event" |
|
2028 | 1671 |
|
3686 | 1672 |
^ true |
1527
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1673 |
! ! |
661de0f76595
started to separate into distinct event classes;
Claus Gittinger <cg@exept.de>
parents:
1470
diff
changeset
|
1674 |
|
4988 | 1675 |
!WindowEvent::KeyboardFocusEvent methodsFor:'accessing'! |
1676 |
||
1677 |
hasFocus |
|
1678 |
||
1679 |
^ args at: 1 |
|
1680 |
! ! |
|
1681 |
||
5249 | 1682 |
!WindowEvent::KeyboardFocusEvent methodsFor:'testing'! |
3376 | 1683 |
|
1684 |
isKeyboardFocusEvent |
|
1685 |
"return true, if this event is a keyboard focus event" |
|
1686 |
||
1687 |
^ true |
|
1688 |
! ! |
|
1689 |
||
8991 | 1690 |
!WindowEvent::MessageSendEvent class methodsFor:'documentation'! |
1691 |
||
1692 |
documentation |
|
1693 |
" |
|
1694 |
documentation to be added. |
|
1695 |
||
1696 |
class: |
|
1697 |
<a short class summary here, describing what instances represent> |
|
1698 |
||
1699 |
responsibilities: |
|
1700 |
<describing what my main role is> |
|
1701 |
||
1702 |
collaborators: |
|
1703 |
<describing with whom and how I talk to> |
|
1704 |
||
1705 |
API: |
|
1706 |
<public api and main messages> |
|
1707 |
||
1708 |
example: |
|
1709 |
<a one-line examples on how to use - can also be in a separate example method> |
|
1710 |
||
1711 |
implementation: |
|
1712 |
<implementation points> |
|
1713 |
||
1714 |
[author:] |
|
1715 |
cg |
|
1716 |
||
1717 |
[instance variables:] |
|
1718 |
||
1719 |
[class variables:] |
|
1720 |
||
1721 |
[see also:] |
|
1722 |
||
1723 |
" |
|
1724 |
! ! |
|
1725 |
||
1726 |
!WindowEvent::MessageSendEvent class methodsFor:'instance creation-basic'! |
|
1727 |
||
1728 |
for:aView type:aSymbol |
|
1729 |
"create and return a new windowEvent for sending |
|
1730 |
aSymbol-message with no arguments to aView" |
|
1731 |
||
1732 |
^ (super for:aView type:aSymbol) rememberSender |
|
1733 |
! |
|
1734 |
||
1735 |
for:aView type:aSymbol arguments:argArray |
|
1736 |
"create and return a new windowEvent for sending |
|
1737 |
aSymbol-message with arguments to aView" |
|
1738 |
||
1739 |
^ (super for:aView type:aSymbol arguments:argArray) rememberSender |
|
1740 |
! ! |
|
1741 |
||
1742 |
!WindowEvent::MessageSendEvent methodsFor:'accessing'! |
|
1743 |
||
1744 |
rememberSender |
|
1745 |
"possibly (i.e if Debug is true) remember the context where the message was generated. |
|
1746 |
Somewhat heuristicly skip uninterresting contexts." |
|
1747 |
||
1748 |
|con| |
|
1749 |
||
1750 |
(Debug ? false) ifFalse:[^ self]. |
|
1751 |
||
1752 |
con := thisContext sender. |
|
1753 |
[ |
|
1754 |
con notNil |
|
1755 |
and:[ (con receiver == self) |
|
1756 |
or:[(con receiver == self class) |
|
1757 |
or:[(con receiver == WindowEvent) |
|
1758 |
or:[(con receiver class == WindowSensor) |
|
1759 |
or:[(con receiver class == RecursionLock) |
|
1760 |
or:[(con receiver isBlock) |
|
1761 |
or:[(con selector == #enqueueMessage:for:arguments:) |
|
1762 |
or:[(con selector == #enqueueMessage:for:) |
|
1763 |
]]]]]]] |
|
1764 |
] |
|
1765 |
] whileTrue:[ |
|
1766 |
con := con sender. |
|
1767 |
]. |
|
1768 |
generatedBy := con. |
|
1769 |
! ! |
|
1770 |
||
3680 | 1771 |
!WindowEvent::MessageSendEvent methodsFor:'blocked'! |
1772 |
||
1773 |
view |
|
1774 |
^ nil |
|
1775 |
! ! |
|
1776 |
||
5249 | 1777 |
!WindowEvent::MessageSendEvent methodsFor:'testing'! |
3089 | 1778 |
|
3465 | 1779 |
isMessageSendEvent |
1780 |
"return true, if this event is a general messageSend event" |
|
3089 | 1781 |
|
1782 |
^ true |
|
1783 |
||
1784 |
||
1785 |
||
1786 |
! ! |
|
1787 |
||
4988 | 1788 |
!WindowEvent::MouseWheelMotionEvent methodsFor:'accessing'! |
1789 |
||
1790 |
amount |
|
1791 |
"return the amount of the mouse wheel motion event " |
|
1792 |
||
1793 |
^ args at:4 |
|
1794 |
! |
|
1795 |
||
1796 |
deltaTime |
|
1797 |
"return the deltaTime of the mouse wheel motion event " |
|
1798 |
||
1799 |
^ args at:5 |
|
1800 |
! ! |
|
1801 |
||
5249 | 1802 |
!WindowEvent::MouseWheelMotionEvent methodsFor:'testing'! |
5205 | 1803 |
|
1804 |
isDelegatedToFocusView |
|
1805 |
"return true, if this event will be forwarded to a focusView." |
|
1806 |
||
1807 |
^ true. |
|
1808 |
! |
|
1809 |
||
1810 |
isMouseWheelEvent |
|
1811 |
^ true. |
|
1812 |
! ! |
|
1813 |
||
4233 | 1814 |
!WindowEvent::NativeWidgetCommandEvent methodsFor:'accessing'! |
1815 |
||
1816 |
command |
|
1817 |
^ selector |
|
1818 |
! |
|
1819 |
||
1820 |
command:something |
|
1821 |
selector := something. |
|
1822 |
! ! |
|
1823 |
||
5249 | 1824 |
!WindowEvent::NewDamageEvent methodsFor:'testing'! |
4044 | 1825 |
|
1826 |
isDamage |
|
1827 |
"return true, if this is a damage event" |
|
1828 |
||
1829 |
^ true |
|
1830 |
! |
|
1831 |
||
1832 |
isDamageForView:aView |
|
1833 |
"return true, if this is a damage event for aView" |
|
1834 |
||
1835 |
^ (receiver == aView) |
|
1836 |
! ! |
|
1837 |
||
5249 | 1838 |
!WindowEvent::TerminateEvent methodsFor:'testing'! |
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1839 |
|
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1840 |
isTerminateEvent |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1841 |
^ true |
8308 | 1842 |
! |
1843 |
||
1844 |
isUserEvent |
|
1845 |
"return true, if this event from a user" |
|
1846 |
||
1847 |
^ true |
|
1848 |
||
1849 |
"Created: / 16-03-2018 / 11:06:05 / stefan" |
|
3773
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1850 |
! ! |
e2fd3df91e5c
new event class for TerminateEvents
Claus Gittinger <cg@exept.de>
parents:
3758
diff
changeset
|
1851 |
|
4817 | 1852 |
!WindowEvent::TrayActionEvent methodsFor:'accessing'! |
1853 |
||
1854 |
event |
|
1855 |
^ selector |
|
1856 |
||
1857 |
"Created: / 31-10-2007 / 01:23:05 / cg" |
|
1858 |
! |
|
1859 |
||
1860 |
event:something |
|
1861 |
selector := something. |
|
1862 |
||
1863 |
"Created: / 31-10-2007 / 01:23:07 / cg" |
|
1864 |
! ! |
|
1865 |
||
5249 | 1866 |
!WindowEvent::TrayActionEvent methodsFor:'testing'! |
4842 | 1867 |
|
1868 |
isTrayEvent |
|
1869 |
^ true |
|
1870 |
||
1871 |
"Created: / 09-11-2007 / 13:09:17 / cg" |
|
1872 |
! ! |
|
1873 |
||
5838
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1874 |
!WindowEvent::VisibilityChangeEvent class methodsFor:'instance creation'! |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1875 |
|
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1876 |
for:aView visibility:how |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1877 |
^ self new |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1878 |
|
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1879 |
"Created: / 23-01-2012 / 10:02:42 / cg" |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1880 |
! ! |
5629e7ee01bf
added: #visibilityOf:changedTo:
Claus Gittinger <cg@exept.de>
parents:
5752
diff
changeset
|
1881 |
|
8550 | 1882 |
!WindowEvent::WidgetSelectionEvent class methodsFor:'documentation'! |
8549 | 1883 |
|
1884 |
copyright |
|
1885 |
" |
|
1886 |
COPYRIGHT (c) 2008 by eXept Software AG |
|
1887 |
All Rights Reserved |
|
1888 |
||
1889 |
This software is furnished under a license and may be used |
|
1890 |
only in accordance with the terms of that license and with the |
|
1891 |
inclusion of the above copyright notice. This software may not |
|
1892 |
be provided or otherwise made available to, or used by, any |
|
1893 |
other person. No title to or ownership of the software is |
|
1894 |
hereby transferred. |
|
1895 |
||
1896 |
" |
|
1897 |
! ! |
|
1898 |
||
8550 | 1899 |
!WindowEvent::WidgetSelectionEvent methodsFor:'accessing'! |
8549 | 1900 |
|
1901 |
widget:aWidget |
|
1902 |
selector := #'widgetSelected:'. |
|
1903 |
args := Array with:aWidget class name. |
|
1904 |
receiver := aWidget. |
|
1905 |
timeStamp := Timestamp now. |
|
1906 |
! |
|
1907 |
||
1908 |
widgetClassName |
|
1909 |
||
1910 |
^ args at: 1 |
|
1911 |
! ! |
|
1912 |
||
5249 | 1913 |
!WindowEvent::WindowMapUnmapEvent methodsFor:'testing'! |
3680 | 1914 |
|
1915 |
isMapEvent |
|
4842 | 1916 |
"return true, if this is a map event" |
3680 | 1917 |
|
1918 |
^ selector == #mapped |
|
1919 |
||
4842 | 1920 |
"Created: / 29-01-1998 / 21:52:54 / cg" |
1921 |
"Modified: / 09-11-2007 / 13:11:02 / cg" |
|
3680 | 1922 |
! |
1923 |
||
1924 |
isUnmapEvent |
|
4842 | 1925 |
"return true, if this is an unmap event" |
3680 | 1926 |
|
1927 |
^ selector == #unmapped |
|
1928 |
||
4842 | 1929 |
"Modified: / 09-11-2007 / 13:11:04 / cg" |
3680 | 1930 |
! ! |
1931 |
||
251 | 1932 |
!WindowEvent class methodsFor:'documentation'! |
1933 |
||
5751 | 1934 |
version_CVS |
8550 | 1935 |
^ '$Header$' |
5751 | 1936 |
! |
1937 |
||
1938 |
version_SVN |
|
6312 | 1939 |
^ '$ Id $' |
251 | 1940 |
! ! |
3758 | 1941 |
|
6312 | 1942 |
|
3758 | 1943 |
WindowEvent::InputEvent initialize! |