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