--- a/WindowEvent.st Wed Dec 08 21:39:03 1999 +0100
+++ b/WindowEvent.st Wed Dec 08 21:39:31 1999 +0100
@@ -11,12 +11,19 @@
"
Object subclass:#WindowEvent
- instanceVariableNames:'view type arguments delegated consumed'
+ instanceVariableNames:'view type arguments delegatedFrom consumed'
classVariableNames:''
poolDictionaries:''
category:'Interface-Support'
!
+WindowEvent subclass:#ClientEvent
+ instanceVariableNames:'eventData'
+ classVariableNames:''
+ poolDictionaries:''
+ privateIn:WindowEvent
+!
+
WindowEvent subclass:#InputEvent
instanceVariableNames:'modifierFlags'
classVariableNames:'F_CTRL F_ALT F_META F_SHIFT F_BUTTON1 F_BUTTON2 F_BUTTON3'
@@ -24,15 +31,8 @@
privateIn:WindowEvent
!
-WindowEvent::InputEvent subclass:#ButtonEvent
- instanceVariableNames:''
- classVariableNames:''
- poolDictionaries:''
- privateIn:WindowEvent
-!
-
-WindowEvent subclass:#ClientEvent
- instanceVariableNames:'eventData'
+WindowEvent::InputEvent subclass:#KeyboardEvent
+ instanceVariableNames:'rawKey'
classVariableNames:''
poolDictionaries:''
privateIn:WindowEvent
@@ -45,8 +45,8 @@
privateIn:WindowEvent
!
-WindowEvent::InputEvent subclass:#KeyboardEvent
- instanceVariableNames:'rawKey'
+WindowEvent::InputEvent subclass:#ButtonEvent
+ instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
privateIn:WindowEvent
@@ -240,6 +240,16 @@
arguments := anArray
!
+delegatedFrom
+ "return the value of the instance variable 'delegatedFrom' (automatically generated)"
+
+ ^ delegatedFrom!
+
+delegatedFrom:something
+ "set the value of the instance variable 'delegatedFrom' (automatically generated)"
+
+ delegatedFrom := something.!
+
key
"return the key - nil is returned here.
This is redefined in KeyboardEvent."
@@ -271,6 +281,28 @@
"set the view, for which the event is for"
view := aView
+!
+
+x
+ "the x coordinate - if any.
+ nil returned for all but button- and keyEvents"
+
+ ^ nil
+!
+
+x:ignoredInteger
+ ^ nil
+!
+
+y
+ "the y coordinate - if any.
+ nil returned for all but button- and keyEvents"
+
+ ^ nil
+!
+
+y:ignoredInteger
+ ^ nil
! !
!WindowEvent methodsFor:'dispatching'!
@@ -527,6 +559,24 @@
"Modified: 5.3.1997 / 11:27:40 / cg"
! !
+!WindowEvent::ClientEvent methodsFor:'accessing'!
+
+eventData
+ "return the value of the instance variable 'eventData' (automatically generated)"
+
+ ^ eventData
+
+ "Created: 4.4.1997 / 17:41:50 / cg"
+!
+
+eventData:something
+ "set the value of the instance variable 'eventData' (automatically generated)"
+
+ eventData := something.
+
+ "Created: 4.4.1997 / 17:41:57 / cg"
+! !
+
!WindowEvent::InputEvent class methodsFor:'class initialization'!
initialize
@@ -679,105 +729,6 @@
"Created: / 21.5.1999 / 19:49:30 / cg"
! !
-!WindowEvent::ButtonEvent methodsFor:'accessing'!
-
-state
- "return the button state of the button-event
- (mouse button bits at the time of the event)."
-
- ^ arguments at:1
-
- "Created: / 12.11.1998 / 16:21:18 / cg"
-!
-
-x
- "return the x coordinate of the button-event
- (mouse position at the time of the event)."
-
- ^ arguments at:2
-
- "Created: 1.8.1997 / 13:58:15 / cg"
-!
-
-y
- "return the y coordinate of the button-event
- (mouse position at the time of the event)."
-
- ^ arguments at:3
-
- "Created: 1.8.1997 / 13:58:07 / cg"
-! !
-
-!WindowEvent::ButtonEvent methodsFor:'queries'!
-
-isButtonEvent
- "return true, if this event is a button event"
-
- ^ true
-
- "Created: 4.4.1997 / 13:44:11 / cg"
-!
-
-isButtonMotionEvent
- "return true, if this event is a buttonMotion event"
-
- ^ (type == #buttonMotion:x:y:)
-
- "Created: 4.4.1997 / 13:44:22 / cg"
-!
-
-isButtonPressEvent
- "return true, if this event is a buttonPress event"
-
- ^ (type == #buttonPress:x:y:)
-
- "Created: 4.4.1997 / 13:44:22 / cg"
-!
-
-isButtonReleaseEvent
- "return true, if this event is a buttonRelease event"
-
- ^ (type == #buttonRelease:x:y:)
-
- "Created: 4.4.1997 / 13:44:22 / cg"
-! !
-
-!WindowEvent::ClientEvent methodsFor:'accessing'!
-
-eventData
- "return the value of the instance variable 'eventData' (automatically generated)"
-
- ^ eventData
-
- "Created: 4.4.1997 / 17:41:50 / cg"
-!
-
-eventData:something
- "set the value of the instance variable 'eventData' (automatically generated)"
-
- eventData := something.
-
- "Created: 4.4.1997 / 17:41:57 / cg"
-! !
-
-!WindowEvent::FocusEvent methodsFor:'queries'!
-
-isFocusEvent
- "return true, if this event is a focus event"
-
- ^ true
-
- "Created: / 21.5.1999 / 19:44:47 / cg"
-!
-
-isFocusInEvent
- "return true, if this event is a focusIn event"
-
- ^ (type == #focusIn)
-
- "Created: / 21.5.1999 / 19:45:04 / cg"
-! !
-
!WindowEvent::KeyboardEvent methodsFor:'accessing'!
key
@@ -817,6 +768,13 @@
"Created: 1.8.1997 / 13:57:27 / cg"
!
+xy:anInteger
+ "change the x coordinate of the key-event"
+
+ ^ arguments at:2 put:anInteger
+
+!
+
y
"return the y coordinate of the key-event
(mouse position at the time of the key-event)."
@@ -825,6 +783,13 @@
"Created: 1.8.1997 / 13:55:19 / cg"
"Modified: 1.8.1997 / 13:57:42 / cg"
+!
+
+y:anInteger
+ "change the y coordinate of the key-event"
+
+ ^ arguments at:3 put:anInteger
+
! !
!WindowEvent::KeyboardEvent methodsFor:'queries'!
@@ -854,8 +819,105 @@
"Created: / 28.1.1998 / 00:02:48 / cg"
! !
+!WindowEvent::FocusEvent methodsFor:'queries'!
+
+isFocusEvent
+ "return true, if this event is a focus event"
+
+ ^ true
+
+ "Created: / 21.5.1999 / 19:44:47 / cg"
+!
+
+isFocusInEvent
+ "return true, if this event is a focusIn event"
+
+ ^ (type == #focusIn)
+
+ "Created: / 21.5.1999 / 19:45:04 / cg"
+! !
+
+!WindowEvent::ButtonEvent methodsFor:'accessing'!
+
+state
+ "return the button state of the button-event
+ (mouse button bits at the time of the event)."
+
+ ^ arguments at:1
+
+ "Created: / 12.11.1998 / 16:21:18 / cg"
+!
+
+x
+ "return the x coordinate of the button-event
+ (mouse position at the time of the event)."
+
+ ^ arguments at:2
+
+ "Created: 1.8.1997 / 13:58:15 / cg"
+!
+
+x:anInteger
+ "change the x coordinate of the button-event"
+
+ ^ arguments at:2 put:anInteger
+
+ "Created: 1.8.1997 / 13:58:15 / cg"
+!
+
+y
+ "return the y coordinate of the button-event
+ (mouse position at the time of the event)."
+
+ ^ arguments at:3
+
+ "Created: 1.8.1997 / 13:58:07 / cg"
+!
+
+y:anInteger
+ "change the y coordinate of the button-event"
+
+ ^ arguments at:3 put:anInteger
+
+ "Created: 1.8.1997 / 13:58:15 / cg"
+! !
+
+!WindowEvent::ButtonEvent methodsFor:'queries'!
+
+isButtonEvent
+ "return true, if this event is a button event"
+
+ ^ true
+
+ "Created: 4.4.1997 / 13:44:11 / cg"
+!
+
+isButtonMotionEvent
+ "return true, if this event is a buttonMotion event"
+
+ ^ (type == #buttonMotion:x:y:)
+
+ "Created: 4.4.1997 / 13:44:22 / cg"
+!
+
+isButtonPressEvent
+ "return true, if this event is a buttonPress event"
+
+ ^ (type == #buttonPress:x:y:)
+
+ "Created: 4.4.1997 / 13:44:22 / cg"
+!
+
+isButtonReleaseEvent
+ "return true, if this event is a buttonRelease event"
+
+ ^ (type == #buttonRelease:x:y:)
+
+ "Created: 4.4.1997 / 13:44:22 / cg"
+! !
+
!WindowEvent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.63 1999-10-28 15:30:00 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.64 1999-12-08 20:39:31 ca Exp $'
! !