BoxLayout

Description

sealed class Tinman.Engine.GUI.Components.BoxLayout

Helper class for computing a simple box layout.

The box layout has a single row and four columns:

+--------------------------------------------------+
|                                                  |
|  @@::          #   ####                    ::@@  |
|  @@@@::       # #  #   #    ### ###      ::@@@@  |
|  @@@@@@::    #   # #   #   #    #  #   ::@@@@@@  |
|  @@@@@@@@    #   # #  #    #    #  #   @@@@@@@@  |
|  @@@@@@::    ##### #   #   #    #  #   ::@@@@@@  |
|  @@@@::      #   # #   #    ### ###      ::@@@@  |
|  @@::        #   # ####                    ::@@  |
|                                                  |
+--------------------------------------------------+

An icon may be placed into the leftmost xor rightmost column. The second column holds the main text. The third column holds a smaller hint text.

Public / Constructors

Box​Layout


public constructor BoxLayout → ()

Creates a new instance of BoxLayout.

Public / Methods

Prepare


public method Prepare → (1)

component in : Component

[not-null]
The component to use.

Applies the current styles of the given component in and uses it for subsequent layout computations.

The following properties are set by this method:

Public / Attributes

Actual​Height


public attribute ActualHeight → (get,set)

value : int32

[>=0]
The layout height.

The actual box layout height.

Actual​Width


public attribute ActualWidth → (get,set)

value : int32

[>=0]
The layout width.

The actual box layout width.

Font​Hint


public attribute FontHint → (get,set)

value : IResourceHandle

The font handle or null.

The font of the hint text.

Font​Text


public attribute FontText → (get,set)

value : IResourceHandle

The font handle or null.

The font of the text.

Hint


public attribute Hint → (get,set)

value : string

The hint text or null for none.

The hint text.

Icon


public attribute Icon → (get,set)

value : IResourceHandle

The icon or null for none.

The icon (left or right).

Icon​Left


public attribute IconLeft → (get,set)

value : bool

true for left side, false for right side.

Put icon on left side?

Layout​Size


public attribute LayoutSize → (get)

value : Vec2I

The layout size.

The minimum layout size.

Padding


public attribute Padding → (get,set)

value : int32

The padding, in pixels.

The minimum inner padding.

Position​Hint


public attribute PositionHint → (get)

value : Vec2I

Coordinates of text hint anchor for Anchor.TopLeft.

The actual position of the text hint.

Position​Icon


public attribute PositionIcon → (get)

value : Vec2I

Coordinates of icon anchor for Anchor.TopLeft.

The actual position of the icon.

Position​Text


public attribute PositionText → (get)

value : Vec2I

Coordinates of text anchor for Anchor.TopLeft.

The actual position of the text.

Text


public attribute Text → (get,set)

value : string

The text or null for none.

The text.

Text​Align


public attribute TextAlign → (get,set)

value : Anchor

The text alignment.

The text alignment.

Text​Grow


public attribute TextGrow → (get,set)

value : bool

true to grow the text area, false to not grow.

Grow the area of the text horizontally to fill all available space?