Assign values to base class.
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / StatusStrip.cs
index c2fdf24e6c86a21f8587c63d6fe9ef354a7eec13..3d3d8a51d5d887d753a6b41af91291366d27f00f 100644 (file)
@@ -25,7 +25,6 @@
 // Authors:
 //     Jonathan Pobst (monkey@jpobst.com)
 //
-#if NET_2_0
 
 using System;
 using System.Drawing;
@@ -145,17 +144,18 @@ namespace System.Windows.Forms
                        base.Dispose (disposing);
                }
 
-               protected override void OnLayout (LayoutEventArgs e)
+               protected override void OnLayout (LayoutEventArgs levent)
                {
                        this.OnSpringTableLayoutCore ();
+                       this.Invalidate ();
                }
 
-               protected override void OnPaintBackground (PaintEventArgs pevent)
+               protected override void OnPaintBackground (PaintEventArgs e)
                {
-                       base.OnPaintBackground (pevent);
+                       base.OnPaintBackground (e);
                        
                        if (this.sizing_grip)
-                               this.Renderer.DrawStatusStripSizingGrip (new ToolStripRenderEventArgs (pevent.Graphics, this));
+                               this.Renderer.DrawStatusStripSizingGrip (new ToolStripRenderEventArgs (e.Graphics, this, Bounds, SystemColors.Control));
                }
 
                protected virtual void OnSpringTableLayoutCore ()
@@ -245,7 +245,8 @@ namespace System.Windows.Forms
 
                protected override void SetDisplayedItems ()
                {
-                       this.displayed_items.Clear ();
+                       // Only clean the internal collection, without modifying Owner/Parent on items.
+                       this.displayed_items.ClearInternal ();
 
                        foreach (ToolStripItem tsi in this.Items)
                                if (tsi.Placement == ToolStripItemPlacement.Main && tsi.Available) {
@@ -263,7 +264,7 @@ namespace System.Windows.Forms
                                                Point p = new Point (LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()));
                                                
                                                if (this.SizingGrip && this.SizeGripBounds.Contains (p)) {
-                                                       this.Cursor = Cursors.SizeNESW;
+                                                       this.Cursor = Cursors.SizeNWSE;
                                                        return;
                                                } else
                                                        this.Cursor = Cursors.Default;
@@ -275,9 +276,15 @@ namespace System.Windows.Forms
                                // send the WM a message to begin a window resize operation
                                case Msg.WM_LBUTTONDOWN: {
                                        Point p = new Point (LowOrder ((int)m.LParam.ToInt32 ()), HighOrder ((int)m.LParam.ToInt32 ()));
+                                       Form form = FindForm ();
 
                                        if (this.SizingGrip && this.SizeGripBounds.Contains (p)) {
-                                               XplatUI.SendMessage (this.FindForm().Handle, Msg.WM_NCLBUTTONDOWN, (IntPtr) HitTest.HTBOTTOMRIGHT, IntPtr.Zero);
+                                               // For top level forms it's not enoug to send a NCLBUTTONDOWN message, so
+                                               // we make a direct call to our XplatUI engine.
+                                               if (!form.IsMdiChild)
+                                                       XplatUI.BeginMoveResize (form.Handle);
+
+                                               XplatUI.SendMessage (form.Handle, Msg.WM_NCLBUTTONDOWN, (IntPtr) HitTest.HTBOTTOMRIGHT, IntPtr.Zero);
                                                return;
                                        }
                                        
@@ -304,4 +311,3 @@ namespace System.Windows.Forms
                #endregion
        }
 }
-#endif