Author: everaldo
Date: 2007-02-23 06:15:22 -0500 (Fri, 23 Feb 2007)
New Revision: 73358

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
        * ThemeWin32Classic.cs: Invert order of drawing operation with DrawImage
        after DrawButton. To prevent image overlaps button borders SetClip and 
        ResetClip added before and after draw image. Fixes #79129.

2007-02-23  Everaldo Canuto  <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-23 08:52:48 UTC (rev 73357)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-23 11:15:22 UTC (rev 73358)
@@ -1,5 +1,11 @@
 2007-02-23  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * ThemeWin32Classic.cs: Invert order of drawing operation with DrawImage
+       after DrawButton. To prevent image overlaps button borders SetClip and 
+       ResetClip added before and after draw image. Fixes #79129.
+
+2007-02-23  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * FolderBrowserDialog.cs: Use ClientSize instead of Size to specify 
        window size, it fix problem when you run under win32 that theres
        Size diferent than ClientSize. Also fix controls size and positions

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-02-23 08:52:48 UTC (rev 73357)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-02-23 11:15:22 UTC (rev 73358)
@@ -143,13 +143,13 @@
                #region ButtonBase
                public override void DrawButtonBase(Graphics dc, Rectangle 
clip_area, ButtonBase button)
                {
-                       // First, draw the image
+                       // Draw the button: Draw border, etc.
+                       ButtonBase_DrawButton(button, dc);
+
+                       // Draw the image
                        if (button.FlatStyle != FlatStyle.System && 
((button.image != null) || (button.image_list != null)))
                                ButtonBase_DrawImage(button, dc);
                        
-                       // Draw the button: Draw border, etc.
-                       ButtonBase_DrawButton(button, dc);
-                       
                        // Draw the focus rectangle
                        if ((button.Focused || button.paint_as_acceptbutton) && 
button.Enabled)
                                ButtonBase_DrawFocus(button, dc);
@@ -342,12 +342,14 @@
                                }
                        }
                        
-                       if (button.Enabled) {
-                               dc.DrawImage(i, image_x, image_y, image_width, 
image_height); 
-                       }
-                       else {
-                               CPDrawImageDisabled(dc, i, image_x, image_y, 
ColorControl);
-                       }
+                       dc.SetClip (new Rectangle(3, 3, width - 5, height - 5));
+
+                       if (button.Enabled)
+                               dc.DrawImage (i, image_x, image_y, image_width, 
image_height);
+                       else
+                               CPDrawImageDisabled (dc, i, image_x, image_y, 
ColorControl);
+
+                       dc.ResetClip ();
                }
                
                protected virtual void ButtonBase_DrawFocus(ButtonBase button, 
Graphics dc)

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

Reply via email to