Author: jordi
Date: 2005-04-07 05:36:31 -0400 (Thu, 07 Apr 2005)
New Revision: 42626

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LinkLabel.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2005-04-07  Jordi Mas i Hernandez <[EMAIL PROTECTED]>

        * LinkLabel.cs: move drawing code into the theme
        * ThemeWin32Classic.cs: drawing code and painting background bugfix
        * Theme.cs: define DrawLinkLabel method                                 
                                        



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-07 07:57:15 UTC (rev 42625)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-07 09:36:31 UTC (rev 42626)
@@ -1,3 +1,9 @@
+2005-04-07  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+       * LinkLabel.cs: move drawing code into the theme
+       * ThemeWin32Classic.cs: drawing code and painting background bugfix
+       * Theme.cs: define DrawLinkLabel method                                 
                                        
+
 2005-04-05  Jackson Harper  <[EMAIL PROTECTED]>
 
        * BindingContext.cs: Use weak references so these bad actors don't

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LinkLabel.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LinkLabel.cs     
2005-04-07 07:57:15 UTC (rev 42625)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/LinkLabel.cs     
2005-04-07 09:36:31 UTC (rev 42626)
@@ -70,11 +70,11 @@
                private LinkArea link_area;
                private LinkBehavior link_behavior;
                private LinkCollection link_collection;
-               private bool link_visited;
-               private Font link_font;
+               private bool link_visited;              
                private bool link_click;
-               private Piece[] pieces;
-               private int num_pieces;
+               internal Piece[] pieces;
+               internal int num_pieces;
+               internal Font link_font;
                private Cursor override_cursor;
                private DialogResult dialog_result;
 
@@ -497,7 +497,7 @@
                        }
                }
 
-               private Color GetLinkColor (Piece piece, int i)
+               internal Color GetLinkColor (Piece piece, int i)
                {
                        Color color;
 
@@ -519,31 +519,7 @@
 
                internal new void Draw ()
                {
-                       Color color;
-
-                       //dc.FillRectangle (label_br_back_color, area);
-                       ThemeEngine.Current.CPDrawBorderStyle (DeviceContext, 
ClientRectangle, BorderStyle);
-
-                       if (Links.Count == 1 && Links[0].Start == 0 &&  
Links[0].Length == -1) {
-
-                               color = GetLinkColor (pieces[0], 0);
-                               DeviceContext.DrawString (Text, Font, 
ThemeEngine.Current.ResPool.GetSolidBrush (color),
-                                       ClientRectangle, string_format);
-                               return;
-                       }
-
-                       for (int i = 0; i < num_pieces; i++)    {
-
-                               color = GetLinkColor (pieces[i], i);
-
-                               if (pieces[i].link == null)
-                                       DeviceContext.DrawString 
(pieces[i].text, Font, ThemeEngine.Current.ResPool.GetSolidBrush (Color.Black),
-                                               pieces[i].rect.X, 
pieces[i].rect.Y, string_format);
-                               else
-                                       DeviceContext.DrawString 
(pieces[i].text, link_font, ThemeEngine.Current.ResPool.GetSolidBrush (color),
-                                               pieces[i].rect.X, 
pieces[i].rect.Y, string_format);
-                       }
-
+                       ThemeEngine.Current.DrawLinkLabel (DeviceContext, 
ClientRectangle, this);
                        DrawImage (DeviceContext, Image, ClientRectangle, 
image_align);
                }
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs 
2005-04-07 07:57:15 UTC (rev 42625)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs 
2005-04-07 09:36:31 UTC (rev 42626)
@@ -457,6 +457,7 @@
                #endregion      // Label
 
                #region LinkLabel
+               public abstract void DrawLinkLabel (Graphics dc, Rectangle 
clip_rectangle, LinkLabel label);
                #endregion      // LinkLabel
                
                #region ListBox

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-04-07 07:57:15 UTC (rev 42625)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-04-07 09:36:31 UTC (rev 42626)
@@ -977,7 +977,7 @@
                {               
                        dc.FillRectangle (ResPool.GetSolidBrush 
(label.BackColor), clip_rectangle);
                        
-                       CPDrawBorderStyle (dc, clip_rectangle, 
label.BorderStyle);              
+                       CPDrawBorderStyle (dc, label.ClientRectangle, 
label.BorderStyle);               
 
                        if (label.Enabled) {
                                dc.DrawString (label.Text, label.Font, 
ResPool.GetSolidBrush (label.ForeColor), clip_rectangle, label.string_format);
@@ -992,8 +992,38 @@
                                return new Size (100, 23);
                        }
                }
-               #endregion      // Label
-               
+               #endregion      // Label
+
+               #region LinkLabel
+               public  override void DrawLinkLabel (Graphics dc, Rectangle 
clip_rectangle, LinkLabel label)
+               {
+                       Color color;
+
+                       dc.FillRectangle (ResPool.GetSolidBrush 
(label.BackColor), clip_rectangle);
+                       CPDrawBorderStyle (dc, label.ClientRectangle, 
label.BorderStyle);
+
+                       if (label.Links.Count == 1 && label.Links[0].Start == 0 
&& label.Links[0].Length == -1) {
+
+                               color = label.GetLinkColor (label.pieces[0], 0);
+                               dc.DrawString (label.Text, label.Font, 
ResPool.GetSolidBrush (color),
+                                       label.ClientRectangle, 
label.string_format);
+                               return;
+                       }
+
+                       for (int i = 0; i < label.num_pieces; i++) {
+
+                               color = label.GetLinkColor (label.pieces[i], i);
+
+                               if (label.pieces[i].link == null)
+                                       dc.DrawString (label.pieces[i].text, 
label.Font, ResPool.GetSolidBrush (Color.Black),
+                                               label.pieces[i].rect.X, 
label.pieces[i].rect.Y, label.string_format);
+                               else
+                                       dc.DrawString (label.pieces[i].text, 
label.link_font, ResPool.GetSolidBrush (color),
+                                               label.pieces[i].rect.X, 
label.pieces[i].rect.Y, label.string_format);
+                       }                       
+
+               }
+               #endregion      // LinkLabel
                #region ListBox
                
                // Drawing              

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

Reply via email to