Author: jackson
Date: 2006-09-05 13:27:45 -0400 (Tue, 05 Sep 2006)
New Revision: 64953

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

        - Draw Image on tab pages if an image list is used.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-05 17:22:00 UTC (rev 64952)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-09-05 17:27:45 UTC (rev 64953)
@@ -2,6 +2,7 @@
 
        * TabControl.cs: Better calculation method for setting the slider
        pos. Prevents crashes on really wide tabs.
+       - Draw Image on tab pages if an image list is used.
 
 2006-09-02  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 

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 17:22:00 UTC (rev 64952)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs    
2006-09-05 17:27:45 UTC (rev 64953)
@@ -692,6 +692,10 @@
                                        width = item_size.Width;
                                } else {
                                        width = (int) 
DeviceContext.MeasureString (page.Text, Font).Width + (Padding.X * 2);
+                                       if (ImageList != null && 
page.ImageIndex >= 0 && page.ImageIndex < ImageList.Images.Count) {
+                                               width += 
ImageList.ImageSize.Width + 2;
+                                               item_size.Height = 
ImageList.ImageSize.Height + 3;
+                                       }
                                }
 
                                if (i == SelectedIndex)
@@ -810,6 +814,10 @@
                                        width = item_size.Width;
                                } else {
                                        width = (int) 
DeviceContext.MeasureString (page.Text, Font).Width + (Padding.X * 2);
+                                       if (ImageList != null && 
page.ImageIndex >= 0 && page.ImageIndex < ImageList.Images.Count) {
+                                               width += 
ImageList.ImageSize.Width + 2;
+                                               item_size.Height = 
ImageList.ImageSize.Height + 3;
+                                       }
                                }
 
                                if (width < MinimumTabWidth)
@@ -867,6 +875,10 @@
                                        width = item_size.Width;
                                } else {                                        
                                        width = (int) 
DeviceContext.MeasureString (page.Text, Font).Width + (Padding.X * 2);
+                                       if (ImageList != null && 
page.ImageIndex >= 0 && page.ImageIndex < ImageList.Images.Count) {
+                                               width += 
ImageList.ImageSize.Width + 2;
+                                               item_size.Height = 
ImageList.ImageSize.Height + 3;
+                                       }
                                }
 
                                if (width < MinimumTabWidth)

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

Reply via email to