Browse Source

direct: a few improvements to API documentation

rdb 6 years ago
parent
commit
22e88a5b6a

+ 5 - 7
direct/src/fsm/FSM.py

@@ -117,7 +117,7 @@ class FSM(DirectObject):
     at construction time; it is simply in Off already by convention.
     at construction time; it is simply in Off already by convention.
     If you need to call code in enterOff() to initialize your FSM
     If you need to call code in enterOff() to initialize your FSM
     properly, call it explicitly in the constructor.  Similarly, when
     properly, call it explicitly in the constructor.  Similarly, when
-    cleanup() is called or the FSM is destructed, the FSM transitions
+    `cleanup()` is called or the FSM is destructed, the FSM transitions
     back to 'Off' by convention.  (It does call enterOff() at this
     back to 'Off' by convention.  (It does call enterOff() at this
     point, but does not call exitOff().)
     point, but does not call exitOff().)
 
 
@@ -261,9 +261,9 @@ class FSM(DirectObject):
     def demand(self, request, *args):
     def demand(self, request, *args):
         """Requests a state transition, by code that does not expect
         """Requests a state transition, by code that does not expect
         the request to be denied.  If the request is denied, raises a
         the request to be denied.  If the request is denied, raises a
-        RequestDenied exception.
+        `RequestDenied` exception.
 
 
-        Unlike request(), this method allows a new request to be made
+        Unlike `request()`, this method allows a new request to be made
         while the FSM is currently in transition.  In this case, the
         while the FSM is currently in transition.  In this case, the
         request is queued up and will be executed when the current
         request is queued up and will be executed when the current
         transition finishes.  Multiple requests will queue up in
         transition finishes.  Multiple requests will queue up in
@@ -290,7 +290,7 @@ class FSM(DirectObject):
         """Requests a state transition (or other behavior).  The
         """Requests a state transition (or other behavior).  The
         request may be denied by the FSM's filter function.  If it is
         request may be denied by the FSM's filter function.  If it is
         denied, the filter function may either raise an exception
         denied, the filter function may either raise an exception
-        (RequestDenied), or it may simply return None, without
+        (`RequestDenied`), or it may simply return None, without
         changing the FSM's state.
         changing the FSM's state.
 
 
         The request parameter should be a string.  The request, along
         The request parameter should be a string.  The request, along
@@ -305,7 +305,7 @@ class FSM(DirectObject):
 
 
         If the FSM is currently in transition (i.e. in the middle of
         If the FSM is currently in transition (i.e. in the middle of
         executing an enterState or exitState function), an
         executing an enterState or exitState function), an
-        AlreadyInTransition exception is raised (but see demand(),
+        `AlreadyInTransition` exception is raised (but see `demand()`,
         which will queue these requests up and apply when the
         which will queue these requests up and apply when the
         transition is complete)."""
         transition is complete)."""
 
 
@@ -401,7 +401,6 @@ class FSM(DirectObject):
             return (request,) + args
             return (request,) + args
         return self.defaultFilter(request, args)
         return self.defaultFilter(request, args)
 
 
-
     def setStateArray(self, stateArray):
     def setStateArray(self, stateArray):
         """array of unique states to iterate through"""
         """array of unique states to iterate through"""
         self.fsmLock.acquire()
         self.fsmLock.acquire()
@@ -410,7 +409,6 @@ class FSM(DirectObject):
         finally:
         finally:
             self.fsmLock.release()
             self.fsmLock.release()
 
 
-
     def requestNext(self, *args):
     def requestNext(self, *args):
         """Request the 'next' state in the predefined state array."""
         """Request the 'next' state in the predefined state array."""
         self.fsmLock.acquire()
         self.fsmLock.acquire()

+ 5 - 1
direct/src/gui/DirectButton.py

@@ -1,4 +1,8 @@
-"""This module contains the DirectButton class."""
+"""This module contains the DirectButton class.
+
+See the :ref:`directbutton` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectButton']
 __all__ = ['DirectButton']
 
 

+ 5 - 1
direct/src/gui/DirectCheckButton.py

@@ -1,6 +1,10 @@
 """A DirectCheckButton is a type of button that toggles between two states
 """A DirectCheckButton is a type of button that toggles between two states
 when clicked.  It also has a separate indicator that can be modified
 when clicked.  It also has a separate indicator that can be modified
-separately."""
+separately.
+
+See the :ref:`directcheckbutton` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectCheckButton']
 __all__ = ['DirectCheckButton']
 
 

+ 5 - 1
direct/src/gui/DirectDialog.py

@@ -1,4 +1,8 @@
-"""This module defines various dialog windows for the DirectGUI system."""
+"""This module defines various dialog windows for the DirectGUI system.
+
+See the :ref:`directdialog` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = [
 __all__ = [
     'findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog',
     'findDialog', 'cleanupDialog', 'DirectDialog', 'OkDialog',

+ 5 - 1
direct/src/gui/DirectEntry.py

@@ -1,5 +1,9 @@
 """Contains the DirectEntry class, a type of DirectGUI widget that accepts
 """Contains the DirectEntry class, a type of DirectGUI widget that accepts
-text entered using the keyboard."""
+text entered using the keyboard.
+
+See the :ref:`directentry` page in the programming manual for a more in-depth
+explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectEntry']
 __all__ = ['DirectEntry']
 
 

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

@@ -11,6 +11,9 @@ A DirectFrame can have:
 Each of these has 1 or more states.  The same object can be used for
 Each of these has 1 or more states.  The same object can be used for
 all states or each state can have a different text/geom/image (for
 all states or each state can have a different text/geom/image (for
 radio button and check button indicators, for example).
 radio button and check button indicators, for example).
+
+See the :ref:`directframe` page in the programming manual for a more in-depth
+explanation and an example of how to use this class.
 """
 """
 
 
 __all__ = ['DirectFrame']
 __all__ = ['DirectFrame']

+ 5 - 1
direct/src/gui/DirectLabel.py

@@ -1,4 +1,8 @@
-"""Contains the DirectLabel class."""
+"""Contains the DirectLabel class.
+
+See the :ref:`directlabel` page in the programming manual for a more in-depth
+explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectLabel']
 __all__ = ['DirectLabel']
 
 

+ 5 - 1
direct/src/gui/DirectOptionMenu.py

@@ -1,4 +1,8 @@
-"""Implements a pop-up menu containing multiple clickable options."""
+"""Implements a pop-up menu containing multiple clickable options.
+
+See the :ref:`directoptionmenu` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectOptionMenu']
 __all__ = ['DirectOptionMenu']
 
 

+ 5 - 1
direct/src/gui/DirectRadioButton.py

@@ -1,7 +1,11 @@
 """A DirectRadioButton is a type of button that, similar to a
 """A DirectRadioButton is a type of button that, similar to a
 DirectCheckButton, has a separate indicator and can be toggled between
 DirectCheckButton, has a separate indicator and can be toggled between
 two states.  However, only one DirectRadioButton in a group can be enabled
 two states.  However, only one DirectRadioButton in a group can be enabled
-at a particular time."""
+at a particular time.
+
+See the :ref:`directradiobutton` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectRadioButton']
 __all__ = ['DirectRadioButton']
 
 

+ 5 - 1
direct/src/gui/DirectScrollBar.py

@@ -1,4 +1,8 @@
-"""Defines the DirectScrollBar class."""
+"""Defines the DirectScrollBar class.
+
+See the :ref:`directscrollbar` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectScrollBar']
 __all__ = ['DirectScrollBar']
 
 

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

@@ -1,4 +1,8 @@
-"""Contains the DirectScrolledFrame class."""
+"""Contains the DirectScrolledFrame class.
+
+See the :ref:`directscrolledframe` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectScrolledFrame']
 __all__ = ['DirectScrolledFrame']
 
 
@@ -82,6 +86,9 @@ class DirectScrolledFrame(DirectFrame):
         self.guiItem.setVirtualFrame(f[0], f[1], f[2], f[3])
         self.guiItem.setVirtualFrame(f[0], f[1], f[2], f[3])
 
 
     def getCanvas(self):
     def getCanvas(self):
+        """Returns the NodePath of the virtual canvas.  Nodes parented to this
+        canvas will show inside the scrolled area.
+        """
         return self.canvas
         return self.canvas
 
 
     def setManageScrollBars(self):
     def setManageScrollBars(self):

+ 5 - 1
direct/src/gui/DirectScrolledList.py

@@ -1,4 +1,8 @@
-"""Contains the DirectScrolledList class."""
+"""Contains the DirectScrolledList class.
+
+See the :ref:`directscrolledlist` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectScrolledListItem', 'DirectScrolledList']
 __all__ = ['DirectScrolledListItem', 'DirectScrolledList']
 
 

+ 5 - 1
direct/src/gui/DirectSlider.py

@@ -1,4 +1,8 @@
-"""Defines the DirectSlider class."""
+"""Defines the DirectSlider class.
+
+See the :ref:`directslider` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectSlider']
 __all__ = ['DirectSlider']
 
 

+ 5 - 1
direct/src/gui/DirectWaitBar.py

@@ -1,4 +1,8 @@
-"""Contains the DirectWaitBar class, a progress bar widget."""
+"""Contains the DirectWaitBar class, a progress bar widget.
+
+See the :ref:`directwaitbar` page in the programming manual for a more
+in-depth explanation and an example of how to use this class.
+"""
 
 
 __all__ = ['DirectWaitBar']
 __all__ = ['DirectWaitBar']