2008-11-24 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ScrollableControl.cs
index 3601130ee51f1c0558838f3ea5db5b3e2f523f5f..f901ffffe132077a3ee13cb0859d6d5ca8fc78fa 100644 (file)
@@ -981,8 +981,7 @@ namespace System.Windows.Forms {
                        /* Manually setting the size of the thumb should be done before
                         * the other assignments */
                        if (hscroll_visible) {
-                               hscrollbar.SetThumbSize (right_edge);
-                               hscrollbar.LargeChange = right_edge;
+                               hscrollbar.SetManualLargeChange (right_edge);
                                hscrollbar.SmallChange = 5;
                                hscrollbar.Maximum = canvas.Width - 1;
                        } else {
@@ -993,8 +992,7 @@ namespace System.Windows.Forms {
                        }
 
                        if (vscroll_visible) {
-                               vscrollbar.SetThumbSize (bottom_edge);
-                               vscrollbar.LargeChange = bottom_edge;
+                               vscrollbar.SetManualLargeChange (bottom_edge);
                                vscrollbar.SmallChange = 5;
                                vscrollbar.Maximum = canvas.Height - 1;
                        } else {
@@ -1092,7 +1090,7 @@ namespace System.Windows.Forms {
                        hscrollbar.Visible = false;
                        hscrollbar.ValueChanged += new EventHandler (HandleScrollBar);
                        hscrollbar.Height = SystemInformation.HorizontalScrollBarHeight;
-                       hscrollbar.manual_thumb_size = true;
+                       hscrollbar.use_manual_thumb_size = true;
 #if NET_2_0
                        hscrollbar.Scroll += new ScrollEventHandler (HandleScrollEvent);
 #endif
@@ -1101,7 +1099,7 @@ namespace System.Windows.Forms {
                        vscrollbar.Visible = false;
                        vscrollbar.ValueChanged += new EventHandler (HandleScrollBar);
                        vscrollbar.Width = SystemInformation.VerticalScrollBarWidth;
-                       vscrollbar.manual_thumb_size = true;
+                       vscrollbar.use_manual_thumb_size = true;
 #if NET_2_0
                        vscrollbar.Scroll += new ScrollEventHandler (HandleScrollEvent);
 #endif
@@ -1131,9 +1129,7 @@ namespace System.Windows.Forms {
                        scroll_position.X += XOffset;
                        scroll_position.Y += YOffset;
 
-                       // Should we call XplatUI.ScrollWindow??? If so, we need to position our windows by other means above
-                       // Since we're already causing a redraw above
-                       Invalidate(false);
+                       XplatUI.ScrollWindow (Handle, ClientRectangle, -XOffset, -YOffset, false);
                        ResumeLayout(false);
                }
                #endregion      // Internal & Private Methods