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