예제 #1
0
    public void Remove(WidgetBase childWidget)
    {
        Trace.Assert(childWidget.GetParent() == this);

        childWidget.SetParent(null);
        mChildren.Remove(childWidget);
        Globals.UiManager.RefreshMouseOverState();
    }
예제 #2
0
    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();
    }