From 8f9fce64edb593a4c1b2ca256fae98879eb8a477 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 7 Apr 2001 01:49:55 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/DialogBox.py | 4 ++-- direct/src/gui/OnscreenPanel.py | 27 ++++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/direct/src/gui/DialogBox.py b/direct/src/gui/DialogBox.py index 59e90ce5eb..07cf1584db 100644 --- a/direct/src/gui/DialogBox.py +++ b/direct/src/gui/DialogBox.py @@ -30,7 +30,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel): self.isLoaded = 0 # 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") return None @@ -74,7 +74,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel): # create OK and CANCEL buttons self.makeButton("OK", pos = (-0.325, -0.25), func = self.__handleOk) - self.makeButton("CANCEL", pos = (0.2, -0.25), + self.makeButton("Cancel", pos = (0.2, -0.25), func = self.__handleCancel) else: # create a centered OK button diff --git a/direct/src/gui/OnscreenPanel.py b/direct/src/gui/OnscreenPanel.py index a45e2f44be..490a60db70 100644 --- a/direct/src/gui/OnscreenPanel.py +++ b/direct/src/gui/OnscreenPanel.py @@ -124,17 +124,9 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): # Otherwise, it's a model to instance. 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 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 # rectangle. @@ -160,6 +152,22 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): self.panelGeom.setY(100) 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): """cleanup(self): @@ -360,3 +368,4 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): self.geomRect[2], self.geomRect[3]) +