protected virtual bool HandleNCPaint(ref Message m) { PaintEventArgs pe = XplatUI.PaintEventStart(ref m, form.Handle, false); Rectangle clip; if (form.ActiveMenu != null) { Point pnt; pnt = GetMenuOrigin(); // The entire menu has to be in the clip rectangle because the // control buttons are right-aligned and otherwise they would // stay painted when the window gets resized. clip = new Rectangle(pnt.X, pnt.Y, form.ClientSize.Width, 0); clip = Rectangle.Union(clip, pe.ClipRectangle); pe.SetClip(clip); pe.Graphics.SetClip(clip); form.ActiveMenu.Draw(pe, new Rectangle(pnt.X, pnt.Y, form.ClientSize.Width, 0)); } if (HasBorders || IsMinimized && !(Form.IsMdiChild && IsMaximized)) { // clip region is not correct on win32. // use the entire form's area. clip = new Rectangle(0, 0, form.Width, form.Height); ThemeEngine.Current.DrawManagedWindowDecorations(pe.Graphics, clip, this); } XplatUI.PaintEventEnd(ref m, form.Handle, false); return(true); }
internal void Draw(Rectangle rect) { if (Wnd.IsHandleCreated) { Point pt = XplatUI.GetMenuOrigin(Wnd.window.Handle); Message m = Message.Create(Wnd.window.Handle, (int)Msg.WM_PAINT, IntPtr.Zero, IntPtr.Zero); PaintEventArgs pevent = XplatUI.PaintEventStart(ref m, Wnd.window.Handle, false); pevent.Graphics.SetClip(new Rectangle(rect.X + pt.X, rect.Y + pt.Y, rect.Width, rect.Height)); Draw(pevent, Rect); XplatUI.PaintEventEnd(ref m, Wnd.window.Handle, false); } }
protected virtual bool HandleNCPaint(ref Message m) { PaintEventArgs pe = XplatUI.PaintEventStart(ref m, form.Handle, false); Rectangle clip; if (HasBorders || IsMinimized && !(Form.IsMdiChild && IsMaximized)) { // clip region is not correct on win32. // use the entire form's area. clip = new Rectangle(0, 0, form.Width, form.Height); ThemeEngine.Current.DrawManagedWindowDecorations(pe.Graphics, clip, this); } XplatUI.PaintEventEnd(ref m, form.Handle, false, pe); return(true); }
protected override void WndProc(ref Message m) { switch ((Msg)m.Msg) { case Msg.WM_NCPAINT: PaintEventArgs pe = XplatUI.PaintEventStart(ref m, Handle, false); Rectangle clip; clip = new Rectangle(0, 0, Width, Height); ControlPaint.DrawBorder3D(pe.Graphics, clip, Border3DStyle.Sunken); XplatUI.PaintEventEnd(ref m, Handle, false, pe); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); }