Browse Source

Popup menu at button midpoint

Mark Mine 23 years ago
parent
commit
db8f2ba387
1 changed files with 3 additions and 8 deletions
  1. 3 8
      direct/src/gui/DirectOptionMenu.py

+ 3 - 8
direct/src/gui/DirectOptionMenu.py

@@ -172,14 +172,9 @@ class DirectOptionMenu(DirectButton):
         # Compute bounds
         # Compute bounds
         b = self.getBounds()
         b = self.getBounds()
         fb = self.popupMenu.getBounds()
         fb = self.popupMenu.getBounds()
-        # Where did the user click his mouse?
-        if (base.mouseWatcherNode.hasMouse()):
-            xPos = base.mouseWatcherNode.getMouseX()
-            self.popupMenu.setX(render2d, xPos)
-        else:
-            # If no mouse watcher, use midpoint of menu button
-            xPos = (b[1] - b[0])/2.0 - fb[0]
-            self.popupMenu.setX(self, xPos)
+        # Position menu at midpoint of button
+        xPos = (b[1] - b[0])/2.0 - fb[0]
+        self.popupMenu.setX(self, xPos)
         # Try to set height to line up selected item with button
         # Try to set height to line up selected item with button
         self.popupMenu.setZ(
         self.popupMenu.setZ(
             self, self.minZ + (self.selectedIndex + 1)*self.maxHeight)
             self, self.minZ + (self.selectedIndex + 1)*self.maxHeight)