Exemple #1
0
 internal GridComponent(GridComponentSpec spec, T item)
 {
     Alignment  = spec.Alignment;
     Item       = item;
     Column     = spec.Column;
     ColumnSpan = spec.ColumnSpan;
     Margin     = spec.Margin;
     Row        = spec.Row;
     RowSpan    = spec.RowSpan;
 }
Exemple #2
0
 /// <summary>
 /// Adds a child to this panel.
 /// </summary>
 /// <param name="child">The child to add.</param>
 /// <param name="spec">The location where the child will be placed.</param>
 /// <returns>This panel for call chaining.</returns>
 public PGridPanel AddChild(IUIComponent child, GridComponentSpec spec)
 {
     if (child == null)
     {
         throw new ArgumentNullException("child");
     }
     if (spec == null)
     {
         throw new ArgumentNullException("spec");
     }
     children.Add(new GridComponent <IUIComponent>(spec, child));
     return(this);
 }
Exemple #3
0
 /// <summary>
 /// Adds a component to this layout. Components added through other means to the
 /// transform will not be laid out at all!
 /// </summary>
 /// <param name="child">The child to add.</param>
 /// <param name="spec">The location where the child will be placed.</param>
 public void AddComponent(GameObject child, GridComponentSpec spec)
 {
     if (child == null)
     {
         throw new ArgumentNullException("child");
     }
     if (spec == null)
     {
         throw new ArgumentNullException("spec");
     }
     children.Add(new GridComponent <GameObject>(spec, child));
     child.SetParent(gameObject);
 }