Ejemplo n.º 1
0
 public virtual void AddChild(GUIElement child)
 {
     child.Parent       = this;
     child.ParentCanvas = ParentCanvas;
     Children.Add(child);
     child.SetVisibility(Shown);
 }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
                }
            }
        }
Ejemplo n.º 6
0
 public virtual void RemoveChild(GUIElement child)
 {
     Children.Remove(child);
 }
Ejemplo n.º 7
0
 public virtual void AddChild(GUIElement child)
 {
     child.Parent       = this;
     child.ParentCanvas = ParentCanvas;
     Children.Add(child);
 }