[Commits] (jed) Fixes Bug#2659

commits at osafoundation.org commits at osafoundation.org
Thu Mar 24 16:07:13 PST 2005


Commit by: jed
Modified files:
chandler/parcels/osaf/framework/blocks/ControlBlocks.py 1.192 1.193

Log message:
Fixes Bug#2659
Summary view column header and sidebar selection extend the entire width of the view.
r=bkirsch

Bugzilla links:
http://bugzilla.osafoundation.org/show_bug.cgi?id=2659

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/blocks/ControlBlocks.py.diff?r1=text&tr1=1.192&r2=text&tr2=1.193

Index: chandler/parcels/osaf/framework/blocks/ControlBlocks.py
diff -u chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.192 chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.193
--- chandler/parcels/osaf/framework/blocks/ControlBlocks.py:1.192	Fri Mar 18 13:41:43 2005
+++ chandler/parcels/osaf/framework/blocks/ControlBlocks.py	Thu Mar 24 16:07:11 2005
@@ -1,5 +1,5 @@
-__version__ = "$Revision: 1.192 $"
-__date__ = "$Date: 2005/03/18 21:41:43 $"
+__version__ = "$Revision: 1.193 $"
+__date__ = "$Date: 2005/03/25 00:07:11 $"
 __copyright__ = "Copyright (c) 2003-2005 Open Source Applications Foundation"
 __license__ = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -611,14 +611,14 @@
                 widthMinusLastColumn += self.GetColSize (column)
             lastColumnWidth = size.width - widthMinusLastColumn
             """
-              Big fat hack. Since the grid is a scrolled window we set a border equal to the size
-            of the scrollbar so the scroll bars won't show. Instead we should consider modifying
-            grid adding a new style for not showing scrollbars.  Bug #2375
+              This is a temporary fix to get around an apparent bug in grids.  We only want to adjust
+            for scrollbars if they are present.  The -2 is a hack, without which the sidebar will grow
+            indefinitely when resizing the window.
             """
-            lastColumnWidth = lastColumnWidth - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X)
-            # @@@ This does not work properly and needs to be looked at
-            # Removing it for the single column case because it causes the
-            # sidebar to grow indefinitely
+            if (self.GetSize() == self.GetVirtualSize()):
+                lastColumnWidth = lastColumnWidth - 2
+            else:
+                lastColumnWidth = lastColumnWidth - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X)
             if lastColumnWidth > 0:
                 self.SetColSize (lastColumnIndex, lastColumnWidth)
                 self.ForceRefresh()
@@ -685,12 +685,9 @@
 
         # update the last column to fill the rest of the widget
         remaining = self.GetSize().width - widthMinusLastColumn
-        """
-          Big fat hack. Since the grid is a scrolled window we set a border equal to the size
-        of the scrollbar so the scroll bars won't show. Instead we should consider modifying
-        grid adding a new style for not showing scrollbars.  Bug #2375
-        """
-        remaining = remaining - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X)
+        # Adjust for scrollbar if it is present
+        if (self.GetSize() != self.GetVirtualSize()):
+            remaining = remaining - wx.SystemSettings_GetMetric(wx.SYS_VSCROLL_X)
         if remaining > 0:
             self.SetColSize(newColumns - 1, remaining)
         



More information about the Commits mailing list