Пример #1
0
        /// <summary>
        /// Redrawing the whole screen.
        /// </summary>
        public void Redraw()
        {
            // Scale if needed.
            if (scaleX != 1f || scaleY != 1f)
            {
                UnityEngine.GUI.matrix = UnityEngine.Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(0, Vector3.up), new Vector3(scaleX, scaleY, 1));
            }

            paintEventArgs.Graphics.Clear(System.Drawing.Color.White);

            for (int i = 0; i < Forms.Count; i++)
            {
                var form = Forms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(paintEventArgs);
                }
            }

            for (int i = 0; i < ModalForms.Count; i++)
            {
                var form = ModalForms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(paintEventArgs);
                }
            }

            for (int i = 0; i < Contexts.Count; i++)
            {
                var context = Contexts[i];
                if (context.Visible)
                {
                    context.RaiseOnPaint(paintEventArgs);
                }
            }

            if (dragRender != null && dragndrop)
            {
                var g = new Graphics();
                var dragRenderControl = new Control();
                dragRender.Invoke(g);
                dragRenderControl.Dispose();
            }

            // ToolTip.
            ToolTip.OnPaint(paintEventArgs);

            var cursor        = Cursor.CurrentSystem ?? Cursor.Current;
            var cursorSize    = cursor.Size;
            var mousePosition = Control.MousePosition;

            cursor.Draw(
                paintEventArgs.Graphics,
                new Drawing.Rectangle(
                    mousePosition.X,
                    mousePosition.Y,
                    (int)(cursorSize.Width / scaleX),
                    (int)(cursorSize.Height / scaleY)));
        }
Пример #2
0
        public void Draw()
        {
            // Scale if needed.
            //UnityEngine.GUI.matrix = UnityEngine.Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(0, Vector3.up), new Vector3(scale_x, scale_y, 1));
            GUI.color = Color.white;

            _paintEventArgs.Graphics.FillRate = 0;

            for (int i = 0; i < Forms.Count; i++)
            {
                if (Forms[i].Visible && Forms[i].TopMost == false)
                {
                    Forms[i].RaiseOnPaint(_paintEventArgs);
                }
            }

            for (int i = 0; i < Forms.Count; i++)
            {
                if (Forms[i].Visible && Forms[i].TopMost)
                {
                    Forms[i].RaiseOnPaint(_paintEventArgs);
                }
            }

            for (int i = 0; i < ModalForms.Count; i++)
            {
                if (ModalForms[i].Visible)
                {
                    ModalForms[i].RaiseOnPaint(_paintEventArgs);
                }
            }

            for (int i = 0; i < Contexts.Count; i++)
            {
                if (Contexts[i].Visible)
                {
                    Contexts[i].RaiseOnPaint(_paintEventArgs);
                }
            }

            FillRate = _paintEventArgs.Graphics.FillRate;

            if (_dragRender != null && _dragndrop)
            {
                System.Drawing.Graphics g  = new System.Drawing.Graphics();
                Control _dragRenderControl = new Control();
                g.Control = _dragRenderControl;
                _dragRender.Invoke(g);
                _dragRenderControl.Dispose();
            }

            // ToolTip.
            ToolTip.OnPaint(_paintEventArgs);
        }
Пример #3
0
        /// <summary>
        /// Redrawing the whole screen.
        /// </summary>
        public void Redraw()
        {
            paintEventArgs.Graphics.Clear(System.Drawing.Color.White);

            for (int i = 0; i < Forms.Count; i++)
            {
                var form = Forms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(paintEventArgs);
                }
            }

            for (int i = 0; i < ModalForms.Count; i++)
            {
                var form = ModalForms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(paintEventArgs);
                }
            }

            for (int i = 0; i < Contexts.Count; i++)
            {
                var context = Contexts[i];
                if (context.Visible)
                {
                    context.RaiseOnPaint(paintEventArgs);
                }
            }

            if (dragRender != null && dragndrop)
            {
                var g = new Graphics();
                var dragRenderControl = new Control();
                dragRender.Invoke(g);
                dragRenderControl.Dispose();
            }

            // ToolTip.
            ToolTip.OnPaint(paintEventArgs);

            var cursor        = Cursor.CurrentSystem ?? Cursor.Current;
            var cursorSize    = cursor.Size;
            var mousePosition = Control.MousePosition;

            cursor.Draw(
                paintEventArgs.Graphics,
                new Drawing.Rectangle(
                    mousePosition.X,
                    mousePosition.Y,
                    (int)(cursorSize.Width / scaleX),
                    (int)(cursorSize.Height / scaleY)));
        }
Пример #4
0
        public void Draw()
        {
            // Scale if needed.
            if (ScaleX != 1f || ScaleY != 1f)
            {
                UnityEngine.GUI.matrix = UnityEngine.Matrix4x4.TRS(Vector3.zero, Quaternion.AngleAxis(0, Vector3.up), new Vector3(ScaleX, ScaleY, 1));
            }

            GUI.color = Color.white;

            _paintEventArgs.Graphics.FillRate = 0;

            for (int i = 0; i < Forms.Count; i++)
            {
                var form = Forms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(_paintEventArgs);
                }
            }

            for (int i = 0; i < ModalForms.Count; i++)
            {
                var form = ModalForms[i];
                if (form.Visible)
                {
                    form.RaiseOnPaint(_paintEventArgs);
                }
            }

            for (int i = 0; i < Contexts.Count; i++)
            {
                var context = Contexts[i];
                if (context.Visible)
                {
                    context.RaiseOnPaint(_paintEventArgs);
                }
            }

            FillRate = _paintEventArgs.Graphics.FillRate;

            if (_dragRender != null && _dragndrop)
            {
                var g = new System.Drawing.Graphics();
                var _dragRenderControl = new Control();
                g.Control = _dragRenderControl;
                _dragRender.Invoke(g);
                _dragRenderControl.Dispose();
            }

            // ToolTip.
            ToolTip.OnPaint(_paintEventArgs);

            var cursor = Cursor.CurrentSystem ?? Cursor.Current;

            cursor.Draw(_paintEventArgs.Graphics,
                        new Drawing.Rectangle(
                            Control.MousePosition.X,
                            Control.MousePosition.Y,
                            (int)(cursor.Size.Width / ScaleX),
                            (int)(cursor.Size.Height / ScaleY)));
        }