Browse Source

Added asList function to NodePathCollection

Mark Mine 23 years ago
parent
commit
66175b4663

+ 6 - 13
direct/src/extensions/NodePath-extensions.py

@@ -30,14 +30,7 @@
     # For iterating over children
     # For iterating over children
     def getChildrenAsList(self):
     def getChildrenAsList(self):
         """Converts a node path's child NodePathCollection into a list"""
         """Converts a node path's child NodePathCollection into a list"""
-        if self.isEmpty():
-            return []
-        else:
-            children = self.getChildren()
-            childrenList = []
-            for childNum in range(self.getNumChildren()):
-                childrenList.append(children[childNum])
-            return childrenList
+        return self.getChildren().asList()
 
 
     def printChildren(self):
     def printChildren(self):
         """Prints out the children of the bottom node of a node path"""
         """Prints out the children of the bottom node of a node path"""
@@ -116,7 +109,7 @@
         self.calcTightBounds(v1,v2)
         self.calcTightBounds(v1,v2)
         return v1, v2
         return v1, v2
 
 
-    def pprintPos(self, other = None, sd = 2):
+    def printPos(self, other = None, sd = 2):
         """ Pretty print a node path's pos """
         """ Pretty print a node path's pos """
         formatString = '%0.' + '%d' % sd + 'f'
         formatString = '%0.' + '%d' % sd + 'f'
         if other:
         if other:
@@ -131,7 +124,7 @@
                formatString % pos[2] +
                formatString % pos[2] +
                ')\n')
                ')\n')
 
 
-    def pprintHpr(self, other = None, sd = 2):
+    def printHpr(self, other = None, sd = 2):
         """ Pretty print a node path's hpr """
         """ Pretty print a node path's hpr """
         formatString = '%0.' + '%d' % sd + 'f'
         formatString = '%0.' + '%d' % sd + 'f'
         if other:
         if other:
@@ -146,7 +139,7 @@
                formatString % hpr[2] +
                formatString % hpr[2] +
                ')\n')
                ')\n')
 
 
-    def pprintScale(self, other = None, sd = 2):
+    def printScale(self, other = None, sd = 2):
         """ Pretty print a node path's scale """
         """ Pretty print a node path's scale """
         formatString = '%0.' + '%d' % sd + 'f'
         formatString = '%0.' + '%d' % sd + 'f'
         if other:
         if other:
@@ -161,7 +154,7 @@
                formatString % scale[2] +
                formatString % scale[2] +
                ')\n')
                ')\n')
 
 
-    def pprintPosHpr(self, other = None, sd = 2):
+    def printPosHpr(self, other = None, sd = 2):
         """ Pretty print a node path's pos and, hpr """
         """ Pretty print a node path's pos and, hpr """
         formatString = '%0.' + '%d' % sd + 'f'
         formatString = '%0.' + '%d' % sd + 'f'
         if other:
         if other:
@@ -181,7 +174,7 @@
                formatString % hpr[2] +
                formatString % hpr[2] +
                ')\n')
                ')\n')
 
 
-    def pprintPosHprScale(self, other = None, sd = 2):
+    def printPosHprScale(self, other = None, sd = 2):
         """ Pretty print a node path's pos, hpr, and scale """
         """ Pretty print a node path's pos, hpr, and scale """
         formatString = '%0.' + '%d' % sd + 'f'
         formatString = '%0.' + '%d' % sd + 'f'
         if other:
         if other:

+ 2 - 0
direct/src/gui/DirectCheckButton.py

@@ -68,6 +68,8 @@ class DirectCheckButton(DirectButton):
         if self['frameSize']:
         if self['frameSize']:
             # Use user specified bounds
             # Use user specified bounds
             self.bounds = self['frameSize']
             self.bounds = self['frameSize']
+            frameType = self.frameStyle[0].getType()
+            ibw = self.indicator['borderWidth']
         else:
         else:
             # Use ready state to compute bounds
             # Use ready state to compute bounds
             frameType = self.frameStyle[0].getType()
             frameType = self.frameStyle[0].getType()