Author: jpobst
Date: 2008-01-17 14:12:16 -0500 (Thu, 17 Jan 2008)
New Revision: 93187

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2008-01-17  Jonathan Pobst  <[EMAIL PROTECTED]>

        * ButtonBase.cs: Add LineLimit to 1.1 button drawing, and TextBoxControl
        to 2.0 button drawing.
        * ThemeWin32Classic.cs: Ensure that the rectangle we are using to draw 
        the button text is tall enough for one line.  LineLimit says it will
        always draw at least one line, but it is a lie.
        [Fixes bug #324941]

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs    
2008-01-17 19:09:47 UTC (rev 93186)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs    
2008-01-17 19:12:16 UTC (rev 93187)
@@ -86,9 +86,11 @@
                        text_format.Alignment = StringAlignment.Center;
                        text_format.LineAlignment = StringAlignment.Center;
                        text_format.HotkeyPrefix = HotkeyPrefix.Show;
+                       text_format.FormatFlags |= StringFormatFlags.LineLimit;
 
                        text_format_flags = TextFormatFlags.HorizontalCenter;
                        text_format_flags |= TextFormatFlags.VerticalCenter;
+                       text_format_flags |= TextFormatFlags.TextBoxControl;
 
                        SetStyle (ControlStyles.ResizeRedraw | 
                                ControlStyles.Opaque | 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-17 19:09:47 UTC (rev 93186)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-17 19:12:16 UTC (rev 93187)
@@ -1,3 +1,12 @@
+2008-01-17  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * ButtonBase.cs: Add LineLimit to 1.1 button drawing, and TextBoxControl
+       to 2.0 button drawing.
+       * ThemeWin32Classic.cs: Ensure that the rectangle we are using to draw 
+       the button text is tall enough for one line.  LineLimit says it will
+       always draw at least one line, but it is a lie.
+       [Fixes bug #324941]
+
 2008-01-17  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * XplatUIStructs.cs, X11Keyboard.cs :

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2008-01-17 19:09:47 UTC (rev 93186)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2008-01-17 19:12:16 UTC (rev 93187)
@@ -197,6 +197,10 @@
 
                public virtual void DrawButtonText (Graphics g, Button button, 
Rectangle textBounds)
                {
+                       // Ensure that at least one line is going to get 
displayed.
+                       // Line limit does not ensure that despite its 
description.
+                       textBounds.Height = Math.Max (textBounds.Height, 
button.Font.Height);
+                       
                        if (button.Enabled)
                                TextRenderer.DrawTextInternal (g, button.Text, 
button.Font, textBounds, button.ForeColor, button.TextFormatFlags, 
button.UseCompatibleTextRendering);
                        else
@@ -856,6 +860,10 @@
                                text_rect.Y++;
                        }
                        
+                       // Ensure that at least one line is going to get 
displayed.
+                       // Line limit does not ensure that despite its 
description.
+                       text_rect.Height = Math.Max (button.Font.Height, 
text_rect.Height);
+                       
                        if (button.Enabled) {                                   
                                dc.DrawString(button.Text, button.Font, 
ResPool.GetSolidBrush (button.ForeColor), text_rect, button.text_format);
                        } else {

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

Reply via email to