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