Author: jackson
Date: 2006-09-05 11:14:12 -0400 (Tue, 05 Sep 2006)
New Revision: 64946

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

        * TabControl.cs: Better calculation method for setting the
        * slider
        pos. Prevents crashes on really wide tabs.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-05 15:11:56 UTC (rev 64945)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-05 15:14:12 UTC (rev 64946)
@@ -1,3 +1,8 @@
+2006-09-05  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TabControl.cs: Better calculation method for setting the slider
+       pos. Prevents crashes on really wide tabs.
+
 2006-09-02  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
        * MonthCalendar.cs: When Font changes, the Size should be

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs    
2006-09-05 15:11:56 UTC (rev 64945)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs    
2006-09-05 15:14:12 UTC (rev 64946)
@@ -229,11 +229,13 @@
                                        int re = 
ThemeEngine.Current.GetTabControlLeftScrollRect (this).Left;
                                        if (show_slider && le > re) {
                                                int diff = le - re;
-                                               int ind = value - 1;
-                                               while (ind > 0 && diff > 0) {
-                                                       diff -= TabPages 
[ind++].Width;
+                                               int i = 0;
+
+                                               for (i = value; i < 
TabPages.Count; i++) {
+                                                       if (TabPages 
[i].TabBounds.Right > re)
+                                                               break;
                                                }
-                                               slider_pos = ind - 1;
+                                               slider_pos = i;
                                                refresh = true;
                                        }
                                }

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

Reply via email to