示例#1
0
        public override void HandleRepaint(ConsoleGui.Interfaces.Drawing.IDrawingContext context)
        {
            context.DrawThinBorder(this.Region);
            if (HasFocus)
            {
                context.DrawStringAlligned(context.Invert("<" + _text + ">"), this.Region.Interior, this.TextAllignment);
            }
            else
            {
                context.DrawStringAlligned("<" + _text + ">", this.Region.Interior, this.TextAllignment);
            }

            base.HandleRepaint(context);
        }
示例#2
0
        public override void HandleRepaint(ConsoleGui.Interfaces.Drawing.IDrawingContext context)
        {
            var subRegion = Region.Interior;

            if (HasFocus)
            {
                context.DrawThinBorder(Region);
                context.DrawText(subRegion, _text, false, true, _scrollPosition, _scrollbarVisible);
            }
            else
            {
                context.DrawText(subRegion, _text, false, true, _scrollPosition, _scrollbarVisible);
            }

            base.HandleRepaint(context);
        }
示例#3
0
        public override void HandleRepaint(ConsoleGui.Interfaces.Drawing.IDrawingContext context)
        {
            var le = new Drawing.TableLayoutEngine(this.Region.Interior);

            le.LayoutRows = 3;
            le.LayoutCols = 3;

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    int k = i * 3 + j;
                    context.DrawThinBorder(le.GetRegion(i, j));
                    context.DrawStringAlligned("Text", le.GetRegion(i, j).Interior, (Drawing.TextAllignment)k);
                }
            }

            base.HandleRepaint(context);
        }
示例#4
0
        public override void HandleRepaint(ConsoleGui.Interfaces.Drawing.IDrawingContext context)
        {
            if (HasFocus)
            {
                context.DrawThinBorder(Region, Text);
            }

            var sbMenuUptions = new StringBuilder();

            for (int i = 0; i < _checkboxItems.Count; i++)
            {
                var    option = _checkboxItems [i];
                string c      = "";
                if (option.IsChecked)
                {
                    c = c + "✓";                   // Is this terminal friendly?
                }
                else
                {
                    c = c + " ";
                }
                if (i == _cursorPosition && HasFocus)
                {
                    sbMenuUptions.AppendLine(context.Invert($"[{c}] {option.Text}"));
                }
                else
                {
                    sbMenuUptions.AppendLine($"[{c}] {option.Text}");
                }
            }

            var upper = Math.Max(0, _cursorPosition - (Region.Bottom - Region.Top) / 2);

            context.DrawText(new ConsoleGui.Drawing.Rect(
                                 Region.Left + 1,
                                 Region.Top + 1,
                                 Region.Right - 1,
                                 Region.Bottom - 1), sbMenuUptions.ToString(), false, false, upper);

            base.HandleRepaint(context);
        }
示例#5
0
 public override void HandleRepaint(ConsoleGui.Interfaces.Drawing.IDrawingContext context)
 {
     context.DrawStringAlligned(Text, Region, TextAllignment);
     base.HandleRepaint(context);
 }