Пример #1
0
        public override Canvass Paint()
        {
            var size = Dimensions;

            if (Dimensions.IsFullyAutosize())
            {
                Position = Children.Single().Position - GetInnerCanvasTopLeft(); // todo find max spanning area of all children
                var childrensSize = GetSize();
                var mySize        = new GuiDimensions(new Size(title.Length + CloseButton.Length), childrensSize.Height);
                size = GuiDimensions.Max(childrensSize, mySize);
            }
            else
            {
                Position = Parent.GetInnerCanvasTopLeft();
            }

            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);
        }
Пример #2
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);
            }

            return(c);
        }