示例#1
0
        /// <summary> Add a widget to the list of children. </summary>
        /// <param name="child"> The widget to add. <see cref="XrwRectObj"/> </param>
        public override void AddChild(XrwRectObj child)
        {
            if (child == null)
            {
                return;
            }

            if (_children.Count == 0)
            {
                child.Show();
            }
            else if (child.Shown)
            {
                for (int count = 0; count < _children.Count; count++)
                {
                    _children[count].Hide();
                }
            }
            else
            {
                child.Hide();
            }

            _children.Add(child);
            child._parent = this;
        }
示例#2
0
        /// <summary> Show indicated child and hide formerly shown child. </summary>
        /// <param name="child"> The child to show. <see cref="XrwRectObj"/> </param>
        public void ShowChild(XrwRectObj child)
        {
            if (child == null)
            {
                return;
            }

            if (child == this.ShownChild)
            {
                return;
            }

            if (!_children.Contains(child))
            {
                return;
            }

            ShownChild.Hide();
            child.Show();
        }