Browse Source

add scrollStep(), scrollPage()

David Rose 18 years ago
parent
commit
67da79e374
1 changed files with 10 additions and 0 deletions
  1. 10 0
      direct/src/gui/DirectScrollBar.py

+ 10 - 0
direct/src/gui/DirectScrollBar.py

@@ -108,6 +108,16 @@ class DirectScrollBar(DirectFrame):
     def setPageSize(self):
         self.guiItem.setPageSize(self['pageSize'])
 
+    def scrollStep(self, stepCount):
+        """Scrolls the indicated number of steps forward.  If
+        stepCount is negative, scrolls backward."""
+        self['value'] = self.guiItem.getValue() + self.guiItem.getScrollSize() * stepCount
+
+    def scrollPage(self, pageCount):
+        """Scrolls the indicated number of pages forward.  If
+        pageCount is negative, scrolls backward."""
+        self['value'] = self.guiItem.getValue() + self.guiItem.getPageSize() * pageCount
+
     def setOrientation(self):
         if self['orientation'] == DGG.HORIZONTAL:
             self.guiItem.setAxis(Vec3(1, 0, 0))