* ThemeWin32Classic.cs: Only draw the text of a StatusBar if
authorRolf Bjarne Kvinge <RKvinge@novell.com>
Fri, 26 Jan 2007 11:31:12 +0000 (11:31 -0000)
committerRolf Bjarne Kvinge <RKvinge@novell.com>
Fri, 26 Jan 2007 11:31:12 +0000 (11:31 -0000)
ShowPanels is false (fixes #80600). Only draw up to 127 characters
of text (fixes #80601). For panels clip the text to draw to the
panel (fixes #80603).
2007-01-26  Rolf Bjarne Kvinge  <RKvinge@novell.com>

svn path=/trunk/mcs/; revision=71743

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index 886b353a0d01740ad2a969314bc43927e920c24e..bad304036600564272a41d989d87108d870ad282 100644 (file)
@@ -1,3 +1,10 @@
+2007-01-26  Rolf Bjarne Kvinge  <RKvinge@novell.com>
+       
+       * ThemeWin32Classic.cs: Only draw the text of a StatusBar if
+       ShowPanels is false (fixes #80600). Only draw up to 127 characters
+       of text (fixes #80601). For panels clip the text to draw to the
+       panel (fixes #80603).
+
 2007-01-26  Rolf Bjarne Kvinge  <RKvinge@novell.com>
 
        * ComboBox.cs: Fixed implementation of ResetText.
index 583b65f51e51cc01622b5eed8d540a11bd1439ed..6856534c3cc37efe5de51886fe1115b0475e3e7f 100644 (file)
@@ -3599,11 +3599,14 @@ namespace System.Windows.Forms
                        Brush brush = is_color_control ? SystemBrushes.Control : ResPool.GetSolidBrush (sb.BackColor);
                        dc.FillRectangle (brush, clip);
                        
-                       if (sb.Panels.Count == 0 && sb.Text != String.Empty) {
+                       if (!sb.ShowPanels && sb.Text != String.Empty) {
                                string text = sb.Text;
                                StringFormat string_format = new StringFormat ();
                                string_format.Trimming = StringTrimming.Character;
                                string_format.FormatFlags = StringFormatFlags.NoWrap;
+                               
+                               if (text.Length > 127)
+                                       text = text.Substring (0, 127);
 
                                if (text [0] == '\t') {
                                        string_format.Alignment = StringAlignment.Center;
@@ -3723,7 +3726,10 @@ namespace System.Windows.Forms
                                break;
                        }
 
+                       RectangleF clip_bounds = dc.ClipBounds;
+                       dc.SetClip (area);
                        dc.DrawString (text, panel.Parent.Font, br_forecolor, string_rect, string_format);                      
+                       dc.SetClip (clip_bounds);
 
                        if (panel.Icon != null) {
                                dc.DrawIcon (panel.Icon, new Rectangle (icon_x, y, icon_width, icon_width));