Author: jackson
Date: 2006-11-13 16:47:35 -0500 (Mon, 13 Nov 2006)
New Revision: 67798

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:

        * TextBoxBase.cs: Compute the value changes for the mouse wheel
        teh simple way.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-13 21:44:21 UTC (rev 67797)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-13 21:47:35 UTC (rev 67798)
@@ -1,3 +1,8 @@
+2006-11-13  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TextBoxBase.cs: Compute the value changes for the mouse wheel
+       teh simple way.
+
 2006-11-13  Chris Toshok  <[EMAIL PROTECTED]>
 
        * XplatUIX11.cs, XplatUIStructs.cs: kind of a gross fix for

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-11-13 21:44:21 UTC (rev 67797)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-11-13 21:47:35 UTC (rev 67798)
@@ -1555,24 +1555,10 @@
                                return;
                        }
 
-                       if (e.Delta < 0) {
-                               line_no = 
document.GetLineByPixel(document.ViewPortY, false).line_no + 
SystemInformation.MouseWheelScrollLines;
-                               if (line_no > document.Lines) {
-                                       line_no = document.Lines;
-                               }
-                       } else {
-                               line_no = 
document.GetLineByPixel(document.ViewPortY, false).line_no - 
SystemInformation.MouseWheelScrollLines;
-                               if (line_no < 1) {
-                                       line_no = 1;
-                               }
-                       }
-
-                       line = document.GetLine(line_no);
-                       if (line.Y < vscroll.Maximum) {
-                               vscroll.Value = line.Y;
-                       } else {
-                               vscroll.Value = vscroll.Maximum;
-                       }
+                       if (e.Delta < 0)
+                               vscroll.Value = Math.Min (vscroll.Value + 
SystemInformation.MouseWheelScrollLines, vscroll.Maximum - 
document.ViewPortHeight + 1);
+                       else
+                               vscroll.Value = Math.Max (0, vscroll.Value - 
SystemInformation.MouseWheelScrollLines);
                }
 
                internal virtual void SelectWord ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to