Container

Description

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

Class


public static readonly attribute Class → (StyleClass)

The style class for Container.

Public / Constructors

Container


public constructor Container → ()

Creates a new instance of Container.

Public / Methods

ChildAdd

2 overloads


public virtual method ChildAdd1 → (1)

component in : Component

[not-null]
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

[not-null]
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).

ChildAny


[Pure]
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.

ChildBounds

2 overloads


public method ChildBounds1 → (1)

component in : Component

[not-null]
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

[not-null]
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.

ChildRemove


public virtual method ChildRemove → (1)

component in : Component

[not-null]
The child component.

Removes a child component from this container.

ChildRemoveAll


public method ChildRemoveAll → ()

Removes all child components from this container.

ValidateLayout


public method ValidateLayout → ()

Validates the layout of this component.

Public / Attributes

ActualLayoutInsets


public attribute ActualLayoutInsets → (get)

value : Edging

The actual layout insets.

The actual layout insets, as computed by ComputeLayoutInsets.

ClientArea


public virtual attribute ClientArea → (get)

value : Box2I

The client area.

Returns the client area of this container.

ClientAreaCorners


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.

Components


public virtual attribute Components → (get)

value : IVectorConst<Component>

[not-null]
The list of child components.

Returns the list of child components.

LayoutInsets


public attribute LayoutInsets → (get,set)

value : Edging

The edge insets.

The insets of this container.

Protected / Methods

ComputeLayoutInsets


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.

LayoutGridBounds


[Pure]
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

Focussed


protected attribute Focussed → (get)

value : Component

The focussed child component or null if none.

Returns the currently focussed child component.

guiUpdating


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.

LayoutGridExtends


protected attribute LayoutGridExtends → (get)

value : Box2I

The coordinate ranges of the layout grid cells.

Returns the layout grid cell extend.