* ThemeWin32Classic.cs: fix the bottom right corner painting. had
authorChris Toshok <toshok@novell.com>
Sat, 12 Aug 2006 21:19:18 +0000 (21:19 -0000)
committerChris Toshok <toshok@novell.com>
Sat, 12 Aug 2006 21:19:18 +0000 (21:19 -0000)
the VScrollBar and HScrollbar reversed.  oops.

* DataGrid.cs: fix the logic that assigns sizes to the implicit
scrollbars.  we were assigning them twice (once in
Calc{Horiz,Vertical}Scrollbar, and once in CalcGridAreas),
therefore causing two scrollbar resizes (and redraws?) to happen
per grid resize.

2006-08-12  Chris Toshok  <toshok@ximian.com>

svn path=/trunk/mcs/; revision=63672

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 33acd0c8223d2dda3f66936e605acfa6f9fcf128..c6471c796b982df4af6a6ddc9108c6fc8a8612eb 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-12  Chris Toshok  <toshok@ximian.com>
+
+       * ThemeWin32Classic.cs: fix the bottom right corner painting.  had
+       the VScrollBar and HScrollbar reversed.  oops.
+
+       * DataGrid.cs: fix the logic that assigns sizes to the implicit
+       scrollbars.  we were assigning them twice (once in
+       Calc{Horiz,Vertical}Scrollbar, and once in CalcGridAreas),
+       therefore causing two scrollbar resizes (and redraws?) to happen
+       per grid resize.
+
 2006-08-12  Chris Toshok  <toshok@ximian.com>
 
        * ToolBarButton.cs: redraw the entire button if the theme tells us
index e5ea6e7bf4918a89cc5ce957410ebab33b9ec808..a8f376f6bd3bbae59b8924acc9e04110f00e505b 100644 (file)
@@ -2637,7 +2637,9 @@ namespace System.Windows.Forms
                                        rowhdrs_area.Height -= horiz_scrollbar.Height;
                                }
 
-                               vert_scrollbar.Height = vert_scrollbar_height;
+                               vert_scrollbar.Size = new Size (vert_scrollbar.Width,
+                                                               vert_scrollbar_height);
+
                                vert_scrollbar.Maximum = vert_scrollbar_maximum;
                                Controls.Add (vert_scrollbar);
                                vert_scrollbar.Visible = true;
@@ -2648,7 +2650,9 @@ namespace System.Windows.Forms
                        }
 
                        if (needHoriz) {
-                               horiz_scrollbar.Width = horiz_scrollbar_width;
+                               horiz_scrollbar.Size = new Size (horiz_scrollbar_width,
+                                                                horiz_scrollbar.Height);
+
                                horiz_scrollbar.Maximum = horiz_scrollbar_maximum;
                                Controls.Add (horiz_scrollbar);
                                horiz_scrollbar.Visible = true;
@@ -2878,9 +2882,6 @@ namespace System.Windows.Forms
                        horiz_scrollbar.Location = new Point (ClientRectangle.X, ClientRectangle.Y +
                                ClientRectangle.Height - horiz_scrollbar.Height);
 
-                       horiz_scrollbar.Size = new Size (ClientRectangle.Width,
-                               horiz_scrollbar.Height);
-
                        horiz_scrollbar.LargeChange = cells_area.Width;
                }
 
@@ -2889,20 +2890,12 @@ namespace System.Windows.Forms
                {
                        int y;
                        
-                       if (caption_visible) {
-                               y = ClientRectangle.Y + caption_area.Height;
-                               height = ClientRectangle.Height - caption_area.Height;
-                       } else {
-                               y = ClientRectangle.Y;
-                               height = ClientRectangle.Height;
-                       }
+                       y = ClientRectangle.Y + parent_rows.Y + parent_rows.Height;
+                       height = ClientRectangle.Height - parent_rows.Y - parent_rows.Height;
 
                        vert_scrollbar.Location = new Point (ClientRectangle.X +
                                                             ClientRectangle.Width - vert_scrollbar.Width, y);
 
-                       vert_scrollbar.Size = new Size (vert_scrollbar.Width,
-                                                       height);
-
                        maximum = RowsCount;
                        
                        if (ShowEditRow && RowsCount > 0) {
index f0bdaecc570b822021251fd68afff7d5b368e7ad..1afe37effd78607f8ab86b1ae0f57ba32fac0b8e 100644 (file)
@@ -854,8 +854,8 @@ namespace System.Windows.Forms
                        // Paint scrollBar corner
                        if (grid.VScrollBar.Visible && grid.HScrollBar.Visible) {
 
-                               Rectangle corner = new Rectangle (grid.ClientRectangle.X + grid.ClientRectangle.Width - grid.HScrollBar.Width,
-                                                                 grid.ClientRectangle.Y + grid.ClientRectangle.Height - grid.VScrollBar.Height,
+                               Rectangle corner = new Rectangle (grid.ClientRectangle.X + grid.ClientRectangle.Width - grid.VScrollBar.Width,
+                                                                 grid.ClientRectangle.Y + grid.ClientRectangle.Height - grid.HScrollBar.Height,
                                                                  grid.VScrollBar.Width, grid.HScrollBar.Height);
 
                                if (pe.ClipRectangle.IntersectsWith (corner)) {