fixed mouseWheelScroll bug due to changed targetView code
authorClaus Gittinger <cg@exept.de>
Wed, 25 Feb 2009 11:14:54 +0100
changeset 5204 748c8f2954e9
parent 5203 3015cd209c14
child 5205 27605d0f1caa
fixed mouseWheelScroll bug due to changed targetView code
WindowEvent.st
--- a/WindowEvent.st	Tue Feb 24 19:29:45 2009 +0100
+++ b/WindowEvent.st	Wed Feb 25 11:14:54 2009 +0100
@@ -856,6 +856,12 @@
     ^ false.
 !
 
+isDelegatedToFocusView
+    "return true, if this event will be forwarded to a focusView."
+
+    ^ false.
+!
+
 isFocusEvent
     "return true, if this event is a focusIn/focusOut event"
 
@@ -1176,6 +1182,30 @@
 
 isMouseWheelEvent
     ^ selector == #mouseWheelMotion:x:y:amount:deltaTime:
+!
+
+targetView
+    "return the view which will eventually handle the event;
+     for most events, this is the same as the view, for which the event was
+     originally generated.
+     Except, if an explicit focus has been assigned (i.e. tabbed into a component),
+     AND the event is a keyboard event. In this case, the targetView might be different.
+     Notice: this method might return nil, for synthetic (app-related) or display screen related
+     events"
+
+    |evView group focusView|
+
+    evView := self view.
+    self isDelegatedToFocusView ifTrue:[
+        evView notNil ifTrue:[
+            group := evView windowGroup.
+            group notNil ifTrue:[
+                focusView := group focusView.
+                focusView notNil ifTrue:[^ focusView].
+            ].
+        ].
+    ].
+    ^ evView
 ! !
 
 !WindowEvent::ButtonEvent methodsFor:'accessing'!
@@ -1450,33 +1480,18 @@
 
 !WindowEvent::KeyboardEvent methodsFor:'queries'!
 
+isDelegatedToFocusView
+    "return true, if this event will be forwarded to a focusView."
+
+    ^ true
+!
+
 isKeyEvent
     "return true, if this event is a keyboard event"
 
     ^ true
 
     "Created: 4.4.1997 / 13:39:59 / cg"
-!
-
-targetView
-    "return the view which will eventually handle the event;
-     for most events, this is the same as the view, for which the event was
-     originally generated.
-     Except, if an explicit focus has been assigned (i.e. tabbed into a component),
-     AND the event is a keyboard event. In this case, the targetView might be different.
-     Notice: this method might return nil, for synthetic (app-related) or display screen related
-     events"
-
-    |evView group focusView|
-
-    (evView := self view) notNil ifTrue:[
-        group := evView windowGroup.
-        group notNil ifTrue:[
-            focusView := group focusView.
-            focusView notNil ifTrue:[^ focusView].
-        ].
-    ].
-    ^ evView
 ! !
 
 !WindowEvent::KeyReleaseEvent methodsFor:'queries'!
@@ -1615,7 +1630,7 @@
 !WindowEvent class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.98 2009-02-24 18:28:45 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WindowEvent.st,v 1.99 2009-02-25 10:14:54 cg Exp $'
 ! !
 
 WindowEvent::InputEvent initialize!