示例#1
0
        protected GuiComponent(GuiComponent parent)
        {
            this.Parent = parent;
            Manager     = parent.Manager;

            Position   = parent.GetInnerCanvasTopLeft();
            Dimensions = new GuiDimensions(new Size(), new Size());

            parent.RegisterChildComponent(this);
        }
示例#2
0
        public void FocusNextChild(GuiComponent currentComponent)
        {
            int index = Children.FindIndex(x => x == currentComponent);

            for (int i = 1; i < Children.Count; i++)
            {
                var child = Children[(i + index) % Children.Count];
                if (child.IsVisible && child.IsFocusable)
                {
                    child.Focus();
                    return;
                }
            }
        }
示例#3
0
        public ConnectForm(GuiComponent parent, Coord position) : base(parent, position)
        {
            connectA = new TextLabel(this, "From object:", new Coord(0, 0));
            from     = new TextBox(this, 5, new Coord(0, 1))
            {
                OnUserEscape = RemoveMeAndChildren, OnUserSubmit = OnSubmit
            };
            connectB = new TextLabel(this, "To object:", new Coord(0, 2));
            to       = new TextBox(this, 5, new Coord(0, 3))
            {
                OnUserEscape = RemoveMeAndChildren, OnUserSubmit = OnSubmit
            };

            validationErrors = new TextLabel(this, "", new Coord(0, 4))
            {
                BackGround = ConsoleColor.White,
                Foreground = ConsoleColor.Red
            };
        }
示例#4
0
        public SelectObjectForm(GuiComponent parent, int[] legalInput, Coord position)
        {
            this.legalInput = legalInput;
            titled          = new TitledWindow(parent, "Select object")
            {
                Position = position
            };

            new TextLabel(titled, "Object:", new Coord(0, 0));
            selected = new TextBox(titled, 5, new Coord(0, 1))
            {
                OnUserEscape = titled.RemoveMeAndChildren, OnUserSubmit = Submit
            };

            validationErrors = new TextLabel(titled, "", new Coord(0, 2))
            {
                BackGround = ConsoleColor.White,
                Foreground = ConsoleColor.Red
            };
        }
示例#5
0
 public UmlWindow(GuiComponent parent, State state) : base(parent)
 {
     this.state = state;
 }
示例#6
0
 protected GuiComponent(GuiComponent parent, Coord position) : this(parent)
 {
     Position = parent.GetInnerCanvasTopLeft() + parent.Position + position;
 }
示例#7
0
 public virtual void RemoveChild(GuiComponent child)
 {
     Children.Remove(child);
 }
示例#8
0
 public GuiComponent RegisterChildComponent(GuiComponent child)
 {
     Children.Add(child);
     return(child);
 }