Author: everaldo
Date: 2007-02-28 07:36:13 -0500 (Wed, 28 Feb 2007)
New Revision: 73536

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2007-02-27  Everaldo Canuto  <[EMAIL PROTECTED]>

        * ThemeWin32Classic.cs: In DrawLinkLabel draw focus rectangle before 
draw
        text and some other changes to reduce and optimize source code.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-28 12:11:57 UTC (rev 73535)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-28 12:36:13 UTC (rev 73536)
@@ -1,3 +1,8 @@
+2007-02-27  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * ThemeWin32Classic.cs: In DrawLinkLabel draw focus rectangle before 
draw
+       text and some other changes to reduce and optimize source code.
+
 2007-02-27  Jonathan Pobst  <[EMAIL PROTECTED]>
 
        * RadioButton.cs: Implement 2.0 event.

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-28 12:11:57 UTC (rev 73535)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-02-28 12:36:13 UTC (rev 73536)
@@ -1669,7 +1669,7 @@
                #endregion      // Label
 
                #region LinkLabel
-               public  override void DrawLinkLabel (Graphics dc, Rectangle 
clip_rectangle, LinkLabel label)
+               public override void DrawLinkLabel (Graphics dc, Rectangle 
clip_rectangle, LinkLabel label)
                {
                        dc.FillRectangle (GetControlBackBrush 
(label.BackColor), clip_rectangle);
 
@@ -1677,22 +1677,19 @@
                                return;
 
                        for (int i = 0; i < label.pieces.Length; i ++) {
-                               RectangleF clipf = new RectangleF 
(clip_rectangle.X, clip_rectangle.Y,
-                                                                  
clip_rectangle.Width, clip_rectangle.Height);
-                               RectangleF rectf = 
label.pieces[i].region.GetBounds (dc);
+                               
+                               Rectangle rect = Rectangle.Round 
(label.pieces[i].region.GetBounds (dc));
 
-                               if (!clipf.IntersectsWith (rectf))
+                               if (!clip_rectangle.IntersectsWith (rect))
                                        continue;
 
-                               dc.DrawString (label.pieces[i].text, 
label.GetPieceFont (label.pieces[i]), ResPool.GetSolidBrush 
(label.GetPieceColor (label.pieces[i], i)),
-                                              rectf, label.string_format);
-
                                LinkLabel.Link link = label.pieces[i].link;
-                               if (link != null && link.Focused) {
-                                       Rectangle rect = new Rectangle 
((int)rectf.X, (int)rectf.Y,
-                                                                       
(int)rectf.Width, (int)rectf.Height);
+                               if (link != null && link.Focused)
                                        CPDrawFocusRectangle (dc, rect, 
label.ForeColor, label.BackColor);
-                               }
+
+                               dc.DrawString (label.pieces[i].text, 
label.GetPieceFont (label.pieces[i]), ResPool.GetSolidBrush 
(label.GetPieceColor (label.pieces[i], i)),
+                                              rect, label.string_format);
+
                        }
                }
                #endregion      // LinkLabel

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

Reply via email to