Esempio n. 1
0
 public static void PaintString(Canvass c, string s, int x, int y, int objectId, ConsoleColor backgroundColor,
                                ConsoleColor foregroundColor)
 {
     for (int i = 0; i < s.Length; i++)
     {
         c.Paint(x + i, y, s[i], objectId, backgroundColor, foregroundColor);
     }
 }
Esempio n. 2
0
        public override Canvass Paint()
        {
            var c           = new Canvass();
            var focusMarker = (IsFocused ? ">" : " ");

            Canvass.PaintString(c, " " + focusMarker + buttonText + "  ", 0, 0, -10, BackGround, Foreground);
            return(c);
        }
Esempio n. 3
0
        public override Canvass Paint()
        {
            var c   = new Canvass();
            var res = Value.PadRight(Dimensions.Width.Pixels);

            c.RawPaintString(res, 0, 0, BackGround, Foreground);

            if (IsFocused)
            {
                WindowManager.SetCursorPosition(Position.Y, Position.X + cursor);
                Console.CursorVisible = true;
            }

            return(c);
        }
Esempio n. 4
0
        public override Canvass Paint()
        {
            var c = new Canvass();

            for (int i = 0; i < Dimensions.Height.Pixels; i++)
            {
                var width = Dimensions.Width.Pixels;

                var line = (i < lines.Count ? lines[i] : "").PadRight(width);
                if (line.Length > width)
                {
                    line = line.Substring(0, width);
                }
                c.RawPaintString(line, 0, i, BackGround, Foreground);
            }

            if (IsFocused)
            {
                WindowManager.SetCursorPosition(Position.Y + cursor.Y, Position.X + cursor.X);
                Console.CursorVisible = true;
            }

            return(c);
        }
Esempio n. 5
0
        public override Canvass Paint()
        {
            var size = Dimensions;

            if (Dimensions.IsFullyAutosize())
            {
                var childrensSize = GetSize();
                var width         = Math.Max(childrensSize.Width.Pixels, title.Length + CloseButton.Length);
                size = new GuiDimensions(new Size(width), childrensSize.Height);
            }
            var titleline = title.PadRight(size.Width.Pixels - CloseButton.Length) + CloseButton;

            var c = new Canvass();

            c.RawPaintString(titleline, 0, 0, ConsoleColor.DarkGray, ConsoleColor.Gray);
            var line = "".PadRight(size.Width.Pixels);

            for (int y = 1; y < size.Height.Pixels; y++)
            {
                c.RawPaintString(line, 0, y, BackGround, Foreground);
            }

            return(c);
        }
Esempio n. 6
0
 public static void PaintString(Canvass c, string s, int x, int y, int objectId)
 {
     PaintString(c, s, x, y, objectId, ConsoleColor.Black, ConsoleColor.Gray);
 }