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