Author: jpobst
Date: 2007-10-08 16:44:58 -0400 (Mon, 08 Oct 2007)
New Revision: 87130

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
2007-10-08  Jonathan Pobst  <[EMAIL PROTECTED]>

        * Form.cs: Trim NewLine before setting XPlatUI.SetText, and when setting
        the CreateParams.
        * ThemeWin32Classic.cs: Trim NewLine before drawing MDI children window
        decorations.
        [Fixes bug #330986]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-10-08 20:36:28 UTC (rev 87129)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-10-08 20:44:58 UTC (rev 87130)
@@ -1,5 +1,13 @@
 2007-10-08  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * Form.cs: Trim NewLine before setting XPlatUI.SetText, and when setting
+       the CreateParams.
+       * ThemeWin32Classic.cs: Trim NewLine before drawing MDI children window
+       decorations.
+       [Fixes bug #330986]
+
+2007-10-08  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * TextBoxTextRenderer.cs: Don't make this a static class, as static
        doesn't exist in 1.1.  (Thanks jb!)
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-10-08 20:36:28 UTC (rev 87129)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-10-08 20:44:58 UTC (rev 87130)
@@ -231,7 +231,8 @@
                                   other window style things to 
appear/disappear */
                                XplatUI.SetWindowStyle (window.Handle, 
CreateParams);
                        }
-                       base.UpdateWindowText ();
+                       
+                       XplatUI.Text (Handle, Text.Replace 
(Environment.NewLine, string.Empty));
                }
                
                private void SelectActiveControl ()
@@ -1317,6 +1318,8 @@
                                CreateParams cp = new CreateParams ();
 
                                cp.Caption = Text;
+                               cp.Caption = cp.Caption.Replace 
(Environment.NewLine, string.Empty);
+                               
                                cp.ClassName = XplatUI.DefaultClassName;
                                cp.ClassStyle = 0;
                                cp.Style = 0;

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-10-08 20:36:28 UTC (rev 87129)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2007-10-08 20:44:58 UTC (rev 87130)
@@ -5931,14 +5931,17 @@
                                tb.Width = (form.Width - 62) - tb.X;
                        }
 
-                       if (form.Text != null && form.Text != string.Empty) {
+                       string window_caption = form.Text;
+                       window_caption = window_caption.Replace 
(Environment.NewLine, string.Empty);
+
+                       if (window_caption != null && window_caption != 
string.Empty) {
                                StringFormat format = new StringFormat ();
                                format.FormatFlags = StringFormatFlags.NoWrap;
                                format.Trimming = 
StringTrimming.EllipsisCharacter;
                                format.LineAlignment = StringAlignment.Center;
 
                                if (tb.IntersectsWith (clip))
-                                       dc.DrawString (form.Text, 
WindowBorderFont,
+                                       dc.DrawString (window_caption, 
WindowBorderFont,
                                                
ThemeEngine.Current.ResPool.GetSolidBrush (Color.White),
                                                tb, format);
                        }

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

Reply via email to