Browse Source

*** empty log message ***

David Rose 25 years ago
parent
commit
8f9fce64ed
2 changed files with 20 additions and 11 deletions
  1. 2 2
      direct/src/gui/DialogBox.py
  2. 18 9
      direct/src/gui/OnscreenPanel.py

+ 2 - 2
direct/src/gui/DialogBox.py

@@ -30,7 +30,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel):
         self.isLoaded = 0
         self.isLoaded = 0
 
 
         # initialize our OnscreenPanel essence
         # initialize our OnscreenPanel essence
-        # NOTE: all db's have the same name so we can kill tem easily
+        # NOTE: all db's have the same name so we can kill them easily
         OnscreenPanel.OnscreenPanel.__init__(self, "globalDialog")
         OnscreenPanel.OnscreenPanel.__init__(self, "globalDialog")
          
          
 	return None
 	return None
@@ -74,7 +74,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel):
             # create OK and CANCEL buttons
             # create OK and CANCEL buttons
             self.makeButton("OK", pos = (-0.325, -0.25),
             self.makeButton("OK", pos = (-0.325, -0.25),
                             func = self.__handleOk)
                             func = self.__handleOk)
-            self.makeButton("CANCEL", pos = (0.2, -0.25),
+            self.makeButton("Cancel", pos = (0.2, -0.25),
                             func = self.__handleCancel)
                             func = self.__handleCancel)
         else:
         else:
             # create a centered OK  button
             # create a centered OK  button

+ 18 - 9
direct/src/gui/OnscreenPanel.py

@@ -124,17 +124,9 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
             # Otherwise, it's a model to instance.
             # Otherwise, it's a model to instance.
             self.panelGeom = geom.instanceTo(self)
             self.panelGeom = geom.instanceTo(self)
 
 
-        # Set up the panel as its own mouse region so mouse clicks on
-        # the panel don't inadvertently drive the toon around.
-        self.geomRect = geomRect
-        self.panelRegion = MouseWatcherRegion(uniqueName, 0, 0, 0, 0)
-        self.panelRegion.setRelative(self.panelGeom,
-                                     geomRect[0], geomRect[1],
-                                     geomRect[2], geomRect[3])
-
         centerX = (rect[0] + rect[1]) / 2.0
         centerX = (rect[0] + rect[1]) / 2.0
         centerY = (rect[2] + rect[3]) / 2.0
         centerY = (rect[2] + rect[3]) / 2.0
-        self.setPos(centerX, 0, centerY)
+        NodePath.setPos(self, centerX, 0, centerY)
 
 
         # Scale and position the geometry to fill up our desired
         # Scale and position the geometry to fill up our desired
         # rectangle.
         # rectangle.
@@ -160,6 +152,22 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
             self.panelGeom.setY(100)
             self.panelGeom.setY(100)
             self.panelGeom.arc().setTransition(dw, 2)
             self.panelGeom.arc().setTransition(dw, 2)
 
 
+        # Set up the panel as its own mouse region so mouse clicks on
+        # the panel don't inadvertently drive the toon around.  This
+        # must be done after the panelGeom has been scaled
+        # appropriately, above.
+        self.geomRect = geomRect
+        self.panelRegion = MouseWatcherRegion(uniqueName, 0, 0, 0, 0)
+        self.panelRegion.setRelative(self.panelGeom,
+                                     geomRect[0], geomRect[1],
+                                     geomRect[2], geomRect[3])
+
+        # *** Temporary try/except to support old Pandas.
+        try:
+            self.panelRegion.setSort(self.panelDrawOrder)
+        except:
+            pass
+
     def cleanup(self):
     def cleanup(self):
         """cleanup(self):
         """cleanup(self):
 
 
@@ -360,3 +368,4 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath):
                                      self.geomRect[2], self.geomRect[3])
                                      self.geomRect[2], self.geomRect[3])
 
 
 
 
+