public void Remove(WidgetBase childWidget) { Trace.Assert(childWidget.GetParent() == this); childWidget.SetParent(null); mChildren.Remove(childWidget); Globals.UiManager.RefreshMouseOverState(); }
public virtual void Add(WidgetBase childWidget) { if (childWidget.GetParent() != null && childWidget.GetParent() != this) { childWidget.GetParent().Remove(childWidget); } childWidget.SetParent(this); // If the child widget was a top-level window before, remove it if (childWidget is WidgetContainer otherContainer) { Globals.UiManager.RemoveWindow(otherContainer); } mChildren.Add(childWidget); Globals.UiManager.RefreshMouseOverState(); }