Exemplo n.º 1
0
        internal override void OnMenuChanged(EventArgs e)
        {
            base.OnMenuChanged(EventArgs.Empty);
            if (form == null)
            {
                return;
            }

            Rectangle clip = Rect;

            Height = 0;             /* need this so the theme code will re-layout the menu items
                                     * (why is the theme code doing the layout?  argh) */

            if (!Wnd.IsHandleCreated)
            {
                return;
            }

            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(clip);

            Draw(pevent, clip);
        }
Exemplo n.º 2
0
        internal void Draw()
        {
            Message        m  = Message.Create(Wnd.window.Handle, (int)Msg.WM_PAINT, IntPtr.Zero, IntPtr.Zero);
            PaintEventArgs pe = XplatUI.PaintEventStart(ref m, Wnd.window.Handle, false);

            Draw(pe, Rect);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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);
        }
Exemplo n.º 6
0
        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);
        }