Browse Source

Added __all__ declarations

Josh Yelon 19 years ago
parent
commit
1b058da878
35 changed files with 342 additions and 209 deletions
  1. 32 26
      direct/src/gui/DirectButton.py
  2. 6 0
      direct/src/gui/DirectCheckButton.py
  3. 32 27
      direct/src/gui/DirectDialog.py
  4. 20 14
      direct/src/gui/DirectEntry.py
  5. 11 3
      direct/src/gui/DirectFrame.py
  6. 3 1
      direct/src/gui/DirectGui.py
  7. 49 48
      direct/src/gui/DirectGuiBase.py
  8. 17 7
      direct/src/gui/DirectGuiGlobals.py
  9. 10 6
      direct/src/gui/DirectGuiTest.py
  10. 6 0
      direct/src/gui/DirectLabel.py
  11. 18 12
      direct/src/gui/DirectOptionMenu.py
  12. 14 9
      direct/src/gui/DirectScrollBar.py
  13. 8 3
      direct/src/gui/DirectScrolledFrame.py
  14. 31 25
      direct/src/gui/DirectScrolledList.py
  15. 15 10
      direct/src/gui/DirectSlider.py
  16. 9 4
      direct/src/gui/DirectWaitBar.py
  17. 4 2
      direct/src/gui/OnscreenGeom.py
  18. 4 2
      direct/src/gui/OnscreenImage.py
  19. 5 4
      direct/src/gui/OnscreenText.py
  20. 2 0
      direct/src/interval/ActorInterval.py
  21. 2 0
      direct/src/interval/FunctionInterval.py
  22. 2 0
      direct/src/interval/IndirectInterval.py
  23. 2 0
      direct/src/interval/Interval.py
  24. 5 3
      direct/src/interval/IntervalGlobal.py
  25. 4 0
      direct/src/interval/IntervalManager.py
  26. 4 0
      direct/src/interval/IntervalTest.py
  27. 2 0
      direct/src/interval/LerpInterval.py
  28. 4 0
      direct/src/interval/MetaInterval.py
  29. 2 0
      direct/src/interval/MopathInterval.py
  30. 4 0
      direct/src/interval/ParticleInterval.py
  31. 2 0
      direct/src/interval/ProjectileInterval.py
  32. 4 0
      direct/src/interval/ProjectileIntervalTest.py
  33. 2 0
      direct/src/interval/SoundInterval.py
  34. 4 0
      direct/src/interval/TestInterval.py
  35. 3 3
      direct/src/leveleditor/LevelEditor.py

+ 32 - 26
direct/src/gui/DirectButton.py

@@ -1,3 +1,9 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectButton']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 
 
 # DirectButton States:
 # DirectButton States:
@@ -27,20 +33,20 @@ class DirectButton(DirectFrame):
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('pgFunc',         PGButton,   None),
             ('pgFunc',         PGButton,   None),
             ('numStates',      4,          None),
             ('numStates',      4,          None),
-            ('state',          NORMAL,     None),
-            ('relief',         RAISED,     None),
+            ('state',          DGG.NORMAL, None),
+            ('relief',         DGG.RAISED, None),
             ('invertedFrames', (1,),       None),
             ('invertedFrames', (1,),       None),
             # Command to be called on button click
             # Command to be called on button click
             ('command',        None,       None),
             ('command',        None,       None),
             ('extraArgs',      [],         None),
             ('extraArgs',      [],         None),
             # Which mouse buttons can be used to click the button
             # Which mouse buttons can be used to click the button
-            ('commandButtons', (LMB,),     self.setCommandButtons),
+            ('commandButtons', (DGG.LMB,),     self.setCommandButtons),
             # Sounds to be used for button events
             # Sounds to be used for button events
-            ('rolloverSound', getDefaultRolloverSound(), self.setRolloverSound),
-            ('clickSound',    getDefaultClickSound(),    self.setClickSound),
+            ('rolloverSound', DGG.getDefaultRolloverSound(), self.setRolloverSound),
+            ('clickSound',    DGG.getDefaultClickSound(),    self.setClickSound),
             # Can only be specified at time of widget contruction
             # Can only be specified at time of widget contruction
             # Do the text/graphics appear to move when the button is clicked
             # Do the text/graphics appear to move when the button is clicked
-            ('pressEffect',     1,          INITOPT),
+            ('pressEffect',     1,         DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -76,25 +82,25 @@ class DirectButton(DirectFrame):
     def setCommandButtons(self):
     def setCommandButtons(self):
         # Attach command function to specified buttons
         # Attach command function to specified buttons
         # Left mouse button
         # Left mouse button
-        if LMB in self['commandButtons']:
+        if DGG.LMB in self['commandButtons']:
             self.guiItem.addClickButton(MouseButton.one())
             self.guiItem.addClickButton(MouseButton.one())
-            self.bind(B1CLICK, self.commandFunc)
+            self.bind(DGG.B1CLICK, self.commandFunc)
         else:
         else:
-            self.unbind(B1CLICK)
+            self.unbind(DGG.B1CLICK)
             self.guiItem.removeClickButton(MouseButton.one())
             self.guiItem.removeClickButton(MouseButton.one())
         # Middle mouse button
         # Middle mouse button
-        if MMB in self['commandButtons']:
+        if DGG.MMB in self['commandButtons']:
             self.guiItem.addClickButton(MouseButton.two())
             self.guiItem.addClickButton(MouseButton.two())
-            self.bind(B2CLICK, self.commandFunc)
+            self.bind(DGG.B2CLICK, self.commandFunc)
         else:
         else:
-            self.unbind(B2CLICK)
+            self.unbind(DGG.B2CLICK)
             self.guiItem.removeClickButton(MouseButton.two())
             self.guiItem.removeClickButton(MouseButton.two())
         # Right mouse button
         # Right mouse button
-        if RMB in self['commandButtons']:
+        if DGG.RMB in self['commandButtons']:
             self.guiItem.addClickButton(MouseButton.three())
             self.guiItem.addClickButton(MouseButton.three())
-            self.bind(B3CLICK, self.commandFunc)
+            self.bind(DGG.B3CLICK, self.commandFunc)
         else:
         else:
-            self.unbind(B3CLICK)
+            self.unbind(DGG.B3CLICK)
             self.guiItem.removeClickButton(MouseButton.three())
             self.guiItem.removeClickButton(MouseButton.three())
 
 
     def commandFunc(self, event):
     def commandFunc(self, event):
@@ -105,22 +111,22 @@ class DirectButton(DirectFrame):
     def setClickSound(self):
     def setClickSound(self):
         clickSound = self['clickSound']
         clickSound = self['clickSound']
         # Clear out sounds
         # Clear out sounds
-        self.guiItem.clearSound(B1PRESS + self.guiId)
-        self.guiItem.clearSound(B2PRESS + self.guiId)
-        self.guiItem.clearSound(B3PRESS + self.guiId)
+        self.guiItem.clearSound(DGG.B1PRESS + self.guiId)
+        self.guiItem.clearSound(DGG.B2PRESS + self.guiId)
+        self.guiItem.clearSound(DGG.B3PRESS + self.guiId)
         if clickSound:
         if clickSound:
-            if LMB in self['commandButtons']:
-                self.guiItem.setSound(B1PRESS + self.guiId, clickSound)
-            if MMB in self['commandButtons']:
-                self.guiItem.setSound(B2PRESS + self.guiId, clickSound)
-            if RMB in self['commandButtons']:
-                self.guiItem.setSound(B3PRESS + self.guiId, clickSound)
+            if DGG.LMB in self['commandButtons']:
+                self.guiItem.setSound(DGG.B1PRESS + self.guiId, clickSound)
+            if DGG.MMB in self['commandButtons']:
+                self.guiItem.setSound(DGG.B2PRESS + self.guiId, clickSound)
+            if DGG.RMB in self['commandButtons']:
+                self.guiItem.setSound(DGG.B3PRESS + self.guiId, clickSound)
 
 
     def setRolloverSound(self):
     def setRolloverSound(self):
         rolloverSound = self['rolloverSound']
         rolloverSound = self['rolloverSound']
         if rolloverSound:
         if rolloverSound:
-            self.guiItem.setSound(ENTER + self.guiId, rolloverSound)
+            self.guiItem.setSound(DGG.ENTER + self.guiId, rolloverSound)
         else:
         else:
-            self.guiItem.clearSound(ENTER + self.guiId)
+            self.guiItem.clearSound(DGG.ENTER + self.guiId)
 
 
 
 

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

@@ -1,3 +1,9 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectCheckButton']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectButton import *
 from DirectButton import *
 from DirectLabel import *
 from DirectLabel import *
 
 

+ 32 - 27
direct/src/gui/DirectDialog.py

@@ -1,4 +1,9 @@
-from DirectGuiGlobals import *
+"""Undocumented Module"""
+
+__all__ = ['findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog', 'OkCancelDialog', 'YesNoDialog', 'YesNoCancelDialog', 'RetryCancelDialog']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
 
 
@@ -79,7 +84,7 @@ class DirectDialog(DirectFrame):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('dialogName',        'DirectDialog_' + `DirectDialog.PanelIndex`,  INITOPT),
+            ('dialogName',        'DirectDialog_' + `DirectDialog.PanelIndex`,  DGG.INITOPT),
             # Default position is slightly forward in Y, so as not to
             # Default position is slightly forward in Y, so as not to
             # intersect the near plane, which is incorrectly set to 0
             # intersect the near plane, which is incorrectly set to 0
             # in DX for some reason.
             # in DX for some reason.
@@ -90,20 +95,20 @@ class DirectDialog(DirectFrame):
             ('text_scale',        0.06,          None),
             ('text_scale',        0.06,          None),
             ('image',  getDefaultDialogGeom(),   None),
             ('image',  getDefaultDialogGeom(),   None),
             ('relief',            None,          None),
             ('relief',            None,          None),
-            ('buttonTextList',    [],            INITOPT),
-            ('buttonGeomList',    [],            INITOPT),
-            ('buttonImageList',   [],            INITOPT),
-            ('buttonValueList',   [],            INITOPT),
-            ('buttonHotKeyList',  [],            INITOPT),
-            ('button_borderWidth', (.01, .01),     None),
-            ('button_pad',        (.01, .01),     None),
-            ('button_relief',     RAISED,        None),
-            ('button_text_scale', 0.06,        None),
-            ('buttonSize',        None,          INITOPT),
-            ('topPad',            0.06,          INITOPT),
-            ('midPad',            0.12,          INITOPT),
-            ('sidePad',           0.,            INITOPT),
-            ('buttonPadSF',       1.1,          INITOPT),
+            ('buttonTextList',    [],            DGG.INITOPT),
+            ('buttonGeomList',    [],            DGG.INITOPT),
+            ('buttonImageList',   [],            DGG.INITOPT),
+            ('buttonValueList',   [],            DGG.INITOPT),
+            ('buttonHotKeyList',  [],            DGG.INITOPT),
+            ('button_borderWidth', (.01, .01),   None),
+            ('button_pad',        (.01, .01),    None),
+            ('button_relief',     DGG.RAISED,    None),
+            ('button_text_scale', 0.06,          None),
+            ('buttonSize',        None,          DGG.INITOPT),
+            ('topPad',            0.06,          DGG.INITOPT),
+            ('midPad',            0.12,          DGG.INITOPT),
+            ('sidePad',           0.,            DGG.INITOPT),
+            ('buttonPadSF',       1.1,           DGG.INITOPT),
             # Alpha of fade screen behind dialog
             # Alpha of fade screen behind dialog
             ('fadeScreen',        0,             None),
             ('fadeScreen',        0,             None),
             ('command',           None,          None),
             ('command',           None,          None),
@@ -334,8 +339,8 @@ class OkDialog(DirectDialog):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('buttonTextList',  ['OK'],       INITOPT),
-            ('buttonValueList', [DIALOG_OK],          INITOPT),
+            ('buttonTextList',  ['OK'],       DGG.INITOPT),
+            ('buttonValueList', [DGG.DIALOG_OK],          DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -347,8 +352,8 @@ class OkCancelDialog(DirectDialog):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('buttonTextList',  ['OK','Cancel'],       INITOPT),
-            ('buttonValueList', [DIALOG_OK, DIALOG_CANCEL], INITOPT),
+            ('buttonTextList',  ['OK','Cancel'],       DGG.INITOPT),
+            ('buttonValueList', [DGG.DIALOG_OK, DGG.DIALOG_CANCEL], DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -360,8 +365,8 @@ class YesNoDialog(DirectDialog):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('buttonTextList',  ['Yes', 'No'],       INITOPT),
-            ('buttonValueList', [DIALOG_YES, DIALOG_NO], INITOPT),
+            ('buttonTextList',  ['Yes', 'No'],       DGG.INITOPT),
+            ('buttonValueList', [DGG.DIALOG_YES, DGG.DIALOG_NO], DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -373,9 +378,9 @@ class YesNoCancelDialog(DirectDialog):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('buttonTextList',  ['Yes', 'No', 'Cancel'],  INITOPT),
-            ('buttonValueList', [DIALOG_YES, DIALOG_NO, DIALOG_CANCEL],
-             INITOPT),
+            ('buttonTextList',  ['Yes', 'No', 'Cancel'],  DGG.INITOPT),
+            ('buttonValueList', [DGG.DIALOG_YES, DGG.DIALOG_NO, DGG.DIALOG_CANCEL],
+             DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -387,8 +392,8 @@ class RetryCancelDialog(DirectDialog):
         # Inherits from DirectFrame
         # Inherits from DirectFrame
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
-            ('buttonTextList',  ['Retry','Cancel'],   INITOPT),
-            ('buttonValueList', [DIALOG_RETRY, DIALOG_CANCEL], INITOPT),
+            ('buttonTextList',  ['Retry','Cancel'],   DGG.INITOPT),
+            ('buttonValueList', [DGG.DIALOG_RETRY, DGG.DIALOG_CANCEL], DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)

+ 20 - 14
direct/src/gui/DirectEntry.py

@@ -1,5 +1,11 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectEntry']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
-import types
+import string,types
 
 
 # DirectEntry States:
 # DirectEntry States:
 ENTRY_FOCUS_STATE    = PGEntry.SFocus      # 0
 ENTRY_FOCUS_STATE    = PGEntry.SFocus      # 0
@@ -29,8 +35,8 @@ class DirectEntry(DirectFrame):
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('pgFunc',          PGEntry,          None),
             ('pgFunc',          PGEntry,          None),
             ('numStates',       3,                None),
             ('numStates',       3,                None),
-            ('state',           NORMAL,           None),
-            ('entryFont',       None,             INITOPT),
+            ('state',           DGG.NORMAL,       None),
+            ('entryFont',       None,             DGG.INITOPT),
             ('width',           10,               self.setup),
             ('width',           10,               self.setup),
             ('numLines',        1,                self.setup),
             ('numLines',        1,                self.setup),
             ('focus',           0,                self.setFocus),
             ('focus',           0,                self.setFocus),
@@ -42,18 +48,18 @@ class DirectEntry(DirectFrame):
             ('backgroundFocus', 0,                self.setBackgroundFocus),
             ('backgroundFocus', 0,                self.setBackgroundFocus),
             # Text used for the PGEntry text node
             # Text used for the PGEntry text node
             # NOTE: This overrides the DirectFrame text option
             # NOTE: This overrides the DirectFrame text option
-            ('initialText',     '',               INITOPT),
+            ('initialText',     '',               DGG.INITOPT),
             # Command to be called on hitting Enter
             # Command to be called on hitting Enter
             ('command',        None,              None),
             ('command',        None,              None),
             ('extraArgs',      [],                None),
             ('extraArgs',      [],                None),
             # commands to be called when focus is gained or lost
             # commands to be called when focus is gained or lost
             ('focusInCommand', None,              None),
             ('focusInCommand', None,              None),
             ('focusInExtraArgs', [],              None),
             ('focusInExtraArgs', [],              None),
-            ('focusOutCommand', None,              None),
-            ('focusOutExtraArgs', [],              None),
+            ('focusOutCommand', None,             None),
+            ('focusOutExtraArgs', [],             None),
             # Sounds to be used for button events
             # Sounds to be used for button events
-            ('rolloverSound',   getDefaultRolloverSound(), self.setRolloverSound),
-            ('clickSound',    getDefaultClickSound(),    self.setClickSound),
+            ('rolloverSound',   DGG.getDefaultRolloverSound(), self.setRolloverSound),
+            ('clickSound',      DGG.getDefaultClickSound(),    self.setClickSound),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -62,7 +68,7 @@ class DirectEntry(DirectFrame):
         DirectFrame.__init__(self, parent)
         DirectFrame.__init__(self, parent)
 
 
         if self['entryFont'] == None:
         if self['entryFont'] == None:
-            font = getDefaultFont()
+            font = DGG.getDefaultFont()
         else:
         else:
             font = self['entryFont']
             font = self['entryFont']
 
 
@@ -87,7 +93,7 @@ class DirectEntry(DirectFrame):
         self.onscreenText.removeNode()
         self.onscreenText.removeNode()
 
 
         # Bind command function
         # Bind command function
-        self.bind(ACCEPT, self.commandFunc)
+        self.bind(DGG.ACCEPT, self.commandFunc)
 
 
         self.accept(self.guiItem.getFocusInEvent(), self.focusInCommandFunc)
         self.accept(self.guiItem.getFocusInEvent(), self.focusInCommandFunc)
         self.accept(self.guiItem.getFocusOutEvent(), self.focusOutCommandFunc)
         self.accept(self.guiItem.getFocusOutEvent(), self.focusOutCommandFunc)
@@ -127,16 +133,16 @@ class DirectEntry(DirectFrame):
     def setRolloverSound(self):
     def setRolloverSound(self):
         rolloverSound = self['rolloverSound']
         rolloverSound = self['rolloverSound']
         if rolloverSound:
         if rolloverSound:
-            self.guiItem.setSound(ENTER + self.guiId, rolloverSound)
+            self.guiItem.setSound(DGG.ENTER + self.guiId, rolloverSound)
         else:
         else:
-            self.guiItem.clearSound(ENTER + self.guiId)
+            self.guiItem.clearSound(DGG.ENTER + self.guiId)
 
 
     def setClickSound(self):
     def setClickSound(self):
         clickSound = self['clickSound']
         clickSound = self['clickSound']
         if clickSound:
         if clickSound:
-            self.guiItem.setSound(ACCEPT + self.guiId, clickSound)
+            self.guiItem.setSound(DGG.ACCEPT + self.guiId, clickSound)
         else:
         else:
-            self.guiItem.clearSound(ACCEPT + self.guiId)
+            self.guiItem.clearSound(DGG.ACCEPT + self.guiId)
 
 
     def commandFunc(self, event):
     def commandFunc(self, event):
         if self['command']:
         if self['command']:

+ 11 - 3
direct/src/gui/DirectFrame.py

@@ -1,4 +1,12 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectFrame']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectGuiBase import *
 from DirectGuiBase import *
+from OnscreenImage import *
+import string, types
 
 
 class DirectFrame(DirectGuiWidget):
 class DirectFrame(DirectGuiWidget):
     def __init__(self, parent = None, **kw):
     def __init__(self, parent = None, **kw):
@@ -76,7 +84,7 @@ class DirectFrame(DirectGuiWidget):
                         OnscreenText,
                         OnscreenText,
                         (), parent = self.stateNodePath[i],
                         (), parent = self.stateNodePath[i],
                         text = text, scale = 1, mayChange = self['textMayChange'],
                         text = text, scale = 1, mayChange = self['textMayChange'],
-                        sort = TEXT_SORT_INDEX,
+                        sort = DGG.TEXT_SORT_INDEX,
                         )
                         )
 
 
     def setGeom(self):
     def setGeom(self):
@@ -119,7 +127,7 @@ class DirectFrame(DirectGuiWidget):
                         OnscreenGeom,
                         OnscreenGeom,
                         (), parent = self.stateNodePath[i],
                         (), parent = self.stateNodePath[i],
                         geom = geom, scale = 1,
                         geom = geom, scale = 1,
-                        sort = GEOM_SORT_INDEX)
+                        sort = DGG.GEOM_SORT_INDEX)
 
 
     def setImage(self):
     def setImage(self):
         # Determine argument type
         # Determine argument type
@@ -167,4 +175,4 @@ class DirectFrame(DirectGuiWidget):
                         OnscreenImage,
                         OnscreenImage,
                         (), parent = self.stateNodePath[i],
                         (), parent = self.stateNodePath[i],
                         image = image, scale = 1,
                         image = image, scale = 1,
-                        sort = IMAGE_SORT_INDEX)
+                        sort = DGG.IMAGE_SORT_INDEX)

+ 3 - 1
direct/src/gui/DirectGui.py

@@ -1,4 +1,6 @@
-from DirectGuiGlobals import *
+"""Undocumented Module"""
+
+import DirectGuiGlobals
 from OnscreenText import *
 from OnscreenText import *
 from OnscreenGeom import *
 from OnscreenGeom import *
 from OnscreenImage import *
 from OnscreenImage import *

+ 49 - 48
direct/src/gui/DirectGuiBase.py

@@ -1,23 +1,24 @@
-from DirectGuiGlobals import *
+"""Undocumented Module"""
+
+__all__ = ['DirectGuiBase', 'DirectGuiWidget']
+
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from OnscreenText import *
 from OnscreenText import *
 from OnscreenGeom import *
 from OnscreenGeom import *
 from OnscreenImage import *
 from OnscreenImage import *
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.directtools.DirectUtil import ROUND_TO
 from direct.showbase import DirectObject
 from direct.showbase import DirectObject
 from direct.task import Task
 from direct.task import Task
-import string
 from direct.showbase import ShowBase
 from direct.showbase import ShowBase
+import string, types
 
 
 """
 """
 Base class for all Direct Gui items.  Handles composite widgets and
 Base class for all Direct Gui items.  Handles composite widgets and
 command line argument parsing.
 command line argument parsing.
 """
 """
 
 
-# Symbolic constants for the indexes into an optionInfo list.
-_OPT_DEFAULT         = 0
-_OPT_VALUE           = 1
-_OPT_FUNCTION        = 2
-
 """
 """
 Code Overview:
 Code Overview:
 
 
@@ -190,7 +191,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         optionInfo_has_key = optionInfo.has_key
         optionInfo_has_key = optionInfo.has_key
         keywords = self._constructorKeywords
         keywords = self._constructorKeywords
         keywords_has_key = keywords.has_key
         keywords_has_key = keywords.has_key
-        FUNCTION = _OPT_FUNCTION
+        FUNCTION = DGG._OPT_FUNCTION
 
 
         for name, default, function in optionDefs:
         for name, default, function in optionDefs:
             if '_' not in name:
             if '_' not in name:
@@ -228,11 +229,11 @@ class DirectGuiBase(DirectObject.DirectObject):
         # the most specific class in the class hierarchy
         # the most specific class in the class hierarchy
         if self.__class__ is myClass:
         if self.__class__ is myClass:
             # Call the configuration callback function for every option.
             # Call the configuration callback function for every option.
-            FUNCTION = _OPT_FUNCTION
+            FUNCTION = DGG._OPT_FUNCTION
             self.fInit = 1
             self.fInit = 1
             for info in self._optionInfo.values():
             for info in self._optionInfo.values():
                 func = info[FUNCTION]
                 func = info[FUNCTION]
-                if func is not None and func is not INITOPT:
+                if func is not None and func is not DGG.INITOPT:
                     func()
                     func()
             self.fInit = 0
             self.fInit = 0
 
 
@@ -267,7 +268,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         """
         """
         Is this opition one that can only be specified at construction?
         Is this opition one that can only be specified at construction?
         """
         """
-        return self._optionInfo[option][_OPT_FUNCTION] is INITOPT
+        return self._optionInfo[option][DGG._OPT_FUNCTION] is DGG.INITOPT
 
 
     def options(self):
     def options(self):
         """
         """
@@ -277,8 +278,8 @@ class DirectGuiBase(DirectObject.DirectObject):
         options = []
         options = []
         if hasattr(self, '_optionInfo'):
         if hasattr(self, '_optionInfo'):
             for option, info in self._optionInfo.items():
             for option, info in self._optionInfo.items():
-                isinit = info[_OPT_FUNCTION] is INITOPT
-                default = info[_OPT_DEFAULT]
+                isinit = info[DGG._OPT_FUNCTION] is DGG.INITOPT
+                default = info[DGG._OPT_DEFAULT]
                 options.append((option, default, isinit))
                 options.append((option, default, isinit))
             options.sort()
             options.sort()
         return options
         return options
@@ -311,12 +312,12 @@ class DirectGuiBase(DirectObject.DirectObject):
                 rtn = {}
                 rtn = {}
                 for option, config in self._optionInfo.items():
                 for option, config in self._optionInfo.items():
                     rtn[option] = (option,
                     rtn[option] = (option,
-                                   config[_OPT_DEFAULT],
-                                   config[_OPT_VALUE])
+                                   config[DGG._OPT_DEFAULT],
+                                   config[DGG._OPT_VALUE])
                 return rtn
                 return rtn
             else:
             else:
                 config = self._optionInfo[option]
                 config = self._optionInfo[option]
-                return (option, config[_OPT_DEFAULT], config[_OPT_VALUE])
+                return (option, config[DGG._OPT_DEFAULT], config[DGG._OPT_VALUE])
 
 
         # optimizations:
         # optimizations:
         optionInfo = self._optionInfo
         optionInfo = self._optionInfo
@@ -325,8 +326,8 @@ class DirectGuiBase(DirectObject.DirectObject):
         componentInfo_has_key = componentInfo.has_key
         componentInfo_has_key = componentInfo.has_key
         componentAliases = self.__componentAliases
         componentAliases = self.__componentAliases
         componentAliases_has_key = componentAliases.has_key
         componentAliases_has_key = componentAliases.has_key
-        VALUE = _OPT_VALUE
-        FUNCTION = _OPT_FUNCTION
+        VALUE = DGG._OPT_VALUE
+        FUNCTION = DGG._OPT_FUNCTION
 
 
         # This will contain a list of options in *kw* which
         # This will contain a list of options in *kw* which
         # are known to this gui item.
         # are known to this gui item.
@@ -345,7 +346,7 @@ class DirectGuiBase(DirectObject.DirectObject):
             if optionInfo_has_key(option):
             if optionInfo_has_key(option):
                 # This is one of the options of this gui item.
                 # This is one of the options of this gui item.
                 # Check it is an initialisation option.
                 # Check it is an initialisation option.
-                if optionInfo[option][FUNCTION] is INITOPT:
+                if optionInfo[option][FUNCTION] is DGG.INITOPT:
                     print 'Cannot configure initialisation option "' \
                     print 'Cannot configure initialisation option "' \
                           + option + '" for ' + self.__class__.__name__
                           + option + '" for ' + self.__class__.__name__
                     break
                     break
@@ -420,7 +421,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         # Call the configuration callback function for each option.
         # Call the configuration callback function for each option.
         for option in directOptions:
         for option in directOptions:
             info = optionInfo[option]
             info = optionInfo[option]
-            func = info[_OPT_FUNCTION]
+            func = info[DGG._OPT_FUNCTION]
             if func is not None:
             if func is not None:
               func()
               func()
 
 
@@ -434,7 +435,7 @@ class DirectGuiBase(DirectObject.DirectObject):
         """
         """
         # Return the value of an option, for example myWidget['font'].
         # Return the value of an option, for example myWidget['font'].
         if self._optionInfo.has_key(option):
         if self._optionInfo.has_key(option):
-            return self._optionInfo[option][_OPT_VALUE]
+            return self._optionInfo[option][DGG._OPT_VALUE]
         else:
         else:
             index = string.find(option, '_')
             index = string.find(option, '_')
             if index >= 0:
             if index >= 0:
@@ -657,9 +658,9 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
     #guiEdit = base.config.GetBool('direct-gui-edit', 0)
     #guiEdit = base.config.GetBool('direct-gui-edit', 0)
     guiEdit = config.GetBool('direct-gui-edit', 0)
     guiEdit = config.GetBool('direct-gui-edit', 0)
     if guiEdit:
     if guiEdit:
-        inactiveInitState = NORMAL
+        inactiveInitState = DGG.NORMAL
     else:
     else:
-        inactiveInitState = DISABLED
+        inactiveInitState = DGG.DISABLED
 
 
     guiDict = {}
     guiDict = {}
 
 
@@ -682,26 +683,26 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
             ('invertedFrames', (),           None),
             ('invertedFrames', (),           None),
             ('sortOrder',      0,            None),
             ('sortOrder',      0,            None),
             # Widget's initial state
             # Widget's initial state
-            ('state',          NORMAL,       self.setState),
+            ('state',          DGG.NORMAL,   self.setState),
             # Widget's frame characteristics
             # Widget's frame characteristics
-            ('relief',         FLAT,         self.setRelief),
-            ('borderWidth',    (.1, .1),      self.setBorderWidth),
+            ('relief',         DGG.FLAT,     self.setRelief),
+            ('borderWidth',    (.1, .1),     self.setBorderWidth),
             ('frameSize',      None,         self.setFrameSize),
             ('frameSize',      None,         self.setFrameSize),
             ('frameColor',     (.8, .8, .8, 1), self.setFrameColor),
             ('frameColor',     (.8, .8, .8, 1), self.setFrameColor),
             ('frameTexture',   None,         self.setFrameTexture),
             ('frameTexture',   None,         self.setFrameTexture),
             ('frameVisibleScale', (1, 1),     self.setFrameVisibleScale),
             ('frameVisibleScale', (1, 1),     self.setFrameVisibleScale),
             ('pad',            (0, 0),        self.resetFrameSize),
             ('pad',            (0, 0),        self.resetFrameSize),
             # Override button id (beware! your name may not be unique!)
             # Override button id (beware! your name may not be unique!)
-            ('guiId',          None,         INITOPT),
+            ('guiId',          None,         DGG.INITOPT),
             # Initial pos/scale of the widget
             # Initial pos/scale of the widget
-            ('pos',            None,         INITOPT),
-            ('hpr',            None,         INITOPT),
-            ('scale',          None,         INITOPT),
-            ('color',          None,         INITOPT),
+            ('pos',            None,         DGG.INITOPT),
+            ('hpr',            None,         DGG.INITOPT),
+            ('scale',          None,         DGG.INITOPT),
+            ('color',          None,         DGG.INITOPT),
             # Do events pass through this widget?
             # Do events pass through this widget?
-            ('suppressMouse',  1,            INITOPT),
-            ('suppressKeys',   0,            INITOPT),
-            ('enableEdit',     1,            INITOPT),
+            ('suppressMouse',  1,            DGG.INITOPT),
+            ('suppressKeys',   0,            DGG.INITOPT),
+            ('enableEdit',     1,            DGG.INITOPT),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -787,7 +788,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
 
 
         # Bind destroy hook
         # Bind destroy hook
         self.guiDict[self.guiId] = self
         self.guiDict[self.guiId] = self
-        # self.bind(DESTROY, self.destroy)
+        # self.bind(DGG.DESTROY, self.destroy)
 
 
         # Update frame when everything has been initialized
         # Update frame when everything has been initialized
         self.postInitialiseFuncList.append(self.frameInitialiseFunc)
         self.postInitialiseFuncList.append(self.frameInitialiseFunc)
@@ -802,9 +803,9 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
             self.resetFrameSize()
             self.resetFrameSize()
 
 
     def enableEdit(self):
     def enableEdit(self):
-        self.bind(B2PRESS, self.editStart)
-        self.bind(B2RELEASE, self.editStop)
-        self.bind(PRINT, self.printConfig)
+        self.bind(DGG.B2PRESS, self.editStart)
+        self.bind(DGG.B2RELEASE, self.editStop)
+        self.bind(DGG.PRINT, self.printConfig)
         # Can we move this to showbase
         # Can we move this to showbase
         # Certainly we don't need to do this for every button!
         # Certainly we don't need to do this for every button!
         #mb = base.mouseWatcherNode.getModifierButtons()
         #mb = base.mouseWatcherNode.getModifierButtons()
@@ -812,9 +813,9 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
         #base.mouseWatcherNode.setModifierButtons(mb)
         #base.mouseWatcherNode.setModifierButtons(mb)
 
 
     def disableEdit(self):
     def disableEdit(self):
-        self.unbind(B2PRESS)
-        self.unbind(B2RELEASE)
-        self.unbind(PRINT)
+        self.unbind(DGG.B2PRESS)
+        self.unbind(DGG.B2RELEASE)
+        self.unbind(DGG.PRINT)
         #mb = base.mouseWatcherNode.getModifierButtons()
         #mb = base.mouseWatcherNode.getModifierButtons()
         #mb.removeButton(KeyboardButton.control())
         #mb.removeButton(KeyboardButton.control())
         #base.mouseWatcherNode.setModifierButtons(mb)
         #base.mouseWatcherNode.setModifierButtons(mb)
@@ -863,7 +864,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
     def setState(self):
     def setState(self):
         if type(self['state']) == type(0):
         if type(self['state']) == type(0):
             self.guiItem.setActive(self['state'])
             self.guiItem.setActive(self['state'])
-        elif (self['state'] == NORMAL) or (self['state'] == 'normal'):
+        elif (self['state'] == DGG.NORMAL) or (self['state'] == 'normal'):
             self.guiItem.setActive(1)
             self.guiItem.setActive(1)
         else:
         else:
             self.guiItem.setActive(0)
             self.guiItem.setActive(0)
@@ -945,18 +946,18 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
             # Convert string to frame style int
             # Convert string to frame style int
             relief = FrameStyleDict[relief]
             relief = FrameStyleDict[relief]
         # Set style
         # Set style
-        if relief == RAISED:
+        if relief == DGG.RAISED:
             for i in range(self['numStates']):
             for i in range(self['numStates']):
                 if i in self['invertedFrames']:
                 if i in self['invertedFrames']:
-                    self.frameStyle[1].setType(SUNKEN)
+                    self.frameStyle[1].setType(DGG.SUNKEN)
                 else:
                 else:
-                    self.frameStyle[i].setType(RAISED)
-        elif relief == SUNKEN:
+                    self.frameStyle[i].setType(DGG.RAISED)
+        elif relief == DGG.SUNKEN:
             for i in range(self['numStates']):
             for i in range(self['numStates']):
                 if i in self['invertedFrames']:
                 if i in self['invertedFrames']:
-                    self.frameStyle[1].setType(RAISED)
+                    self.frameStyle[1].setType(DGG.RAISED)
                 else:
                 else:
-                    self.frameStyle[i].setType(SUNKEN)
+                    self.frameStyle[i].setType(DGG.SUNKEN)
         else:
         else:
             for i in range(self['numStates']):
             for i in range(self['numStates']):
                 self.frameStyle[i].setType(relief)
                 self.frameStyle[i].setType(relief)

+ 17 - 7
direct/src/gui/DirectGuiGlobals.py

@@ -1,9 +1,22 @@
+"""Undocumented Module"""
+
+__all__ = []
+
+
 """
 """
 Global definitions used by Direct Gui Classes and handy constants
 Global definitions used by Direct Gui Classes and handy constants
 that can be used during widget construction
 that can be used during widget construction
 """
 """
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 
 
+defaultFont = None
+defaultFontFunc = TextNode.getDefaultFont
+defaultClickSound = None
+defaultRolloverSound = None
+defaultDialogGeom = None
+drawOrder = 100
+panel = None
+
 # USEFUL GUI CONSTANTS
 # USEFUL GUI CONSTANTS
 # Constant used to indicate that an option can only be set by a call
 # Constant used to indicate that an option can only be set by a call
 # to the constructor.
 # to the constructor.
@@ -73,13 +86,10 @@ BACKGROUND_SORT_INDEX = -100
 MIDGROUND_SORT_INDEX = 0
 MIDGROUND_SORT_INDEX = 0
 FOREGROUND_SORT_INDEX = 100
 FOREGROUND_SORT_INDEX = 100
 
 
-defaultFont = None
-defaultFontFunc = TextNode.getDefaultFont
-defaultClickSound = None
-defaultRolloverSound = None
-defaultDialogGeom = None
-drawOrder = 100
-panel = None
+# Symbolic constants for the indexes into an optionInfo list.
+_OPT_DEFAULT         = 0
+_OPT_VALUE           = 1
+_OPT_FUNCTION        = 2
 
 
 def getDefaultRolloverSound():
 def getDefaultRolloverSound():
     global defaultRolloverSound
     global defaultRolloverSound

+ 10 - 6
direct/src/gui/DirectGuiTest.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = []
+
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     from direct.directbase import DirectStart
     from direct.directbase import DirectStart
@@ -63,8 +67,8 @@ if __name__ == "__main__":
                           # Here is an example of a component group option
                           # Here is an example of a component group option
                           text_pos = (.6, -.8),
                           text_pos = (.6, -.8),
                           # Set audio characteristics
                           # Set audio characteristics
-                          clickSound = getDefaultClickSound(),
-                          rolloverSound = getDefaultRolloverSound()
+                          clickSound = DirectGuiGlobals.getDefaultClickSound(),
+                          rolloverSound = DirectGuiGlobals.getDefaultRolloverSound()
                           )
                           )
 
 
         # You can set component or component group options after a gui item
         # You can set component or component group options after a gui item
@@ -73,11 +77,11 @@ if __name__ == "__main__":
         db['command'] = lambda i = i: dummyCmd(i)
         db['command'] = lambda i = i: dummyCmd(i)
 
 
         # Bind the commands
         # Bind the commands
-        db.bind(ENTER, lambda x, db = db: shrink(db))
-        db.bind(EXIT, lambda x, db = db: expand(db))
-        db.bind(B1PRESS, lambda x, db = db: ouch(db))
+        db.bind(DirectGuiGlobals.ENTER, lambda x, db = db: shrink(db))
+        db.bind(DirectGuiGlobals.EXIT, lambda x, db = db: expand(db))
+        db.bind(DirectGuiGlobals.B1PRESS, lambda x, db = db: ouch(db))
         # Pop up placer when button 2 is pressed
         # Pop up placer when button 2 is pressed
-        db.bind(B3PRESS, lambda x, db = db: db.place())
+        db.bind(DirectGuiGlobals.B3PRESS, lambda x, db = db: db.place())
 
 
         dbArray.append(db)
         dbArray.append(db)
 
 

+ 6 - 0
direct/src/gui/DirectLabel.py

@@ -1,3 +1,9 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectLabel']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 
 
 class DirectLabel(DirectFrame):
 class DirectLabel(DirectFrame):

+ 18 - 12
direct/src/gui/DirectOptionMenu.py

@@ -1,3 +1,9 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectOptionMenu']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectButton import *
 from DirectButton import *
 from DirectLabel import *
 from DirectLabel import *
 
 
@@ -16,7 +22,7 @@ class DirectOptionMenu(DirectButton):
             ('items',       [],             self.setItems),
             ('items',       [],             self.setItems),
             # Initial item to display on menu button
             # Initial item to display on menu button
             # Can be an interger index or the same string as the button
             # Can be an interger index or the same string as the button
-            ('initialitem', None,           INITOPT),
+            ('initialitem', None,           DGG.INITOPT),
             # Amount of padding to place around popup button indicator
             # Amount of padding to place around popup button indicator
             ('popupMarkerBorder', (.1, .1), None),
             ('popupMarkerBorder', (.1, .1), None),
             # Background color to use to highlight popup menu items
             # Background color to use to highlight popup menu items
@@ -27,7 +33,7 @@ class DirectOptionMenu(DirectButton):
             # Changing this breaks button layout
             # Changing this breaks button layout
             ('text_align',  TextNode.ALeft, None),
             ('text_align',  TextNode.ALeft, None),
             # Remove press effect because it looks a bit funny
             # Remove press effect because it looks a bit funny
-            ('pressEffect',     0,          INITOPT),
+            ('pressEffect',     0,          DGG.INITOPT),
            )
            )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -42,14 +48,14 @@ class DirectOptionMenu(DirectButton):
             DirectFrame, (self,),
             DirectFrame, (self,),
             frameSize = (-0.5, 0.5, -0.2, 0.2),
             frameSize = (-0.5, 0.5, -0.2, 0.2),
             scale = 0.4,
             scale = 0.4,
-            relief = RAISED)
+            relief = DGG.RAISED)
         # This needs to popup the menu too
         # This needs to popup the menu too
-        self.popupMarker.bind(B1PRESS, self.showPopupMenu)
+        self.popupMarker.bind(DGG.B1PRESS, self.showPopupMenu)
         # Check if item is highlighted on release and select it if it is
         # Check if item is highlighted on release and select it if it is
-        self.popupMarker.bind(B1RELEASE, self.selectHighlightedIndex)
+        self.popupMarker.bind(DGG.B1RELEASE, self.selectHighlightedIndex)
         # Make popup marker have the same click sound
         # Make popup marker have the same click sound
         self.popupMarker.guiItem.setSound(
         self.popupMarker.guiItem.setSound(
-            B1PRESS + self.popupMarker.guiId, self['clickSound'])
+            DGG.B1PRESS + self.popupMarker.guiId, self['clickSound'])
         # This is created when you set the menu's items
         # This is created when you set the menu's items
         self.popupMenu = None
         self.popupMenu = None
         self.selectedIndex = None
         self.selectedIndex = None
@@ -63,11 +69,11 @@ class DirectOptionMenu(DirectButton):
             state = 'normal')
             state = 'normal')
         # Make sure this is on top of all the other widgets
         # Make sure this is on top of all the other widgets
         self.cancelFrame.setBin('gui-popup', 0)
         self.cancelFrame.setBin('gui-popup', 0)
-        self.cancelFrame.bind(B1PRESS, self.hidePopupMenu)
+        self.cancelFrame.bind(DGG.B1PRESS, self.hidePopupMenu)
         # Default action on press is to show popup menu
         # Default action on press is to show popup menu
-        self.bind(B1PRESS, self.showPopupMenu)
+        self.bind(DGG.B1PRESS, self.showPopupMenu)
         # Check if item is highlighted on release and select it if it is
         # Check if item is highlighted on release and select it if it is
-        self.bind(B1RELEASE, self.selectHighlightedIndex)
+        self.bind(DGG.B1RELEASE, self.selectHighlightedIndex)
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectOptionMenu)
         self.initialiseoptions(DirectOptionMenu)
         # Need to call this since we explicitly set frame size
         # Need to call this since we explicitly set frame size
@@ -129,13 +135,13 @@ class DirectOptionMenu(DirectButton):
             item['frameSize'] = (self.minX, self.maxX, self.minZ, self.maxZ)
             item['frameSize'] = (self.minX, self.maxX, self.minZ, self.maxZ)
             # Move it to its correct position on the popup
             # Move it to its correct position on the popup
             item.setPos(-self.minX, 0, -self.maxZ - i * self.maxHeight)
             item.setPos(-self.minX, 0, -self.maxZ - i * self.maxHeight)
-            item.bind(B1RELEASE, self.hidePopupMenu)
+            item.bind(DGG.B1RELEASE, self.hidePopupMenu)
             # Highlight background when mouse is in item
             # Highlight background when mouse is in item
-            item.bind(WITHIN,
+            item.bind(DGG.WITHIN,
                       lambda x, i=i, item=item:self._highlightItem(item, i))
                       lambda x, i=i, item=item:self._highlightItem(item, i))
             # Restore specified color upon exiting
             # Restore specified color upon exiting
             fc = item['frameColor']
             fc = item['frameColor']
-            item.bind(WITHOUT,
+            item.bind(DGG.WITHOUT,
                       lambda x, item=item, fc=fc: self._unhighlightItem(item, fc))
                       lambda x, item=item, fc=fc: self._unhighlightItem(item, fc))
         # Set popup menu frame size to encompass all items
         # Set popup menu frame size to encompass all items
         f = self.component('popupMenu')
         f = self.component('popupMenu')

+ 14 - 9
direct/src/gui/DirectScrollBar.py

@@ -1,6 +1,11 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectScrollBar']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
-from DirectGuiBase import _OPT_VALUE
 
 
 """
 """
 import DirectScrollBar
 import DirectScrollBar
@@ -17,14 +22,14 @@ class DirectScrollBar(DirectFrame):
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('pgFunc',         PGSliderBar,        None),
             ('pgFunc',         PGSliderBar,        None),
-            ('state',          NORMAL,             None),
-            ('frameColor',     (0.6, 0.6, 0.6, 1),    None),
+            ('state',          DGG.NORMAL,         None),
+            ('frameColor',     (0.6, 0.6, 0.6, 1), None),
 
 
             ('range',          (0, 1),             self.setRange),
             ('range',          (0, 1),             self.setRange),
             ('value',          0,                  self.__setValue),
             ('value',          0,                  self.__setValue),
             ('scrollSize',     0.01,               self.setScrollSize),
             ('scrollSize',     0.01,               self.setScrollSize),
             ('pageSize',       0.1,                self.setPageSize),
             ('pageSize',       0.1,                self.setPageSize),
-            ('orientation',    HORIZONTAL,         self.setOrientation),
+            ('orientation',    DGG.HORIZONTAL,     self.setOrientation),
             ('manageButtons',  1,                  self.setManageButtons),
             ('manageButtons',  1,                  self.setManageButtons),
             ('resizeThumb',    1,                  self.setResizeThumb),
             ('resizeThumb',    1,                  self.setResizeThumb),
 
 
@@ -33,7 +38,7 @@ class DirectScrollBar(DirectFrame):
             ('extraArgs',      [],                 None),
             ('extraArgs',      [],                 None),
             )
             )
 
 
-        if kw.get('orientation') == VERTICAL:
+        if kw.get('orientation') == DGG.VERTICAL:
             # These are the default options for a vertical layout.
             # These are the default options for a vertical layout.
             optiondefs += (
             optiondefs += (
                 ('frameSize',      (-0.04, 0.04, -0.5, 0.5),   None),
                 ('frameSize',      (-0.04, 0.04, -0.5, 0.5),   None),
@@ -68,7 +73,7 @@ class DirectScrollBar(DirectFrame):
         self.guiItem.setRightButton(self.incButton.guiItem)
         self.guiItem.setRightButton(self.incButton.guiItem)
 
 
         # Bind command function
         # Bind command function
-        self.bind(ADJUST, self.commandFunc)
+        self.bind(DGG.ADJUST, self.commandFunc)
 
 
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectScrollBar)
         self.initialiseoptions(DirectScrollBar)
@@ -104,9 +109,9 @@ class DirectScrollBar(DirectFrame):
         self.guiItem.setPageSize(self['pageSize'])
         self.guiItem.setPageSize(self['pageSize'])
 
 
     def setOrientation(self):
     def setOrientation(self):
-        if self['orientation'] == HORIZONTAL:
+        if self['orientation'] == DGG.HORIZONTAL:
             self.guiItem.setAxis(Vec3(1, 0, 0))
             self.guiItem.setAxis(Vec3(1, 0, 0))
-        elif self['orientation'] == VERTICAL:
+        elif self['orientation'] == DGG.VERTICAL:
             self.guiItem.setAxis(Vec3(0, 0, -1))
             self.guiItem.setAxis(Vec3(0, 0, -1))
         else:
         else:
             raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
             raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
@@ -122,7 +127,7 @@ class DirectScrollBar(DirectFrame):
 
 
     def commandFunc(self):
     def commandFunc(self):
         # Store the updated value in self['value']
         # Store the updated value in self['value']
-        self._optionInfo['value'][_OPT_VALUE] = self.guiItem.getValue()
+        self._optionInfo['value'][DGG._OPT_VALUE] = self.guiItem.getValue()
 
 
         if self['command']:
         if self['command']:
             apply(self['command'], self['extraArgs'])
             apply(self['command'], self['extraArgs'])

+ 8 - 3
direct/src/gui/DirectScrolledFrame.py

@@ -1,10 +1,15 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectScrolledFrame']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectScrollBar import *
 from DirectScrollBar import *
 
 
 """
 """
 import DirectScrolledFrame
 import DirectScrolledFrame
 d = DirectScrolledFrame(borderWidth=(0, 0))
 d = DirectScrolledFrame(borderWidth=(0, 0))
-
 """
 """
 
 
 class DirectScrolledFrame(DirectFrame):
 class DirectScrolledFrame(DirectFrame):
@@ -49,14 +54,14 @@ class DirectScrolledFrame(DirectFrame):
             DirectScrollBar, (self,),
             DirectScrollBar, (self,),
             borderWidth = self['borderWidth'],
             borderWidth = self['borderWidth'],
             frameSize = (-w / 2.0, w / 2.0, -1, 1),
             frameSize = (-w / 2.0, w / 2.0, -1, 1),
-            orientation = VERTICAL)
+            orientation = DGG.VERTICAL)
 
 
         self.horizontalScroll = self.createcomponent(
         self.horizontalScroll = self.createcomponent(
             "horizontalScroll", (), None,
             "horizontalScroll", (), None,
             DirectScrollBar, (self,),
             DirectScrollBar, (self,),
             borderWidth = self['borderWidth'],
             borderWidth = self['borderWidth'],
             frameSize = (-1, 1, -w / 2.0, w / 2.0),
             frameSize = (-1, 1, -w / 2.0, w / 2.0),
-            orientation = HORIZONTAL)
+            orientation = DGG.HORIZONTAL)
 
 
         self.guiItem.setVerticalSlider(self.verticalScroll.guiItem)
         self.guiItem.setVerticalSlider(self.verticalScroll.guiItem)
         self.guiItem.setHorizontalSlider(self.horizontalScroll.guiItem)
         self.guiItem.setHorizontalSlider(self.horizontalScroll.guiItem)

+ 31 - 25
direct/src/gui/DirectScrolledList.py

@@ -1,8 +1,14 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectScrolledListItem', 'DirectScrolledList']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from direct.directnotify import DirectNotifyGlobal
 from direct.directnotify import DirectNotifyGlobal
+from direct.task.Task import Task
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
-from direct.task import Task
-import types
+import string, types
 
 
 
 
 class DirectScrolledListItem(DirectButton):
 class DirectScrolledListItem(DirectButton):
@@ -68,8 +74,8 @@ class DirectScrolledList(DirectFrame):
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('items',              [],        None),
             ('items',              [],        None),
-            ('itemsAlign',  TextNode.ACenter, INITOPT),
-            ('itemsWordwrap',      None,      INITOPT),
+            ('itemsAlign',  TextNode.ACenter, DGG.INITOPT),
+            ('itemsWordwrap',      None,      DGG.INITOPT),
             ('command',            None,      None),
             ('command',            None,      None),
             ('extraArgs',          [],        None),
             ('extraArgs',          [],        None),
             ('itemMakeFunction',   None,      None),
             ('itemMakeFunction',   None,      None),
@@ -87,13 +93,13 @@ class DirectScrolledList(DirectFrame):
         self.incButton = self.createcomponent("incButton", (), None,
         self.incButton = self.createcomponent("incButton", (), None,
                                               DirectButton, (self,),
                                               DirectButton, (self,),
                                               )
                                               )
-        self.incButton.bind(B1PRESS, self.__incButtonDown)
-        self.incButton.bind(B1RELEASE, self.__buttonUp)
+        self.incButton.bind(DGG.B1PRESS, self.__incButtonDown)
+        self.incButton.bind(DGG.B1RELEASE, self.__buttonUp)
         self.decButton = self.createcomponent("decButton", (), None,
         self.decButton = self.createcomponent("decButton", (), None,
                                               DirectButton, (self,),
                                               DirectButton, (self,),
                                               )
                                               )
-        self.decButton.bind(B1PRESS, self.__decButtonDown)
-        self.decButton.bind(B1RELEASE, self.__buttonUp)
+        self.decButton.bind(DGG.B1PRESS, self.__decButtonDown)
+        self.decButton.bind(DGG.B1RELEASE, self.__buttonUp)
         self.itemFrame = self.createcomponent("itemFrame", (), None,
         self.itemFrame = self.createcomponent("itemFrame", (), None,
                                               DirectFrame, (self,),
                                               DirectFrame, (self,),
                                               )
                                               )
@@ -143,8 +149,8 @@ class DirectScrolledList(DirectFrame):
     def selectListItem(self, item):
     def selectListItem(self, item):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
         if hasattr(self, "currentSelected"):
         if hasattr(self, "currentSelected"):
-            self.currentSelected['state']=NORMAL
-        item['state']=DISABLED
+            self.currentSelected['state']=DGG.NORMAL
+        item['state']=DGG.DISABLED
         self.currentSelected=item
         self.currentSelected=item
 
 
     def scrollBy(self, delta):
     def scrollBy(self, delta):
@@ -189,26 +195,26 @@ class DirectScrolledList(DirectFrame):
         # Not enough items to even worry about scrolling,
         # Not enough items to even worry about scrolling,
         # just disable the buttons and do nothing
         # just disable the buttons and do nothing
         if (len(self["items"]) <= numItemsVisible):
         if (len(self["items"]) <= numItemsVisible):
-            self.incButton['state'] = DISABLED
-            self.decButton['state'] = DISABLED
+            self.incButton['state'] = DGG.DISABLED
+            self.decButton['state'] = DGG.DISABLED
             # Hmm.. just reset self.index to 0 and bail out
             # Hmm.. just reset self.index to 0 and bail out
             self.index = 0
             self.index = 0
             ret = 0
             ret = 0
         else:
         else:
             if (self.index <= 0):
             if (self.index <= 0):
                 self.index = 0
                 self.index = 0
-                self.decButton['state'] = DISABLED
-                self.incButton['state'] = NORMAL
+                self.decButton['state'] = DGG.DISABLED
+                self.incButton['state'] = DGG.NORMAL
                 ret = 0
                 ret = 0
             elif (self.index >= (numItemsTotal - numItemsVisible)):
             elif (self.index >= (numItemsTotal - numItemsVisible)):
                 self.index = numItemsTotal - numItemsVisible
                 self.index = numItemsTotal - numItemsVisible
                 # print "at list end, ", len(self["items"]),"  ", self["numItemsVisible"]
                 # print "at list end, ", len(self["items"]),"  ", self["numItemsVisible"]
-                self.incButton['state'] = DISABLED
-                self.decButton['state'] = NORMAL
+                self.incButton['state'] = DGG.DISABLED
+                self.decButton['state'] = DGG.NORMAL
                 ret = 0
                 ret = 0
             else:
             else:
-                self.incButton['state'] = NORMAL
-                self.decButton['state'] = NORMAL
+                self.incButton['state'] = DGG.NORMAL
+                self.decButton['state'] = DGG.NORMAL
                 ret = 1
                 ret = 1
 
 
         # print "self.index set to ", self.index
         # print "self.index set to ", self.index
@@ -286,7 +292,7 @@ class DirectScrolledList(DirectFrame):
 
 
     def __incButtonDown(self, event):
     def __incButtonDown(self, event):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
-        task = Task.Task(self.__scrollByTask)
+        task = Task(self.__scrollByTask)
         task.delayTime = (1.0 / self.scrollSpeed)
         task.delayTime = (1.0 / self.scrollSpeed)
         task.prevTime = 0.0
         task.prevTime = 0.0
         task.delta = 1
         task.delta = 1
@@ -296,7 +302,7 @@ class DirectScrolledList(DirectFrame):
 
 
     def __decButtonDown(self, event):
     def __decButtonDown(self, event):
         assert self.notify.debugStateCall(self)
         assert self.notify.debugStateCall(self)
-        task = Task.Task(self.__scrollByTask)
+        task = Task(self.__scrollByTask)
         task.delayTime = (1.0 / self.scrollSpeed)
         task.delayTime = (1.0 / self.scrollSpeed)
         task.prevTime = 0.0
         task.prevTime = 0.0
         task.delta = -1
         task.delta = -1
@@ -370,7 +376,7 @@ def makeButton(itemName, itemNum, *extraArgs):
     def buttonCommand():
     def buttonCommand():
         print itemName, itemNum
         print itemName, itemNum
     return DirectButton(text = itemName,
     return DirectButton(text = itemName,
-                        relief = RAISED,
+                        relief = DGG.RAISED,
                         frameSize = (-3.5, 3.5, -0.2, 0.8),
                         frameSize = (-3.5, 3.5, -0.2, 0.8),
                         scale = 0.85,
                         scale = 0.85,
                         command = buttonCommand)
                         command = buttonCommand)
@@ -379,7 +385,7 @@ s = scrollList = DirectScrolledList(
     parent = aspect2d,
     parent = aspect2d,
     relief = None,
     relief = None,
     # Use the default dialog box image as the background
     # Use the default dialog box image as the background
-    image = getDefaultDialogGeom(),
+    image = DGG.getDefaultDialogGeom(),
     # Scale it to fit around everyting
     # Scale it to fit around everyting
     image_scale = (0.7, 1, .8),
     image_scale = (0.7, 1, .8),
     # Give it a label
     # Give it a label
@@ -392,12 +398,12 @@ s = scrollList = DirectScrolledList(
     # They can contain a combination of text, geometry and images
     # They can contain a combination of text, geometry and images
     # Just a simple text one for now
     # Just a simple text one for now
     incButton_text = 'Increment',
     incButton_text = 'Increment',
-    incButton_relief = RAISED,
+    incButton_relief = DGG.RAISED,
     incButton_pos = (0.0, 0.0, -0.36),
     incButton_pos = (0.0, 0.0, -0.36),
     incButton_scale = 0.1,
     incButton_scale = 0.1,
     # Same for the decrement button
     # Same for the decrement button
     decButton_text = 'Decrement',
     decButton_text = 'Decrement',
-    decButton_relief = RAISED,
+    decButton_relief = DGG.RAISED,
     decButton_pos = (0.0, 0.0, 0.175),
     decButton_pos = (0.0, 0.0, 0.175),
     decButton_scale = 0.1,
     decButton_scale = 0.1,
     # each item is a button with text on it
     # each item is a button with text on it
@@ -411,6 +417,6 @@ s = scrollList = DirectScrolledList(
     itemFrame_pos = (0, 0, 0.06),
     itemFrame_pos = (0, 0, 0.06),
     itemFrame_scale = 0.1,
     itemFrame_scale = 0.1,
     itemFrame_frameSize = (-3.1, 3.1, -3.3, 0.8),
     itemFrame_frameSize = (-3.1, 3.1, -3.3, 0.8),
-    itemFrame_relief = GROOVE,
+    itemFrame_relief = DGG.GROOVE,
     )
     )
 """
 """

+ 15 - 10
direct/src/gui/DirectSlider.py

@@ -1,6 +1,11 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectSlider']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 from DirectButton import *
 from DirectButton import *
-from DirectGuiBase import _OPT_VALUE
 
 
 """
 """
 import DirectSlider
 import DirectSlider
@@ -17,20 +22,20 @@ class DirectSlider(DirectFrame):
         optiondefs = (
         optiondefs = (
             # Define type of DirectGuiWidget
             # Define type of DirectGuiWidget
             ('pgFunc',         PGSliderBar,        None),
             ('pgFunc',         PGSliderBar,        None),
-            ('state',          NORMAL,             None),
-            ('frameColor',     (0.6, 0.6, 0.6, 1),    None),
+            ('state',          DGG.NORMAL,         None),
+            ('frameColor',     (0.6, 0.6, 0.6, 1), None),
 
 
             ('range',          (0, 1),             self.setRange),
             ('range',          (0, 1),             self.setRange),
             ('value',          0,                  self.__setValue),
             ('value',          0,                  self.__setValue),
             ('pageSize',       0.1,                self.setPageSize),
             ('pageSize',       0.1,                self.setPageSize),
-            ('orientation',    HORIZONTAL,         self.setOrientation),
+            ('orientation',    DGG.HORIZONTAL,     self.setOrientation),
 
 
             # Function to be called repeatedly as slider is moved
             # Function to be called repeatedly as slider is moved
             ('command',        None,               None),
             ('command',        None,               None),
             ('extraArgs',      [],                 None),
             ('extraArgs',      [],                 None),
             )
             )
 
 
-        if kw.get('orientation') == VERTICAL:
+        if kw.get('orientation') == DGG.VERTICAL:
             # These are the default options for a vertical layout.
             # These are the default options for a vertical layout.
             optiondefs += (
             optiondefs += (
                 ('frameSize',      (-0.08, 0.08, -1, 1),   None),
                 ('frameSize',      (-0.08, 0.08, -1, 1),   None),
@@ -56,7 +61,7 @@ class DirectSlider(DirectFrame):
            self.thumb.bounds == [0.0, 0.0, 0.0, 0.0]:
            self.thumb.bounds == [0.0, 0.0, 0.0, 0.0]:
             # Compute a default frameSize for the thumb.
             # Compute a default frameSize for the thumb.
             f = self['frameSize']
             f = self['frameSize']
-            if self['orientation'] == HORIZONTAL:
+            if self['orientation'] == DGG.HORIZONTAL:
                 self.thumb['frameSize'] = (f[0]*0.05, f[1]*0.05, f[2], f[3])
                 self.thumb['frameSize'] = (f[0]*0.05, f[1]*0.05, f[2], f[3])
             else:
             else:
                 self.thumb['frameSize'] = (f[0], f[1], f[2]*0.05, f[3]*0.05)
                 self.thumb['frameSize'] = (f[0], f[1], f[2]*0.05, f[3]*0.05)
@@ -64,7 +69,7 @@ class DirectSlider(DirectFrame):
         self.guiItem.setThumbButton(self.thumb.guiItem)
         self.guiItem.setThumbButton(self.thumb.guiItem)
 
 
         # Bind command function
         # Bind command function
-        self.bind(ADJUST, self.commandFunc)
+        self.bind(DGG.ADJUST, self.commandFunc)
 
 
         # Call option initialization functions
         # Call option initialization functions
         self.initialiseoptions(DirectSlider)
         self.initialiseoptions(DirectSlider)
@@ -97,9 +102,9 @@ class DirectSlider(DirectFrame):
         self.guiItem.setPageSize(self['pageSize'])
         self.guiItem.setPageSize(self['pageSize'])
 
 
     def setOrientation(self):
     def setOrientation(self):
-        if self['orientation'] == HORIZONTAL:
+        if self['orientation'] == DGG.HORIZONTAL:
             self.guiItem.setAxis(Vec3(1, 0, 0))
             self.guiItem.setAxis(Vec3(1, 0, 0))
-        elif self['orientation'] == VERTICAL:
+        elif self['orientation'] == DGG.VERTICAL:
             self.guiItem.setAxis(Vec3(0, 0, 1))
             self.guiItem.setAxis(Vec3(0, 0, 1))
         else:
         else:
             raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
             raise ValueError, 'Invalid value for orientation: %s' % (self['orientation'])
@@ -109,7 +114,7 @@ class DirectSlider(DirectFrame):
 
 
     def commandFunc(self):
     def commandFunc(self):
         # Store the updated value in self['value']
         # Store the updated value in self['value']
-        self._optionInfo['value'][_OPT_VALUE] = self.guiItem.getValue()
+        self._optionInfo['value'][DGG._OPT_VALUE] = self.guiItem.getValue()
 
 
         if self['command']:
         if self['command']:
             apply(self['command'], self['extraArgs'])
             apply(self['command'], self['extraArgs'])

+ 9 - 4
direct/src/gui/DirectWaitBar.py

@@ -1,9 +1,14 @@
+"""Undocumented Module"""
+
+__all__ = ['DirectWaitBar']
+
+from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from DirectFrame import *
 from DirectFrame import *
 
 
 """
 """
 import DirectWaitBar
 import DirectWaitBar
 d = DirectWaitBar(borderWidth=(0, 0))
 d = DirectWaitBar(borderWidth=(0, 0))
-
 """
 """
 
 
 class DirectWaitBar(DirectFrame):
 class DirectWaitBar(DirectFrame):
@@ -24,9 +29,9 @@ class DirectWaitBar(DirectFrame):
             ('borderWidth',    (0, 0),              None),
             ('borderWidth',    (0, 0),              None),
             ('range',          100,                self.setRange),
             ('range',          100,                self.setRange),
             ('value',          0,                  self.setValue),
             ('value',          0,                  self.setValue),
-            ('barBorderWidth', (0, 0),              self.setBarBorderWidth),
-            ('barColor',       (1, 0, 0, 1),          self.setBarColor),
-            ('barRelief',      FLAT,               self.setBarRelief),
+            ('barBorderWidth', (0, 0),             self.setBarBorderWidth),
+            ('barColor',       (1, 0, 0, 1),       self.setBarColor),
+            ('barRelief',      DGG.FLAT,           self.setBarRelief),
             ('sortOrder',      NO_FADE_SORT_INDEX, None),
             ('sortOrder',      NO_FADE_SORT_INDEX, None),
             )
             )
         if kw.has_key('text'):
         if kw.has_key('text'):

+ 4 - 2
direct/src/gui/OnscreenGeom.py

@@ -1,9 +1,11 @@
 """OnscreenGeom module: contains the OnscreenGeom class"""
 """OnscreenGeom module: contains the OnscreenGeom class"""
 
 
-import string
-import types
+__all__ = ['OnscreenGeom']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
+import string,types
 
 
 class OnscreenGeom(DirectObject, NodePath):
 class OnscreenGeom(DirectObject, NodePath):
     def __init__(self, geom = None,
     def __init__(self, geom = None,

+ 4 - 2
direct/src/gui/OnscreenImage.py

@@ -1,9 +1,11 @@
 """OnscreenImage module: contains the OnscreenImage class"""
 """OnscreenImage module: contains the OnscreenImage class"""
 
 
+__all__ = ['OnscreenImage']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-import types
-import string
+import string,types
 
 
 class OnscreenImage(DirectObject, NodePath):
 class OnscreenImage(DirectObject, NodePath):
     def __init__(self, image = None,
     def __init__(self, image = None,

+ 5 - 4
direct/src/gui/OnscreenText.py

@@ -1,10 +1,11 @@
 """OnscreenText module: contains the OnscreenText class"""
 """OnscreenText module: contains the OnscreenText class"""
 
 
+__all__ = ['OnscreenText']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
+import DirectGuiGlobals as DGG
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
-import DirectGuiGlobals
-import types
-import string
+import string,types
 
 
 ## These are the styles of text we might commonly see.  They set the
 ## These are the styles of text we might commonly see.  They set the
 ## overall appearance of the text according to one of a number of
 ## overall appearance of the text according to one of a number of
@@ -165,7 +166,7 @@ class OnscreenText(DirectObject, NodePath):
             textNode.setCardDecal(1)
             textNode.setCardDecal(1)
 
 
         if font == None:
         if font == None:
-            font = DirectGuiGlobals.getDefaultFont()
+            font = DGG.getDefaultFont()
 
 
         textNode.setFont(font)
         textNode.setFont(font)
         textNode.setTextColor(fg[0], fg[1], fg[2], fg[3])
         textNode.setTextColor(fg[0], fg[1], fg[2], fg[3])

+ 2 - 0
direct/src/interval/ActorInterval.py

@@ -1,5 +1,7 @@
 """ActorInterval module: contains the ActorInterval class"""
 """ActorInterval module: contains the ActorInterval class"""
 
 
+__all__ = ['ActorInterval', 'LerpAnimInterval']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval

+ 2 - 0
direct/src/interval/FunctionInterval.py

@@ -1,5 +1,7 @@
 """FunctionInterval module: contains the FunctionInterval class"""
 """FunctionInterval module: contains the FunctionInterval class"""
 
 
+__all__ = ['FunctionInterval', 'EventInterval', 'AcceptInterval', 'IgnoreInterval', 'ParentInterval', 'WrtParentInterval', 'PosInterval', 'HprInterval', 'ScaleInterval', 'PosHprInterval', 'HprScaleInterval', 'PosHprScaleInterval', 'Func', 'Wait']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.showbase.MessengerGlobal import *
 from direct.showbase.MessengerGlobal import *
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify

+ 2 - 0
direct/src/interval/IndirectInterval.py

@@ -1,5 +1,7 @@
 """IndirectInterval module: contains the IndirectInterval class"""
 """IndirectInterval module: contains the IndirectInterval class"""
 
 
+__all__ = ['IndirectInterval']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval

+ 2 - 0
direct/src/interval/Interval.py

@@ -1,5 +1,7 @@
 """Interval module: contains the Interval class"""
 """Interval module: contains the Interval class"""
 
 
+__all__ = ['Interval']
+
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.directnotify.DirectNotifyGlobal import directNotify
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from pandac.PandaModules import *
 from pandac.PandaModules import *

+ 5 - 3
direct/src/interval/IntervalGlobal.py

@@ -1,6 +1,9 @@
 """IntervalGlobal module"""
 """IntervalGlobal module"""
 
 
-# from DirectObject import *
+# In this unusual case, I'm not going to declare __all__,
+# since the purpose of this module is to add up the contributions
+# of a number of other modules.
+
 from Interval import *
 from Interval import *
 from ActorInterval import *
 from ActorInterval import *
 from FunctionInterval import *
 from FunctionInterval import *
@@ -9,9 +12,8 @@ from IndirectInterval import *
 from MopathInterval import *
 from MopathInterval import *
 from ParticleInterval import *
 from ParticleInterval import *
 from SoundInterval import *
 from SoundInterval import *
-#from pandac.WaitInterval import *
-from pandac.PandaModules import *
 from ProjectileInterval import *
 from ProjectileInterval import *
 from MetaInterval import *
 from MetaInterval import *
 from IntervalManager import *
 from IntervalManager import *
 from TestInterval import *
 from TestInterval import *
+from pandac.PandaModules import WaitInterval

+ 4 - 0
direct/src/interval/IntervalManager.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['IntervalManager']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from pandac import PandaModules
 from pandac import PandaModules
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *

+ 4 - 0
direct/src/interval/IntervalTest.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = []
+
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     from direct.directbase import DirectStart
     from direct.directbase import DirectStart

+ 2 - 0
direct/src/interval/LerpInterval.py

@@ -1,5 +1,7 @@
 """LerpInterval module: contains the LerpInterval class"""
 """LerpInterval module: contains the LerpInterval class"""
 
 
+__all__ = ['LerpNodePathInterval', 'LerpPosInterval', 'LerpHprInterval', 'LerpQuatInterval', 'LerpScaleInterval', 'LerpShearInterval', 'LerpPosHprInterval', 'LerpPosQuatInterval', 'LerpHprScaleInterval', 'LerpQuatScaleInterval', 'LerpPosHprScaleInterval', 'LerpPosQuatScaleInterval', 'LerpPosHprScaleShearInterval', 'LerpPosQuatScaleShearInterval', 'LerpColorScaleInterval', 'LerpColorInterval', 'LerpFunctionInterval', 'LerpFunc']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval

+ 4 - 0
direct/src/interval/MetaInterval.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['MetaInterval', 'Sequence', 'Parallel', 'ParallelEndTogether', 'Track']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 from IntervalManager import ivalMgr
 from IntervalManager import ivalMgr

+ 2 - 0
direct/src/interval/MopathInterval.py

@@ -1,5 +1,7 @@
 """MopathInterval module: contains the MopathInterval class"""
 """MopathInterval module: contains the MopathInterval class"""
 
 
+__all__ = ['MopathInterval']
+
 import LerpInterval
 import LerpInterval
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *

+ 4 - 0
direct/src/interval/ParticleInterval.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['ParticleInterval']
+
 """
 """
 Contains the ParticleInterval class
 Contains the ParticleInterval class
 """
 """

+ 2 - 0
direct/src/interval/ProjectileInterval.py

@@ -1,5 +1,7 @@
 """ProjectileInterval module: contains the ProjectileInterval class"""
 """ProjectileInterval module: contains the ProjectileInterval class"""
 
 
+__all__ = ['ProjectileInterval']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from Interval import Interval
 from Interval import Interval
 from direct.showbase.PythonUtil import lerp
 from direct.showbase.PythonUtil import lerp

+ 4 - 0
direct/src/interval/ProjectileIntervalTest.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['doTest']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directbase.DirectStart import *
 from direct.directbase.DirectStart import *
 from IntervalGlobal import *
 from IntervalGlobal import *

+ 2 - 0
direct/src/interval/SoundInterval.py

@@ -1,5 +1,7 @@
 """SoundInterval module: contains the SoundInterval class"""
 """SoundInterval module: contains the SoundInterval class"""
 
 
+__all__ = ['SoundInterval']
+
 from pandac.PandaModules import *
 from pandac.PandaModules import *
 from direct.directnotify.DirectNotifyGlobal import *
 from direct.directnotify.DirectNotifyGlobal import *
 import Interval
 import Interval

+ 4 - 0
direct/src/interval/TestInterval.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['TestInterval']
+
 """
 """
 Contains the ParticleInterval class
 Contains the ParticleInterval class
 """
 """

+ 3 - 3
direct/src/leveleditor/LevelEditor.py

@@ -3,7 +3,7 @@ from pandac.PandaModules import *
 from direct.directbase.DirectStart import *
 from direct.directbase.DirectStart import *
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.DirectObject import DirectObject
 from PieMenu import *
 from PieMenu import *
-from direct.gui.DirectGuiGlobals import *
+import direct.gui.DirectGuiGlobals
 from direct.showbase.TkGlobal import *
 from direct.showbase.TkGlobal import *
 from direct.directtools.DirectUtil import *
 from direct.directtools.DirectUtil import *
 from direct.directtools.DirectGeometry import *
 from direct.directtools.DirectGeometry import *
@@ -4634,7 +4634,7 @@ class LevelStyleManager:
         for i in range (numItems):
         for i in range (numItems):
             # Create a text node--just a card, really--of the right color.
             # Create a text node--just a card, really--of the right color.
             tn = TextNode('colorChip')
             tn = TextNode('colorChip')
-            tn.setFont(getDefaultFont())
+            tn.setFont(DirectGuiGlobals.getDefaultFont())
             tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
             tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
             tn.setCardColor(colorList[i])
             tn.setCardColor(colorList[i])
             tn.setCardActual(0, 1.1111, 0, 0.8333)
             tn.setCardActual(0, 1.1111, 0, 0.8333)
@@ -4760,7 +4760,7 @@ class LevelStyleManager:
             # Create text node for each item
             # Create text node for each item
             if (textList[i] != None):
             if (textList[i] != None):
                 tn = TextNode('TextItem')
                 tn = TextNode('TextItem')
-                tn.setFont(getDefaultFont())
+                tn.setFont(DirectGuiGlobals.getDefaultFont())
                 tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
                 tn.setTransform(Mat4.scaleMat(0.07, 0.07, 0.07 * aspectRatio))
                 tn.setTextColor(0, 0, 0, 1)
                 tn.setTextColor(0, 0, 0, 1)
                 tn.setCardColor(1, 1, 1, 1)
                 tn.setCardColor(1, 1, 1, 1)