From 80ff2a8b92d8f79b137ed782b923b6b9a3b955e4 Mon Sep 17 00:00:00 2001 From: gregw <> Date: Fri, 6 Apr 2001 01:58:22 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/DialogBox.py | 5 +++-- direct/src/gui/OnscreenPanel.py | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/direct/src/gui/DialogBox.py b/direct/src/gui/DialogBox.py index 3a8f49e739..59e90ce5eb 100644 --- a/direct/src/gui/DialogBox.py +++ b/direct/src/gui/DialogBox.py @@ -30,7 +30,8 @@ class DialogBox(OnscreenPanel.OnscreenPanel): self.isLoaded = 0 # initialize our OnscreenPanel essence - OnscreenPanel.OnscreenPanel.__init__(self, self.doneEvent) + # NOTE: all db's have the same name so we can kill tem easily + OnscreenPanel.OnscreenPanel.__init__(self, "globalDialog") return None @@ -62,7 +63,7 @@ class DialogBox(OnscreenPanel.OnscreenPanel): # make the panel self.makePanel(rect = (-0.5, 0.5, -0.4, 0.4), - font = self.font, + drawOrder = 32000, font = self.font, bg = (0.8, 0.8, 0.8, 1.0)) # create a message diff --git a/direct/src/gui/OnscreenPanel.py b/direct/src/gui/OnscreenPanel.py index 87abad86c0..a45e2f44be 100644 --- a/direct/src/gui/OnscreenPanel.py +++ b/direct/src/gui/OnscreenPanel.py @@ -18,6 +18,20 @@ def findPanel(uniqueName): return OnscreenPanel.AllPanels[uniqueName] return None +def cleanupPanel(uniqueName): + """cleanupPanel(string uniqueName) + + Cleans up (removes) the panel with the given uniqueName. This + may be useful when some panels know about each other and know + that opening panel A should automatically close panel B, for + instance. + """ + + if OnscreenPanel.AllPanels.has_key(uniqueName): + OnscreenPanel.AllPanels[uniqueName].cleanup() + del OnscreenPanel.AllPanels[uniqueName] + + class OnscreenPanel(PandaObject.PandaObject, NodePath): """OnscreenPanel: @@ -37,19 +51,6 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): NodePath.__init__(self, aspect2d.attachNewNode(panelName)) NodePath.hide(self) - def cleanupPanel(self, uniqueName): - """cleanupPanel(self, string uniqueName) - - Cleans up (removes) the panel with the given uniqueName. This - may be useful when some panels know about each other and know - that opening panel A should automatically close panel B, for - instance. - """ - - if OnscreenPanel.AllPanels.has_key(uniqueName): - OnscreenPanel.AllPanels[uniqueName].cleanup() - del OnscreenPanel.AllPanels[uniqueName] - def makePanel(self, rect = (-0.5, 0.5, -0.5, 0.5), bg = (1, 1, 1, 1), @@ -103,7 +104,7 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): # name. We don't allow any two panels with the same name to # coexist. uniqueName = self.getUniqueName() - self.cleanupPanel(uniqueName) + cleanupPanel(uniqueName) # Store this panel in our map of all open panels. OnscreenPanel.AllPanels[uniqueName] = self