Browse Source

*** empty log message ***

Joe Shochet 23 years ago
parent
commit
bef2cc7c6f
2 changed files with 11 additions and 0 deletions
  1. 9 0
      direct/src/gui/DirectScrolledList.py
  2. 2 0
      direct/src/showbase/ShowBase.py

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

@@ -6,6 +6,7 @@ class DirectScrolledList(DirectFrame):
     def __init__(self, parent = aspect2d, **kw):
     def __init__(self, parent = aspect2d, **kw):
 
 
         self.index = 0
         self.index = 0
+        self.forceHeight = None
 
 
         # If one were to want a scrolledList that makes and adds its items
         # If one were to want a scrolledList that makes and adds its items
         #   as needed, simply pass in an items list of strings (type 'str')
         #   as needed, simply pass in an items list of strings (type 'str')
@@ -23,6 +24,7 @@ class DirectScrolledList(DirectFrame):
             ('itemMakeExtraArgs',  [],        None),
             ('itemMakeExtraArgs',  [],        None),
             ('numItemsVisible',    1,         self.setNumItemsVisible),
             ('numItemsVisible',    1,         self.setNumItemsVisible),
             ('scrollSpeed',        8,         self.setScrollSpeed),
             ('scrollSpeed',        8,         self.setScrollSpeed),
+            ('forceHeight',        None,      self.setForceHeight),
             )
             )
         # Merge keyword options with default options
         # Merge keyword options with default options
         self.defineoptions(kw, optiondefs)
         self.defineoptions(kw, optiondefs)
@@ -53,12 +55,19 @@ class DirectScrolledList(DirectFrame):
         #    self.scrollTo(0)
         #    self.scrollTo(0)
         self.scrollTo(0)
         self.scrollTo(0)
         
         
+    def setForceHeight(self):
+        self.forceHeight = self["forceHeight"]
 
 
     def recordMaxHeight(self):
     def recordMaxHeight(self):
+        if self.forceHeight is not None:
+            self.maxHeight = self.forceHeight
+            return
+        
         self.maxHeight = 0.0
         self.maxHeight = 0.0
         for item in self["items"]:
         for item in self["items"]:
             if item.__class__.__name__ != 'str':
             if item.__class__.__name__ != 'str':
                 self.maxHeight = max(self.maxHeight, item.getHeight())
                 self.maxHeight = max(self.maxHeight, item.getHeight())
+        return
         
         
     def setScrollSpeed(self):
     def setScrollSpeed(self):
         # Items per second to move
         # Items per second to move

+ 2 - 0
direct/src/showbase/ShowBase.py

@@ -859,6 +859,8 @@ class ShowBase:
         imageName = ('%s-%s-%d.%s' % (namePrefix, date, frameCount, self.screenshotExtension))
         imageName = ('%s-%s-%d.%s' % (namePrefix, date, frameCount, self.screenshotExtension))
         self.notify.info("Taking screenshot: " + imageName)
         self.notify.info("Taking screenshot: " + imageName)
         takeSnapshot(self.win, imageName)
         takeSnapshot(self.win, imageName)
+        # Announce to anybody that a screenshot has been taken
+        messenger.send('screenshot')
 
 
     def movie(self, namePrefix = 'movie', duration = 1.0, fps = 30,
     def movie(self, namePrefix = 'movie', duration = 1.0, fps = 30,
               format = 'rgb', sd = 4):
               format = 'rgb', sd = 4):