From 21b73c4cedeb255b15e579c9fa2d6ef9c65b018f Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Thu, 25 Oct 2001 00:30:26 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/fsm/StateData.py | 1 + direct/src/gui/DirectGuiBase.py | 9 +++++++++ direct/src/gui/DirectWaitBar.py | 22 +++++++--------------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/direct/src/fsm/StateData.py b/direct/src/fsm/StateData.py index 3a99767ae4..863cc76ba2 100644 --- a/direct/src/fsm/StateData.py +++ b/direct/src/fsm/StateData.py @@ -23,6 +23,7 @@ class StateData(DirectObject): def cleanup(self): """cleanup(self) """ + print "state data cleanup!!!" self.unload() return None diff --git a/direct/src/gui/DirectGuiBase.py b/direct/src/gui/DirectGuiBase.py index 6f68ffc103..789b042ef0 100644 --- a/direct/src/gui/DirectGuiBase.py +++ b/direct/src/gui/DirectGuiBase.py @@ -958,3 +958,12 @@ class DirectGuiWidget(DirectGuiBase, NodePath): def taskName(self, idString): return (idString + "-" + str(self.guiId)) + + def setProp(self, propString, value): + """ + Allows you to set a property like frame['text'] = 'Joe' in + a function instead of an assignment. + This is useful for setting properties inside function intervals + where must input a function and extraArgs, not an assignment. + """ + self[propString] = value diff --git a/direct/src/gui/DirectWaitBar.py b/direct/src/gui/DirectWaitBar.py index 8d53854f89..e4f7a817aa 100644 --- a/direct/src/gui/DirectWaitBar.py +++ b/direct/src/gui/DirectWaitBar.py @@ -2,7 +2,7 @@ from DirectFrame import * """ import DirectWaitBar -d = DirectWaitBar.DirectWaitBar() +d = DirectWaitBar(borderWidth=(0,0)) """ @@ -20,15 +20,14 @@ class DirectWaitBar(DirectFrame): optiondefs = ( # Define type of DirectGuiWidget ('pgFunc', PGWaitBar, None), - ('width', 1.0, self.setup), - ('height', 0.2, self.setup), - ('range', 100, self.setup), + ('frameSize', (-1,1,-0.1,0.1), None), + ('range', 100, self.setRange), ('value', 50, self.setValue), ('barBorderWidth', (0,0), self.setBarBorderWidth), - ('barColor', (1,0,0,1), self.setBarColor), + ('barColor', (1,0,0,1), self.setBarColor), ('barRelief', FLAT, self.setBarRelief), ) - + self.barStyle = PGFrameStyle() # Merge keyword options with default options @@ -40,13 +39,10 @@ class DirectWaitBar(DirectFrame): # Call option initialization functions self.initialiseoptions(DirectWaitBar) - self.setup() self.updateBarStyle() - - def setup(self): - print self['width'], self['height'], self['range'] - self.guiItem.setup(self['width'], self['height'], self['range']) + def setRange(self): + self.guiItem.setRange(self['range']) def setValue(self): self.guiItem.setValue(self['value']) @@ -56,21 +52,17 @@ class DirectWaitBar(DirectFrame): def updateBarStyle(self): if not self.fInit: - print 'updateing' self.guiItem.setBarStyle(self.barStyle) def setBarRelief(self): - print 1 self.barStyle.setType(self['barRelief']) self.updateBarStyle() def setBarBorderWidth(self): - print 2 self.barStyle.setWidth(*self['barBorderWidth']) self.updateBarStyle() def setBarColor(self): - print 3 self.barStyle.setColor(*self['barColor']) self.updateBarStyle()