Browse Source

*** empty log message ***

Joe Shochet 24 years ago
parent
commit
21b73c4ced
3 changed files with 17 additions and 15 deletions
  1. 1 0
      direct/src/fsm/StateData.py
  2. 9 0
      direct/src/gui/DirectGuiBase.py
  3. 7 15
      direct/src/gui/DirectWaitBar.py

+ 1 - 0
direct/src/fsm/StateData.py

@@ -23,6 +23,7 @@ class StateData(DirectObject):
     def cleanup(self):
     def cleanup(self):
         """cleanup(self)
         """cleanup(self)
         """
         """
+        print "state data cleanup!!!"
         self.unload()
         self.unload()
         return None
         return None
 
 

+ 9 - 0
direct/src/gui/DirectGuiBase.py

@@ -958,3 +958,12 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
 
 
     def taskName(self, idString):
     def taskName(self, idString):
         return (idString + "-" + str(self.guiId))
         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

+ 7 - 15
direct/src/gui/DirectWaitBar.py

@@ -2,7 +2,7 @@ from DirectFrame import *
 
 
 """
 """
 import DirectWaitBar
 import DirectWaitBar
-d = DirectWaitBar.DirectWaitBar()
+d = DirectWaitBar(borderWidth=(0,0))
 
 
 """
 """
 
 
@@ -20,15 +20,14 @@ class DirectWaitBar(DirectFrame):
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('pgFunc',          PGWaitBar,        None),
             ('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),
             ('value',           50,               self.setValue),
             ('barBorderWidth',  (0,0),            self.setBarBorderWidth),
             ('barBorderWidth',  (0,0),            self.setBarBorderWidth),
-            ('barColor',        (1,0,0,1),     self.setBarColor),
+            ('barColor',        (1,0,0,1),        self.setBarColor),
             ('barRelief',       FLAT,             self.setBarRelief),
             ('barRelief',       FLAT,             self.setBarRelief),
             )
             )
-
+        
         self.barStyle = PGFrameStyle()
         self.barStyle = PGFrameStyle()
         
         
         # Merge keyword options with default options
         # Merge keyword options with default options
@@ -40,13 +39,10 @@ class DirectWaitBar(DirectFrame):
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectWaitBar)
         self.initialiseoptions(DirectWaitBar)
 
 
-        self.setup()
         self.updateBarStyle()
         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):
     def setValue(self):
         self.guiItem.setValue(self['value'])
         self.guiItem.setValue(self['value'])
@@ -56,21 +52,17 @@ class DirectWaitBar(DirectFrame):
 
 
     def updateBarStyle(self):
     def updateBarStyle(self):
         if not self.fInit:
         if not self.fInit:
-            print 'updateing'
             self.guiItem.setBarStyle(self.barStyle)            
             self.guiItem.setBarStyle(self.barStyle)            
 
 
     def setBarRelief(self):
     def setBarRelief(self):
-        print 1
         self.barStyle.setType(self['barRelief'])
         self.barStyle.setType(self['barRelief'])
         self.updateBarStyle()
         self.updateBarStyle()
 
 
     def setBarBorderWidth(self):
     def setBarBorderWidth(self):
-        print 2
         self.barStyle.setWidth(*self['barBorderWidth'])
         self.barStyle.setWidth(*self['barBorderWidth'])
         self.updateBarStyle()
         self.updateBarStyle()
 
 
     def setBarColor(self):
     def setBarColor(self):
-        print 3
         self.barStyle.setColor(*self['barColor'])
         self.barStyle.setColor(*self['barColor'])
         self.updateBarStyle()
         self.updateBarStyle()