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