示例#1
0
        public virtual void Draw(ScrollbarButton Button, IRenderer Renderer)
        {
            ILineStyleInfo TopLeft;
            ILineStyleInfo BottomRight;

            if (Button.State == ScrollbarButton.ButtonState.Normal)
            {
                TopLeft = LightBorder;
                BottomRight = DarkBorder;
            }
            else
            {
                TopLeft = DarkBorder;
                BottomRight = LightBorder;
            }

            Rect R = Button.Bounds;
            int x1 = R.Location.X;
            int y1 = R.Location.Y;
            int x2 = R.Right;
            int y2 = R.Bottom;

            DrawBackground(Button, Renderer);

            Renderer.DrawOperations.DrawLine(x1, y1, x2, y1, TopLeft);
            Renderer.DrawOperations.DrawLine(x1, y1, x1, y2, TopLeft);
            Renderer.DrawOperations.DrawLine(x2, y1, x2, y2, BottomRight);
            Renderer.DrawOperations.DrawLine(x1, y2, x2 + 1, y2, BottomRight);
        }
        protected virtual ScrollbarButton CreateThumb()
        {
            ScrollbarButton NewThumb = new ScrollbarButton();

            NewThumb.MyButtonStyle = MyThumbStyle;
            return(NewThumb);
        }
        public virtual void Draw(ScrollbarButton Button, IRenderer Renderer)
        {
            ILineStyleInfo TopLeft;
            ILineStyleInfo BottomRight;

            if (Button.State == ScrollbarButton.ButtonState.Normal)
            {
                TopLeft     = LightBorder;
                BottomRight = DarkBorder;
            }
            else
            {
                TopLeft     = DarkBorder;
                BottomRight = LightBorder;
            }

            Rect R  = Button.Bounds;
            int  x1 = R.Location.X;
            int  y1 = R.Location.Y;
            int  x2 = R.Right;
            int  y2 = R.Bottom;

            DrawBackground(Button, Renderer);

            Renderer.DrawOperations.DrawLine(x1, y1, x2, y1, TopLeft);
            Renderer.DrawOperations.DrawLine(x1, y1, x1, y2, TopLeft);
            Renderer.DrawOperations.DrawLine(x2, y1, x2, y2, BottomRight);
            Renderer.DrawOperations.DrawLine(x1, y2, x2 + 1, y2, BottomRight);
        }
示例#4
0
        public override void Draw(ScrollbarButton Button, IRenderer Renderer)
        {
            base.Draw(Button, Renderer);

            const int cx = 3;
            const int cy = cx / 2;
            const int d = cx - cy;
            int x1 = Button.Bounds.Location.X + (int)(Button.Bounds.Size.X / 2);
            int y1 = Button.Bounds.Location.Y + (int)(Button.Bounds.Size.Y / 2) + cy;

            if (Button.State == ScrollbarButton.ButtonState.Pushed)
            {
                x1++;
                y1++;
            }

            if (MyType == ArrowType.Up)
            {
                p[0].Set(x1 - cx, y1);
                p[1].Set(x1, y1 - cx);
                p[2].Set(x1 + cx, y1);
            }
            else if (MyType == ArrowType.Left)
            {
                p[0].Set(x1 - d, y1);
                p[1].Set(x1 + cy, y1 - cx);
                p[2].Set(x1 + cy, y1 + cx);
            }
            else if (MyType == ArrowType.Right)
            {
                p[0].Set(x1 - cy, y1 - cx);
                p[1].Set(x1 - cy, y1 + cx);
                p[2].Set(x1 + d, y1);
            }
            else // if (MyType == ArrowType.Down)
            {
                p[0].Set(x1 - cx, y1 - d);
                p[1].Set(x1, y1 + cy);
                p[2].Set(x1 + cx, y1 - d);
            }

            // Renderer.DrawOperations.FillPolygon(p, this.BlackLine, this.BlackFill);
            Renderer.DrawOperations.DrawTriangle(
                p[0].X,
                p[0].Y,
                p[1].X,
                p[1].Y,
                p[2].X,
                p[2].Y,
                System.Drawing.Color.Black,
                System.Drawing.Color.Black);
        }
        public override void Draw(ScrollbarButton Button, IRenderer Renderer)
        {
            base.Draw(Button, Renderer);

            const int cx = 3;
            const int cy = cx / 2;
            const int d  = cx - cy;
            int       x1 = Button.Bounds.Location.X + (int)(Button.Bounds.Size.X / 2);
            int       y1 = Button.Bounds.Location.Y + (int)(Button.Bounds.Size.Y / 2) + cy;

            if (Button.State == ScrollbarButton.ButtonState.Pushed)
            {
                x1++;
                y1++;
            }

            if (MyType == ArrowType.Up)
            {
                p[0].Set(x1 - cx, y1);
                p[1].Set(x1, y1 - cx);
                p[2].Set(x1 + cx, y1);
            }
            else if (MyType == ArrowType.Left)
            {
                p[0].Set(x1 - d, y1);
                p[1].Set(x1 + cy, y1 - cx);
                p[2].Set(x1 + cy, y1 + cx);
            }
            else if (MyType == ArrowType.Right)
            {
                p[0].Set(x1 - cy, y1 - cx);
                p[1].Set(x1 - cy, y1 + cx);
                p[2].Set(x1 + d, y1);
            }
            else             // if (MyType == ArrowType.Down)
            {
                p[0].Set(x1 - cx, y1 - d);
                p[1].Set(x1, y1 + cy);
                p[2].Set(x1 + cx, y1 - d);
            }

            // Renderer.DrawOperations.FillPolygon(p, this.BlackLine, this.BlackFill);
            Renderer.DrawOperations.DrawTriangle(
                p[0].X,
                p[0].Y,
                p[1].X,
                p[1].Y,
                p[2].X,
                p[2].Y,
                System.Drawing.Color.Black,
                System.Drawing.Color.Black);
        }
示例#6
0
 protected virtual ScrollbarButton CreateThumb()
 {
     ScrollbarButton NewThumb = new ScrollbarButton();
     NewThumb.MyButtonStyle = MyThumbStyle;
     return NewThumb;
 }
示例#7
0
 protected virtual void DrawBackground(ScrollbarButton button, IRenderer Renderer)
 {
     Renderer.DrawOperations.FillRectangle(button.Bounds, Background);
 }
 protected virtual void DrawBackground(ScrollbarButton button, IRenderer Renderer)
 {
     Renderer.DrawOperations.FillRectangle(button.Bounds, Background);
 }