protected GuiComponent(GuiComponent parent) { this.Parent = parent; Manager = parent.Manager; Position = parent.GetInnerCanvasTopLeft(); Dimensions = new GuiDimensions(new Size(), new Size()); parent.RegisterChildComponent(this); }
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; } } }
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 }; }
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 }; }
public UmlWindow(GuiComponent parent, State state) : base(parent) { this.state = state; }
protected GuiComponent(GuiComponent parent, Coord position) : this(parent) { Position = parent.GetInnerCanvasTopLeft() + parent.Position + position; }
public virtual void RemoveChild(GuiComponent child) { Children.Remove(child); }
public GuiComponent RegisterChildComponent(GuiComponent child) { Children.Add(child); return(child); }