class GUILayoutY

Represents a vertical layout that will layout out its child elements top to bottom.

Public

Constructors

GUILayoutY

GUILayoutY() = default

GUILayoutY

GUILayoutY(PrivatelyConstruct, const String &styleClass, const GUISizeConstraints &sizeConstraints)

Methods

~GUILayoutY

~GUILayoutY() noexcept = default

staticGetGuiTypeName

static const String &GetGuiTypeName()

Returns type name of the GUI element used for finding GUI element styles.

staticCreate

static GUIElementType *Create(const String &styleClass, const TInlineArray<GUIOption, 4> &options)

Creates a new GUI element.

styleClass
Style class that will be used for determining GUI element visuals from the current style sheet. If no class is provided, default style is determined based on GUI element type.
options
Additional options that control GUI element size and position. This will override options set in the style sheet.

Internal

Methods

UpdateOptimalLayoutSizes

void UpdateOptimalLayoutSizes() override

Calculates optimal sizes of all child elements, as determined by their style and layout options.

This is performed recursively over all child elements, starting with the bottom-most child element. This should be called before UpdateLayoutRecursive().

UpdateLayoutForChildren

void UpdateLayoutForChildren() override

Calculates sizes and relative positions for all child elements.

Should be preceded with a call to UpdateOptimalLayoutSizes().

Private

Methods

GetChildRelativeLayoutAreas

void GetChildRelativeLayoutAreas(const GUILogicalSize &layoutSize, GUILogicalPoint *outElementPositions, GUILogicalSize *outElementSizes, u32 elementCount, const Vector<GUIConstrainedSizeRange> &sizeRanges, const GUILogicalSize &myOptimalSize) const

Calculates positions & sizes of all elements in the layout.

This method expects a pre-allocated array to store the data in.

layoutSize
Size of the parent layout area to position the child elements in.
outElementPositions
Array to hold output positions. Must be the same size as the number of child elements.
outElementSizes
Array to hold output areas. Must be the same size as the number of child elements.
elementCount
Size of the element positions/sizes arrays.
sizeRanges
Ranges of possible sizes used for the child elements. Array must be same size as elements array.
myOptimalSize
Optimal size of this element with all the child elements.