From 5a61602f0d6452063b2e34f18dddd8bb589bdb8a Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 4 Apr 2001 22:34:53 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/Button.py | 14 -------------- direct/src/gui/OnscreenPanel.py | 20 +++++++++++++++----- direct/src/gui/OnscreenText.py | 8 ++++---- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/direct/src/gui/Button.py b/direct/src/gui/Button.py index cc0bf2c90b..1813e0a857 100644 --- a/direct/src/gui/Button.py +++ b/direct/src/gui/Button.py @@ -125,20 +125,6 @@ class Button(DirectObject): self.lDown.setWidth(width) self.lInactive.setWidth(width) -## def freeze(self): -## self.lUp.freeze() -## self.lLit.freeze() -## self.lDown.freeze() -## self.lInactive.freeze() -## self.button.freeze() - -## def thaw(self): -## self.lUp.thaw() -## self.lLit.thaw() -## self.lDown.thaw() -## self.lInactive.thaw() -## self.button.thaw() - def manage(self, nodepath = aspect2d): if nodepath: self.button.manage(guiMgr, base.eventMgr.eventHandler, diff --git a/direct/src/gui/OnscreenPanel.py b/direct/src/gui/OnscreenPanel.py index 6f5adf1907..df487c42ef 100644 --- a/direct/src/gui/OnscreenPanel.py +++ b/direct/src/gui/OnscreenPanel.py @@ -65,16 +65,21 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): The parameters are as follows: - rect: the left, right, bottom, top of the panel on the + rect: the (left, right, bottom, top) of the panel on the screen. This is in aspect2d coordinates. The panel will be set up in its own coordinate system so that (0, 0) is the center of the panel. - bg: the r, g, b, a background color of the panel. + bg: the (r, g, b, a) background color of the panel. geom: the model to use as the background panel geometry. Normally you can safely let this default. + geomRect: the (left, right, bottom, top) rectangle around + the background panel geometry as it is modeled. This is + used to compute how the panel should be scaled to make + it fit the rectangle specified by rect, above. + drawOrder: the drawing order of this panel with respect to all other things in the 'fixed' bin within render2d. Buttons and text created within the panel via @@ -300,11 +305,16 @@ class OnscreenPanel(PandaObject.PandaObject, NodePath): def setPos(self, x, y, z): - """setPos(self, x, y, x) + """setPos(self, x, y, z) + + Repositions the panel onscreen, taking all of the panel's + managed buttons along with it. + """ NodePath.setPos(self, x, y, z) for button in self.panelButtons: - button.unmanage() - button.manage(self) + if button.managed: + button.unmanage() + button.manage(self) diff --git a/direct/src/gui/OnscreenText.py b/direct/src/gui/OnscreenText.py index d2ec78badb..c7c7560405 100644 --- a/direct/src/gui/OnscreenText.py +++ b/direct/src/gui/OnscreenText.py @@ -53,18 +53,18 @@ class OnscreenText(PandaObject, NodePath): or it may be a 2-tuple of floats, specifying a different x, y scale. - fg: the r, g, b, a foreground color of the text. This is + fg: the (r, g, b, a) foreground color of the text. This is normally a 4-tuple of floats or ints. - bg: the r, g, b, a background color of the text. If the + bg: the (r, g, b, a) background color of the text. If the fourth value, a, is nonzero, a card is created to place behind the text and set to the given color. - shadow: the r, g, b, a color of the shadow behind the text. + shadow: the (r, g, b, a) color of the shadow behind the text. If the fourth value, a, is nonzero, a little drop shadow is created and placed behind the text. - frame: the r, g, b, a color of the frame drawn around the + frame: the (r, g, b, a) color of the frame drawn around the text. If the fourth value, a, is nonzero, a frame is created around the text.