示例#1
0
 public virtual void AddChild(Widget child)
 {
     _children.Add(child);
     child.Parent = this;
     child.SpriteSheet = SpriteSheet;
     FindRoot().UpdateLayout();
     child.UpdateNames();
 }
示例#2
0
        public Widget(string name, float x = 0, float y = 0, float w = 0, float h = 0, bool expandable = true,
                      Alignment? align = null)
        {
            _name = name;
            _x = x;
            _y = y;
            _w = w;
            _h = h;

            PreferredSize = Vector2.Zero;
            Parent = null;
            SpriteSheet = null;
            Visible = true;

            Alignment = align ?? Alignment.Centered;

            Expandable = expandable;
        }
示例#3
0
 public virtual void InsertChild(int index, Widget child)
 {
     _children.Insert(index, child);
 }
示例#4
0
 public virtual void RemoveChild(Widget child)
 {
     child.RemoveNames();
     _children.Remove(child);
     child.Parent = null;
     FindRoot().UpdateLayout();
 }
 public override void AddChild(Widget child)
 {
     RemoveAllChildren();
     base.AddChild(child);
 }