// Authors:
// Jonathan Pobst (monkey@jpobst.com)
//
-#if NET_2_0
using System;
using System.Drawing;
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 ()
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) {
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;
// 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;
}
#endregion
}
}
-#endif