Example #1
0
        public override void Draw(DrawSpace ds)
        {
            ds.Color = IsActive ? ActiveLineEditColor : InactiveLineEditColor;

            var outText = Text.Substring( TextRolling, Math.Min(Area.Width, Text.Length-TextRolling) );
            if( IsActive && outText.Length < Area.Width )
                outText += "_";

            ds.PutString(Point.Empty, outText, Area.Width);
        }
Example #2
0
        public override void Draw(DrawSpace ds)
        {
            ds.Color = IsActive ? ActiveBoxCheckBoxColor : InactiveBoxCheckBoxColor;
            ds.PutString(Point.Empty, State ? CheckCharacter.ToString() : " ", 1);

            ds.Color = IsActive ? ActiveTextCheckBoxColor : InactiveTextCheckBoxColor;
            var outText = " " + Text;

            ds.PutString(new Point(1,0), outText, Area.Width-1);
        }
Example #3
0
        public override void Draw(DrawSpace ds)
        {
            ds.Color = color;

            ds.PutString(new Point(0,0), Text, Area.Width, Centered);
        }
Example #4
0
        public override void Draw(DrawSpace ds)
        {
            // border
            ds.Color = IsActive ? ActiveBorderButtonColor : InactiveBorderButtonColor;
            // height is odd
            if( Area.Height == 1 )
            {
                // │ ... │
                ds.PutCharacter(new Point(0,0),             '│');
                ds.PutCharacter(new Point(Area.Width-1,0),  '│');
            }
            else
            {
                var rect = new Rectangle(Point.Empty, Size);
                ds.DrawBorder(rect, DrawSpace.SingleBorder);
            }

            // text
            ds.Color = IsActive ? ActiveTextButtonColor : InactiveTextButtonColor;
            ds.PutString(new Point(1,Area.Height/2), Text, Area.Width-2, centered: true);
            if( Area.Height > 3 )
            {
                // we need to erase spare space
                ds.FillRectangle(new Rectangle(1, 1, Area.Width-2, Area.Height/2-1), ' ');
                ds.FillRectangle(new Rectangle(1, Area.Height/2+1, Area.Width-2, (Area.Height+1)/2-2), ' ');
            }
        }