using System; namespace Gwen.Control.Layout { /// /// Helper control that positions its children in a specific way. /// public class Positioner : Base { private Pos m_Pos; /// /// Children position. /// public Pos Pos { get { return m_Pos; } set { m_Pos = value; } } /// /// Initializes a new instance of the class. /// /// Parent control. public Positioner(Base parent) : base(parent) { Pos = Pos.Left | Pos.Top; } /// /// Function invoked after layout. /// /// Skin to use. protected override void PostLayout(Skin.Base skin) { foreach (Base child in Children) // ok? { child.Position(m_Pos); } } } /// /// Helper class that centers all its children. /// public class Center : Positioner { /// /// Initializes a new instance of the class. /// /// Parent control. public Center(Base parent) : base(parent) { Pos = Pos.Center; } } }