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