public virtual void AddChild(GUIElement child) { child.Parent = this; child.ParentCanvas = ParentCanvas; Children.Add(child); child.SetVisibility(Shown); }
public override void AddChild(GUIElement child) { GridLayoutInfo info = new GridLayoutInfo(); for (int i = 0; i < Children.Count; i++) { var colInfo = ColSpanRows.Find((x) => x.StartRow == info.Row); if (colInfo != null) { info.Row += colInfo.Lenght; } else { info.Col++; if (info.Col >= Columns) { info.Col = 0; info.Row++; } } if (info.Row > Rows) { return; } } child.LayoutTag = info; base.AddChild(child); if (Inited) { Resize((int)LastParentSize.X, (int)LastParentSize.Y); } }
public override void AddChild(GUIElement child) { if (FitChildToWidth) { child.Rect.Width = RelativeSize.FullWidth; } base.AddChild(child); if (Inited) { Resize((int)LastParentSize.X, (int)LastParentSize.Y); } }
public void AddElement(GUIElement element, int layer = 0) { if (!GUIElements.ContainsKey(layer)) { GUIElements.Add(layer, new List <GUIElement>()); } element.SetParentCanvas(this); GUIElements[layer].Add(element); if (BoundWindow != null) { element.Resize(BoundWindow.Width, BoundWindow.Height); } }
public void SetPopupElement(GUIElement element) { if (PopUpCTL != null) { PopUpCTL = null; // disable it here? it may need to flush a list? } PopUpCTL = element; if (element != null) { element.ParentCanvas = this; if (BoundWindow != null) { element.Resize(BoundWindow.Width, BoundWindow.Height); } } }
public virtual void RemoveChild(GUIElement child) { Children.Remove(child); }
public virtual void AddChild(GUIElement child) { child.Parent = this; child.ParentCanvas = ParentCanvas; Children.Add(child); }