public override void DrawMaximizedButtons(object sender, PaintEventArgs pe) { Size_ bs = ThemeEngine.Current.ManagedWindowGetMenuButtonSize(this); Point_ pnt = XplatUI.GetMenuOrigin(mdi_container.ParentForm.Handle); int bw = ThemeEngine.Current.ManagedWindowBorderWidth(this); TitleButtons buttons = MaximizedTitleButtons; buttons.Visible = true; TitleButtons.Visible = false; buttons.CloseButton.Rectangle = new Rectangle_(mdi_container.ParentForm.Size.Width - 1 - bw - bs.Width - 2, pnt.Y + 2, bs.Width, bs.Height); buttons.RestoreButton.Rectangle = new Rectangle_(buttons.CloseButton.Rectangle.Left - 2 - bs.Width, pnt.Y + 2, bs.Width, bs.Height); buttons.MinimizeButton.Rectangle = new Rectangle_(buttons.RestoreButton.Rectangle.Left - bs.Width, pnt.Y + 2, bs.Width, bs.Height); DrawTitleButton(pe.Graphics, buttons.MinimizeButton, pe.ClipRectangle); DrawTitleButton(pe.Graphics, buttons.RestoreButton, pe.ClipRectangle); DrawTitleButton(pe.Graphics, buttons.CloseButton, pe.ClipRectangle); buttons.MinimizeButton.Rectangle.Y -= pnt.Y; buttons.RestoreButton.Rectangle.Y -= pnt.Y; buttons.CloseButton.Rectangle.Y -= pnt.Y; }
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); } }