Esempio n. 1
0
        /// <summary>
        /// Renders the canvas. Call in your rendering loop.
        /// </summary>
        public void RenderCanvas()
        {
            DoThink();

            RendererBase render = Skin.Renderer;

            render.Begin();

            RecurseLayout(Skin);

            render.ClipRegion   = Bounds;
            render.RenderOffset = Point.Empty;
            render.Scale        = Scale;

            if (ShouldDrawBackground)
            {
                render.DrawColor = m_BackgroundColor;
                render.DrawFilledRect(RenderBounds);
            }

            DoRender(Skin);

            DragAndDrop.RenderOverlay(this, Skin);

            Gwen.ToolTip.RenderToolTip(Skin);

            render.EndClip();

            render.End();
        }
Esempio n. 2
0
        /// <summary>
        /// Renders over the actual control (overlays).
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void RenderOver(SkinBase skin)
        {
            if (!m_DrawHover)
            {
                return;
            }

            RendererBase render = skin.Renderer;

            render.DrawColor = Color.FromArgb(20, 255, 200, 255);
            render.DrawFilledRect(RenderBounds);

            if (m_HoverRect.Width == 0)
            {
                return;
            }

            render.DrawColor = Color.FromArgb(100, 255, 200, 255);
            render.DrawFilledRect(m_HoverRect);

            render.DrawColor = Color.FromArgb(200, 255, 200, 255);
            render.DrawLinedRect(m_HoverRect);
        }
Esempio n. 3
0
        public virtual void DrawPropertyRow(ControlBase control, int iWidth, bool bBeingEdited, bool hovered)
        {
            Rectangle rect = control.RenderBounds;

            if (bBeingEdited)
            {
                m_Renderer.DrawColor = Colors.Properties.Column_Selected;
            }
            else if (hovered)
            {
                m_Renderer.DrawColor = Colors.Properties.Column_Hover;
            }
            else
            {
                m_Renderer.DrawColor = Colors.Properties.Column_Normal;
            }

            m_Renderer.DrawFilledRect(new Rectangle(0, rect.Y, iWidth, rect.Height));

            if (bBeingEdited)
            {
                m_Renderer.DrawColor = Colors.Properties.Line_Selected;
            }
            else if (hovered)
            {
                m_Renderer.DrawColor = Colors.Properties.Line_Hover;
            }
            else
            {
                m_Renderer.DrawColor = Colors.Properties.Line_Normal;
            }

            m_Renderer.DrawFilledRect(new Rectangle(iWidth, rect.Y, 1, rect.Height));

            rect.Y     += rect.Height - 1;
            rect.Height = 1;

            m_Renderer.DrawFilledRect(rect);
        }