Title: [commits] (john) [11109] Fix bug #6127: detail view too big on startup and bug #6164: Resizing application to minimal size and then resizing bigger messes up layout r=stearns
Revision
11109
Author
john
Date
2006-07-10 14:20:27 -0700 (Mon, 10 Jul 2006)

Log Message

Fix bug #6127: detail view too big on startup and bug #6164: Resizing application to minimal size and then resizing bigger messes up layout r=stearns

Modified Paths

Diff

Modified: branches/0.7alpha3/chandler/application/Utility.py (11108 => 11109)

--- branches/0.7alpha3/chandler/application/Utility.py	2006-07-10 20:58:07 UTC (rev 11108)
+++ branches/0.7alpha3/chandler/application/Utility.py	2006-07-10 21:20:27 UTC (rev 11109)
@@ -33,7 +33,7 @@
 # with your name (and some helpful text). The comment's really there just to
 # cause Subversion to warn you of a conflict when you update, in case someone 
 # else changes it at the same time you do (that's why it's on the same line).
-SCHEMA_VERSION = "216" #vajda: refactored collections for dynamic source changes
+SCHEMA_VERSION = "217" #john: change splitPercentage so we show two minicalendar months
 
 logger = None # initialized in initLogging()
 

Modified: branches/0.7alpha3/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py (11108 => 11109)

--- branches/0.7alpha3/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py	2006-07-10 20:58:07 UTC (rev 11108)
+++ branches/0.7alpha3/chandler/parcels/osaf/framework/blocks/ContainerBlocks.py	2006-07-10 21:20:27 UTC (rev 11109)
@@ -17,7 +17,7 @@
 
 from Block import (
     Block, RectangularChild, wxRectangularChild, debugName,
-    WithoutSynchronizeWidget
+    WithoutSynchronizeWidget, IgnoreSynchronizeWidget
 )
 from osaf.pim.structs import PositionType
 import DragAndDrop
@@ -55,7 +55,7 @@
                            wxRectangularChild.CalculateWXFlag(childBlock), 
                            wxRectangularChild.CalculateWXBorder(childBlock))
         sizer.Layout()
-        self.Layout()
+        IgnoreSynchronizeWidget(False, self.Layout)
 
     @classmethod
     def CalculateWXStyle(theClass, block):
@@ -216,16 +216,6 @@
         # Setting minimum pane size prevents unsplitting a window by double-clicking
         self.SetMinimumPaneSize(7) #weird number to help debug the weird sizing bug 3497
 
-    def Layout(self, *arguments, **keywords):
-        #this is here for debugging bug 3497
-        return super(wxSplitterWindow, self).Layout(*arguments, **keywords)
-
-    def OnInit(self, *arguments, **keywords):
-        #vain attempts to solve weird sizing bug
-        pass
-        #self.Layout()
-        #self.Refresh()
-
     def MoveSash(self, position):
         """
         Sets the sash position, and fires off the appropriate event
@@ -265,8 +255,22 @@
         event.Skip()
 
     def OnSplitChanging(self, event):
+        """
+          Called when the user attempts to change the splitter. We need to calculate and store
+          the new splitPercentage here. This means that the splitPercentage won't change in
+          response to a window size change, which is important if resizing windows small then
+          large will get you back to where you started (bug #6164). Also, multiple size events
+          come through when sizer Layout is called and we don't want to change the percentage
+          in response to these size changes          
+        """
         if not self.blockItem.allowResize:
             event.SetSashPosition(-1)
+        else:
+            width, windowSize = self.GetSizeTuple()
+            if self.GetSplitMode() == wx.SPLIT_VERTICAL:
+                windowSize = width
+            assert windowSize >= 0
+            self.blockItem.splitPercentage = float (event.GetSashPosition()) / windowSize
         event.Skip()
 
     @WithoutSynchronizeWidget
@@ -275,22 +279,26 @@
         event.Skip()
 
     def adjustSplit(self, position):
-        def calculatePosition():
+
+        def calculatePosition (position):
             for splitWindow in self.blockItem.childrenBlocks:
                 for child in splitWindow.childrenBlocks:
                     adjustSplitMethod = getattr (type (child.widget), "AdjustSplit", None)
                     if adjustSplitMethod is not None:
+                        position = windowSize - adjustSplitMethod(child.widget, windowSize - position)
+                        if position < 0:
+                            position = 0
                         # Python does't have a break statement that exits
                         # nested loops, so we'll use return instead
-                        return windowSize - adjustSplitMethod(child.widget, windowSize - position)
+                        return position
             return position
 
         width, windowSize = self.GetSizeTuple()
         if self.GetSplitMode() == wx.SPLIT_VERTICAL:
             windowSize = width
-        if windowSize > 0:
-            position = calculatePosition()
-            self.blockItem.splitPercentage = float (position) / windowSize
+        if windowSize >= 0:
+            # On Mac the windowSize is sometimes negative
+            position = calculatePosition (position)
             self.SetSashPosition (position)
 
     def wxSynchronizeWidget(self, useHints=False):

Modified: branches/0.7alpha3/chandler/parcels/osaf/views/cpiatest/mainblocks.py (11108 => 11109)

--- branches/0.7alpha3/chandler/parcels/osaf/views/cpiatest/mainblocks.py	2006-07-10 20:58:07 UTC (rev 11108)
+++ branches/0.7alpha3/chandler/parcels/osaf/views/cpiatest/mainblocks.py	2006-07-10 21:20:27 UTC (rev 11109)
@@ -158,6 +158,7 @@
                             SplitterWindow.template('SidebarContainer',
                                 stretchFactor = 0.0,
                                 border = RectType(0, 0, 0, 4.0),
+                                splitPercentage = 0.42,
                                 childrenBlocks = [
                                     Sidebar,
                                     BoxContainer.template('PreviewAndMiniCalendar',

Modified: branches/0.7alpha3/chandler/parcels/osaf/views/main/mainblocks.py (11108 => 11109)

--- branches/0.7alpha3/chandler/parcels/osaf/views/main/mainblocks.py	2006-07-10 20:58:07 UTC (rev 11108)
+++ branches/0.7alpha3/chandler/parcels/osaf/views/main/mainblocks.py	2006-07-10 21:20:27 UTC (rev 11109)
@@ -177,6 +177,7 @@
                             SplitterWindow.template('SidebarContainer',
                                 stretchFactor = 0.0,
                                 border = RectType(0, 0, 0, 4.0),
+                                splitPercentage = 0.42,
                                 childrenBlocks = [
                                     Sidebar,
                                     BoxContainer.template('PreviewAndMiniCalendar',




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to