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

            Renderer.RendererBase render = Skin.Renderer;

            render.Scale = Scale;
            render.Begin();

            Layout(false);

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

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

            DoRender(Skin);
            DragAndDrop.RenderOverlay(this, Skin);

            if (m_ToolTip.IsVisible)
            {
                m_ToolTip.DoRender(Skin);
            }
            render.EndClip();

            render.End();
        }
Beispiel #2
0
        /// <summary>
        /// Renders the canvas. Call in your rendering loop.
        /// </summary>
        public void RenderCanvas()
        {
            DoThink();

            Skin.SkinBase         skin   = Skin;
            Renderer.RendererBase render = skin.Renderer;

            render.Begin();

            render.ClipRegion   = Bounds;
            render.RenderOffset = Point.Zero;

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

            DoRender(skin);

            DragAndDrop.RenderOverlay(this, skin);

            Gwen.Net.ToolTip.RenderToolTip(skin);

            render.EndClip();

            render.End();
        }
Beispiel #3
0
        /// <summary>
        /// Renders the canvas. Call in your rendering loop.
        /// </summary>
        public void RenderCanvas()
        {
            doThink();

            Renderer.RendererBase render = Skin.Renderer;

            render.Begin();

            recurseLayout(Skin);

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

            if (ShouldDrawBackground)
            {
                render.DrawColor = backgroundColor;
                render.DrawFilledRect(Bounds);
            }

            DoRender(Skin);

            DragAndDrop.RenderOverlay(this, Skin);

            Gwen.ToolTip.RenderToolTip(Skin);

            render.EndClip();

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

            Renderer.RendererBase render = skin.Renderer;
            render.DrawColor = new Color(20, 255, 200, 255);
            render.DrawFilledRect(RenderBounds);

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

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

            render.DrawColor = new Color(200, 255, 200, 255);
            render.DrawLinedRect(m_HoverRect);
        }
Beispiel #5
0
        /// <summary>
        /// Renders over the actual control (overlays).
        /// </summary>
        /// <param name="skin">Skin to use.</param>
        protected override void renderOver(Skin.SkinBase skin)
        {
            if (!drawHover)
            {
                return;
            }

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

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

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

            render.DrawColor = Color.FromArgb(200, 255, 200, 255);
            render.DrawLinedRect(hoverRect);
        }
Beispiel #6
0
        public virtual void DrawPropertyRow(Controls.ControlBase control, int iWidth, bool bBeingEdited, bool hovered)
        {
            Rectangle rect    = control.RenderBounds;
            bool      drawbox = true;

            if (bBeingEdited)
            {
                m_Renderer.DrawColor = Colors.Accent;
            }
            // else if (hovered)
            // m_Renderer.DrawColor = Colors.ForegroundInactive;
            else
            {
                drawbox = false;
            }
            if (drawbox)
            {
                m_Renderer.DrawFilledRect(new Rectangle(0, rect.Y, iWidth, rect.Height));
            }

            if (bBeingEdited)
            {
                m_Renderer.DrawColor = Colors.ForegroundInactive;
            }
            else if (hovered)
            {
                m_Renderer.DrawColor = Colors.ForegroundInactive;
            }
            else
            {
                m_Renderer.DrawColor = Colors.ForegroundInactive;
            }

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

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

            m_Renderer.DrawFilledRect(rect);
        }
Beispiel #7
0
        public virtual void DrawPropertyRow(Control.ControlBase control, int iWidth, bool bBeingEdited, bool hovered)
        {
            Rectangle rect = control.RenderBounds;

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

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

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

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

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

            renderer.DrawFilledRect(rect);
        }