]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/lib/splitter.py
Compile fixes for Panther
[wxWidgets.git] / wxPython / wx / lib / splitter.py
index 56c3dafe6018ece4f71e1d277e464eb07d2c4a7b..c5e2e85f55cc16eaee1a4c3c31cf779eae7cd3c9 100644 (file)
@@ -1,7 +1,7 @@
 #----------------------------------------------------------------------
 # Name:        wx.lib.splitter
 # Purpose:     A class similar to wx.SplitterWindow but that allows more
 #----------------------------------------------------------------------
 # Name:        wx.lib.splitter
 # Purpose:     A class similar to wx.SplitterWindow but that allows more
-#              a single split
+#              than a single split
 #
 # Author:      Robin Dunn
 #
 #
 # Author:      Robin Dunn
 #
@@ -17,7 +17,6 @@ more than once.
 """
 
 import wx
 """
 
 import wx
-import sys
 
 _RENDER_VER = (2,6,1,1)
 
 
 _RENDER_VER = (2,6,1,1)
 
@@ -134,7 +133,7 @@ class MultiSplitterWindow(wx.PyPanel):
         of the window stack.  If sashPos is given then it is used to
         size the new window.
         """
         of the window stack.  If sashPos is given then it is used to
         size the new window.
         """
-        self.InsertWindow(sys.maxint, window, sashPos)
+        self.InsertWindow(len(self._windows), window, sashPos)
 
 
     def InsertWindow(self, idx, window, sashPos=-1):
 
 
     def InsertWindow(self, idx, window, sashPos=-1):
@@ -210,6 +209,16 @@ class MultiSplitterWindow(wx.PyPanel):
         return self._sashes[idx]
 
 
         return self._sashes[idx]
 
 
+    def SetSashPosition(self, idx, pos):
+        """
+        Set the psition of the idx'th sash, measured from the left/top
+        of the window preceding the sash.
+        """
+        assert idx < len(self._sashes)
+        self._sashes[idx] = pos
+        self._SizeWindows()
+        
+
     def SizeWindows(self):
         """
         Reposition and size the windows managed by the splitter.
     def SizeWindows(self):
         """
         Reposition and size the windows managed by the splitter.
@@ -231,14 +240,14 @@ class MultiSplitterWindow(wx.PyPanel):
         sashsize = self._GetSashSize()
         if self._orient == wx.HORIZONTAL:
             for win in self._windows:
         sashsize = self._GetSashSize()
         if self._orient == wx.HORIZONTAL:
             for win in self._windows:
-                winbest = win.GetAdjustedBestSize()
+                winbest = win.GetEffectiveMinSize()
                 best.width += max(self._minimumPaneSize, winbest.width)
                 best.height = max(best.height, winbest.height)
             best.width += sashsize * (len(self._windows)-1)
 
         else:
             for win in self._windows:
                 best.width += max(self._minimumPaneSize, winbest.width)
                 best.height = max(best.height, winbest.height)
             best.width += sashsize * (len(self._windows)-1)
 
         else:
             for win in self._windows:
-                winbest = win.GetAdjustedBestSize()
+                winbest = win.GetEffectiveMinSize()
                 best.height += max(self._minimumPaneSize, winbest.height)
                 best.width = max(best.width, winbest.width)
             best.height += sashsize * (len(self._windows)-1)
                 best.height += max(self._minimumPaneSize, winbest.height)
                 best.width = max(best.width, winbest.width)
             best.height += sashsize * (len(self._windows)-1)