PopUpMenu.st
changeset 1859 acd3ca6d027b
parent 1623 1fde415aabf3
child 1861 a582b6c0809d
--- a/PopUpMenu.st	Fri Apr 23 16:54:18 1999 +0200
+++ b/PopUpMenu.st	Fri Apr 23 23:21:57 1999 +0200
@@ -1236,12 +1236,26 @@
     sensor anyButtonPressed ifFalse:[^ self].
     (sensor hasButtonMotionEventFor:self) ifTrue:[^ self].
 
-    ((x >= 0) and:[x < width]) ifTrue:[
-        ((y >= 0) and:[y < height]) ifTrue:[
+    ((x >= 0) 
+    and:[x < width
+    and:[y >= 0
+    and:[y < height]]]) ifTrue:[
+        "/ inside me
+
+        (x >= margin 
+        and:[x < (width-margin)
+        and:[y >= margin
+        and:[y < (height-margin)]]]) ifTrue:[
+            "/ inside my menuView
+
             hideOnRelease := true.
-            menuView buttonMotion:state x:x y:y.
-            ^ self
-        ]
+            p := device translatePoint:(x @ y)
+                                  from:drawableId
+                                    to:(menuView id).
+        
+            menuView buttonMotion:state x:p x y:p y.
+        ].
+        ^ self
     ].
 
     "outside of myself"
@@ -1262,6 +1276,7 @@
     ].
 
     "Modified: / 28.7.1998 / 16:00:15 / cg"
+
 !
 
 buttonPress:button x:x y:y
@@ -1363,7 +1378,9 @@
     "catch quick release of button"
 
     hideOnLeave ifTrue:[
-	state == 0 ifTrue:[^ self hide].
+        state == 0 ifTrue:[
+            self hide
+        ].
     ]
 !
 
@@ -1481,5 +1498,5 @@
 !PopUpMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.77 1998-07-28 14:11:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.78 1999-04-23 21:21:57 cg Exp $'
 ! !