class Tinman.Engine.GUI.Container

Base class for containers that can have child components.

The following default Layout settings are defined for Container objects:

Public / Constants


public static readonly attribute Class → (StyleClass)

The style class for Container.

Public / Constructors


public constructor Container → ()

Creates a new instance of Container.

Public / Methods


2 overloads

public virtual method ChildAdd1 → (1)

component in : Component own

The child component.

Adds a child component to this container, using its current layout settings.

Use this method if you have configured the layout settings of component in earlier (see Component.LayoutInfo) and want those to be used when adding component in as a child of this container.

public virtual method ChildAdd2 → (2)

component in : Component own

The child component.

layout in : Layout

The layout settings to use; will replace Component.LayoutInfo. Unspecified settings will be taken from Component.LayoutDefault. Usually, you may want to start with Layout.At1 in order to create a new Layout value.

Adds a child component to this container, using the given layout settings.

This is the usual way of constructing a hierarchy of components: create new components, adjust their default layout settings and put into the layout grid of the parent container.

Use this method if the current layout settings of component in shall be discarded (e.g. it is a newly created Component object with zero layout settings).


public virtual method ChildAny → (1)

onlyVisible in : bool

true to test for non-hidden (see ComponentState.Hidden) children only, false to test for existing children.

returns → bool

true if there are one or more children (according to onlyVisible in), false if not.

Checks if this container has any children.


2 overloads

public method ChildBounds1 → (1)

component in : Component

The child (or descendant) component.

returns → Box2I

The bounds of component in, relative to this container.

Returns the bounds of the given child (or descendant) in this container.

public method ChildBounds2 → (2)

component in : Component

The child (or descendant) component.

bounds in : Box2I

The bounds, relative to component in.

returns → Box2I

The bounds of component in, relative to this container.

Translate the given child (or descendant) bounds so that they are relative to this container.


public virtual method ChildRemove → (1)

component in : Component

The child component.

Removes a child component from this container.


public method ChildRemoveAll → ()

Removes all child components from this container.


public method ValidateLayout → ()

Validates the layout of this component.

Public / Attributes


public attribute ActualLayoutInsets → (get)

value : Edging

The actual layout insets.

The actual layout insets, as computed by ComputeLayoutInsets.


public virtual attribute ClientArea → (get)

value : Box2I

The client area.

Returns the client area of this container.


public virtual attribute ClientAreaCorners → (get)

value : Pair<Corner, int32>

The round corners of this containers client rectangle.

Containers with a round client rectangle can override this property in order to return proper information.


public virtual attribute Components → (get)

value : IVectorConst<Component>

The list of child components.

Returns the list of child components.


public attribute LayoutInsets → (get,set)

value : Edging

The edge insets.

The insets of this container.

Protected / Methods


protected virtual method ComputeLayoutInsets → ()

returns → Edging

The actual insets value.

Computes the actual insets of this component.

The default implementation returns LayoutInsets. Subclasses can perform additional computations here.

Subclasses must call Component.InvalidateLayout with LayoutAction.ComputeLayoutGridExtend to notify when ComputeLayoutInsets returns a different value.


protected method LayoutGridBounds → (4)

in : int32

Grid X-coordinate of top-left cell.

in : int32

Grid Y-coordinate of top-left cell.

width opt : int32 = 1

The range width, in cells. If less the zero, the range will span all remaining columns, starting at in.

height opt : int32 = 1

The range height, in cells. If less the zero, the range will span all remaining rows, starting at in.

returns → Box2I

The pixel bounds of the given cell range.

Returns the layout bounds of the given layout grid cell range.

Protected / Attributes


protected attribute Focused → (get)

value : Component

The focused child component or null if none.

Returns the currently focused child component.


protected attribute guiUpdating → (BeginEnd)

Helper object that can be used to avoid re-entrance problems with event notification calls while updating the GUI from code.


protected attribute LayoutGridExtends → (get)

value : Box2I

The coordinate ranges of the layout grid cells.

Returns the layout grid cell extend.