Exemplo n.º 1
0
        /// <summary>
        /// Adds a child control to the container
        /// </summary>
        /// <param name="child">New child to add</param>
        public virtual void AddChild(IControl child)
        {
            // Update Array Size
            if (_children == null)
            {
                _children = new IControl[1];
            }
            else
            {
                var tmp = new IControl[_children.Length + 1];
                Array.Copy(_children, tmp, _children.Length);
                _children = tmp;
            }

            // Set control properties
            child.Parent = this;
            child.UpdateOffsets();

            // Assign Value
            _children[_children.Length - 1] = child;

            // Render
            if (_active == null && child.CanFocus)
            {
                _active = child;
                _active.Activate();
            }

            Render(child.ScreenBounds, true);
        }
Exemplo n.º 2
0
 private void ActivateEntry()
 {
     if (ControlIndex >= 0 && ControlIndex < Controls.Count)
     {
         IControl ctrl = Controls[ControlIndex];
         if (!ctrl.Active)
         {
             ctrl.Activate();
         }
         else
         {
             ctrl.Active = false;
         }
     }
 }