WindowEvent.st
changeset 244 83218faf792c
parent 219 9ff0660f447f
child 251 915de9a65169
--- a/WindowEvent.st	Thu Nov 23 03:29:10 1995 +0100
+++ b/WindowEvent.st	Thu Nov 23 11:38:43 1995 +0100
@@ -33,10 +33,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.20 1995-11-11 15:53:22 cg Exp $'
-!
-
 documentation
 "
     Instances of WindowEvent are created for every event coming from
@@ -113,15 +109,20 @@
 		view has no transformation
 		    ----> 'view keyPress:key x:x y:y'
 "
+!
+
+version
+    ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.21 1995-11-23 10:38:12 cg Exp $'
 ! !
 
 !WindowEvent class methodsFor:'instance creation'!
 
-for:aView type:aSymbol arguments:argArray
-    "create and return a new windowEvent for sending
-     aSymbol-message with arguments to aView"
+damageFor:aView rectangle:aRectangle
+    "create and return a new damage Event for aRectangle
+     in aView"
 
-    ^ (self new) for:aView type:aSymbol arguments:argArray
+    ^ (self new) for:aView type:#damage arguments:aRectangle
+
 !
 
 for:aView type:aSymbol
@@ -131,90 +132,11 @@
     ^ (self new) for:aView type:aSymbol arguments:#()
 !
 
-damageFor:aView rectangle:aRectangle
-    "create and return a new damage Event for aRectangle
-     in aView"
-
-    ^ (self new) for:aView type:#damage arguments:aRectangle
-
-! !
-
-!WindowEvent methodsFor:'queries'!
-
-isKeyEvent
-    "return true, if this event is a keyboard event"
-
-    ^ (type == #keyPress:x:y:) or:[type == #keyRelease:x:y:]
-!
-
-isKeyPressEvent
-    "return true, if this event is a keyboard event"
-
-    ^ (type == #keyPress:x:y:)
-!
-
-isButtonEvent
-    "return true, if this event is a button event"
-
-    ^ (type == #buttonPress:x:y:) 
-      or:[type == #buttonRelease:x:y:
-      or:[type == #'buttonShiftPress:x:y:'
-      or:[type == #'buttonMultiPress:x:y:'
-      or:[type == #'buttonMotion:x:y:']]]]
-!
-
-isDamage
-    "return true, if this is a damage event"
-
-    ^ type == #damage
-! !
-
-!WindowEvent methodsFor:'accessing'!
+for:aView type:aSymbol arguments:argArray
+    "create and return a new windowEvent for sending
+     aSymbol-message with arguments to aView"
 
-view
-    "return the view, for which the event is for"
-
-    ^ view
-!
-
-view:aView
-    "set the view, for which the event is for"
-
-    view := aView
-!
-
-type
-    "return the type of the event"
-
-    ^ type
-!
-
-arguments
-    "return the arguments of the event"
-
-    ^ arguments
-!
-
-arguments:anArray
-    "set the arguments"
-
-    arguments := anArray
-!
-
-rectangle
-    "return the damage rectangle"
-
-    ^ arguments "consider this a kludge"
-!
-
-key
-    "return the key of the key-event. For non key-events, nil is returned."
-
-    ((type == #keyPress:x:y:)
-    or:[type == #keyRelease:x:y:]) ifTrue:[
-	^ arguments at:1
-    ].
-    ^ nil
+    ^ (self new) for:aView type:aSymbol arguments:argArray
 ! !
 
 !WindowEvent class methodsFor:'forwarding events'!
@@ -428,6 +350,94 @@
     eventReceiver perform:selector withArguments:argArray
 ! !
 
+!WindowEvent methodsFor:'accessing'!
+
+arguments
+    "return the arguments of the event"
+
+    ^ arguments
+!
+
+arguments:anArray
+    "set the arguments"
+
+    arguments := anArray
+!
+
+key
+    "return the key of the key-event. For non key-events, nil is returned."
+
+    ((type == #keyPress:x:y:)
+    or:[type == #keyRelease:x:y:]) ifTrue:[
+	^ arguments at:1
+    ].
+    ^ nil
+!
+
+rectangle
+    "return the damage rectangle"
+
+    ^ arguments "consider this a kludge"
+!
+
+type
+    "return the type of the event"
+
+    ^ type
+!
+
+view
+    "return the view, for which the event is for"
+
+    ^ view
+!
+
+view:aView
+    "set the view, for which the event is for"
+
+    view := aView
+! !
+
+!WindowEvent methodsFor:'private accessing'!
+
+for:aView type:aSymbol arguments:argArray
+    "set the instance variables of the event"
+
+    view := aView.
+    type := aSymbol.
+    arguments := argArray
+! !
+
+!WindowEvent methodsFor:'queries'!
+
+isButtonEvent
+    "return true, if this event is a button event"
+
+    ^ (type == #buttonPress:x:y:) 
+      or:[type == #buttonRelease:x:y:
+      or:[type == #'buttonShiftPress:x:y:'
+      or:[type == #'buttonMultiPress:x:y:'
+      or:[type == #'buttonMotion:x:y:']]]]
+!
+
+isDamage
+    "return true, if this is a damage event"
+
+    ^ type == #damage
+!
+
+isKeyEvent
+    "return true, if this event is a keyboard event"
+
+    ^ (type == #keyPress:x:y:) or:[type == #keyRelease:x:y:]
+!
+
+isKeyPressEvent
+    "return true, if this event is a keyboard event"
+
+    ^ (type == #keyPress:x:y:)
+! !
+
 !WindowEvent methodsFor:'sending'!
 
 sendEvent
@@ -452,12 +462,3 @@
 	delegate:true
 ! !
 
-!WindowEvent methodsFor:'private accessing'!
-
-for:aView type:aSymbol arguments:argArray
-    "set the instance variables of the event"
-
-    view := aView.
-    type := aSymbol.
-    arguments := argArray
-! !