Author: toshok
Date: 2006-10-06 13:27:04 -0400 (Fri, 06 Oct 2006)
New Revision: 66366

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
Log:
2006-10-06  Chris Toshok  <[EMAIL PROTECTED]>

        * Splitter.cs: doh, fix splitters that don't want to cancel the
        movement when you drag them.  Also, impose the limits on the
        values we send to the SplitterMovingEvent.  Fixes #79598.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-10-06 17:14:29 UTC (rev 66365)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-10-06 17:27:04 UTC (rev 66366)
@@ -1,3 +1,9 @@
+2006-10-06  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * Splitter.cs: doh, fix splitters that don't want to cancel the
+       movement when you drag them.  Also, impose the limits on the
+       values we send to the SplitterMovingEvent.  Fixes #79598.
+
 2006-10-06  Jackson Harper  <[EMAIL PROTECTED]>
 
        * TextBoxBase.cs: Ignore whether or not the scrollbar is enabled,

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs      
2006-10-06 17:14:29 UTC (rev 66365)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs      
2006-10-06 17:27:04 UTC (rev 66366)
@@ -458,26 +458,23 @@
                        // Grab our new coordinates
                        prev_split_position = split_position;
 
-                       // Prepare the event
-                       if (horizontal) {
-                               sevent.split_x = 0;
-                               sevent.split_y = split_position;
-                       } else {
-                               sevent.split_x = split_position;
-                               sevent.split_y = 0;
-                       }
+                       int candidate = horizontal ? pt.Y : pt.X;
 
+                       // Enforce limit on what we send to the event
+                       if (candidate < limit_min)
+                               candidate = limit_min;
+                       else if (candidate > limit_max)
+                               candidate = limit_max;
+
                        sevent.x = pt.X;
                        sevent.y = pt.Y;
+                       sevent.split_x = horizontal ? 0 : candidate;
+                       sevent.split_y = horizontal ? candidate : 0;
 
                        // Fire the event
                        OnSplitterMoving(sevent);
 
-                       if (horizontal) {
-                               split_position = sevent.split_y;
-                       } else {
-                               split_position = sevent.split_x;
-                       }
+                       split_position = horizontal ? sevent.split_y : 
sevent.split_x;
 
                        // Enforce limits
                        if (split_position < limit_min) {

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

Reply via email to