AddChild() public method

Adds a child to this component.
public AddChild ( Component component ) : void
component XNAInterfaceComponents.Components.Component The component to add to this parent component
return void
Example #1
0
 public XNAButton(ParentComponent parent, Rectangle bounds, String text)
     : base(parent, bounds)
 {
     this.text = text;
     parent.AddChild(this);
     MouseManager.GetInstance().mouseClickedListeners += OnMouseClick;
     MouseManager.GetInstance().mouseReleasedListeners += OnMouseRelease;
 }
Example #2
0
        public ChildComponent(ParentComponent parent, Rectangle bounds)
            : base(bounds)
        {
            this.parent = parent;
            parent.AddChild(this);
            this.enabled = true;
            this.backgroundColor = Color.Red;
            this.font = DEFAULT_FONT;
            this.fontColor = DEFAULT_FONT_COLOR;
            this.padding = new Padding(5, 5, 5, 5);

            this.text = "";
        }