ExtendedComboBox.st
changeset 2022 16e783eb5f2a
parent 2013 3f550c902871
child 2026 3b9f6e0aaad5
--- a/ExtendedComboBox.st	Wed Oct 10 15:09:18 2001 +0200
+++ b/ExtendedComboBox.st	Wed Oct 10 16:01:27 2001 +0200
@@ -1167,7 +1167,7 @@
     ].
     menuButton turnOn.
 
-    menuOrigin   := device translatePoint:(0@height) from:(self id) to:(device rootWindowId).
+    menuOrigin   := device translatePoint:(0@height) fromView:self toView:nil.
     useableExt   := device usableExtent.
     widgetPrfExt := menuWrapper preferredExtent.
 
@@ -1202,6 +1202,8 @@
             self closeMenu
         ].
     ].
+
+    "Modified: / 10.10.2001 / 14:44:22 / cg"
 ! !
 
 !ExtendedComboBox::MenuWrapper class methodsFor:'documentation'!
@@ -1275,9 +1277,9 @@
             "/ also go to that one ...but not, if it falls into my own ext-comboBox (sigh)
             "/ (example: a sub-ext-box in an ext-box, clicking on the outer boxes menuButton)
             (oldGrabber := device activePointerGrab) notNil ifTrue:[
-                p := device translatePoint:(x@y) from:(self id) to:(comboBox id).
+                p := device translatePoint:(x@y) fromView:self toView:comboBox.
                 ((0@0 extent:comboBox extent) containsPoint:p) ifFalse:[        
-                    p := device translatePoint:(x@y) from:(self id) to:(oldGrabber id).
+                    p := device translatePoint:(x@y) fromView:self toView:oldGrabber.
                     event view:oldGrabber.
                     event x:p x.
                     event y:p y.
@@ -1316,7 +1318,7 @@
 
     implicitGrabView notNil ifTrue:[
         ev isButtonEvent ifTrue:[
-            p := device translatePoint:(x@y) from:(self id) to:(implicitGrabView id).
+            p := device translatePoint:(x@y) fromView:self toView:implicitGrabView.
             ev view:implicitGrabView.
             ev arguments at:2 put:p x.
             ev arguments at:3 put:p y.
@@ -1334,7 +1336,7 @@
         ^ super dispatchEvent:ev withFocusOn:focusView delegate:false
     ].
 
-    p := device translatePoint:(x@y) from:(self id) to:(view id).
+    p := device translatePoint:(x@y) fromView:self toView:view.
 
     ev isButtonPressEvent ifTrue:[
         (view wantsFocusWithButtonPress) ifTrue:[
@@ -1370,6 +1372,8 @@
     ev x:p x.
     ev y:p y.
     view dispatchEvent:ev withFocusOn:focusView delegate:false.
+
+    "Modified: / 10.10.2001 / 13:54:20 / cg"
 ! !
 
 !ExtendedComboBox::MenuWrapper methodsFor:'focus handling'!
@@ -1457,7 +1461,7 @@
 
 detectViewAtX:x y:y
     "detect view at x@y. if no view is detected or
-     the it is my view nil is returned
+     the it is my view, nil is returned
     "
     |v|
 
@@ -1474,23 +1478,29 @@
     "detect view at x@y in a top view; if no view is detected
      the topview is returned
     "
-    |subviews|
+    ^ aTopView detectViewAt:(x@y).
 
-    (subviews := aTopView subViews) notNil ifTrue:[
-        subviews do:[:v||p|
-            (    (x between:(v left) and:(v right))
-             and:[y between:(v top)  and:(v bottom)]
-            ) ifTrue:[
-                p := device translatePoint:(x@y) from:(aTopView id) to:(v id).
-                ^ self detectViewAtX:p x y:p y in:v.
-            ]
-        ]
-    ].
-    ^ aTopView
+"/ cg: old code was (refactored to use common code)
+"/
+"/    |subviews|
+"/
+"/    (subviews := aTopView subViews) notNil ifTrue:[
+"/        subviews do:[:v||p|
+"/            (    (x between:(v left) and:(v right))
+"/             and:[y between:(v top)  and:(v bottom)]
+"/            ) ifTrue:[
+"/                p := device translatePoint:(x@y) fromView:aTopView toView:v.
+"/                ^ self detectViewAtX:p x y:p y in:v.
+"/            ]
+"/        ]
+"/    ].
+"/    ^ aTopView
+
+    "Modified: / 10.10.2001 / 13:53:15 / cg"
 ! !
 
 !ExtendedComboBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.28 2001-09-24 13:00:49 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ExtendedComboBox.st,v 1.29 2001-10-10 14:01:27 cg Exp $'
 ! !