UTFWin::ProportionalLayout class

Base classes

class InteractiveWinProc
class ILayoutStyle
This class represents an object that can apply a certain layout to a given Rectangle area.

Constructors, destructors, conversion operators

ProportionalLayout()
ProportionalLayout(float left, float top, float right, float bottom)
~ProportionalLayout() virtual

Public functions

auto AddRef() -> int override
auto Release() -> int override
auto Cast(uint32_t typeID) const -> void* override
auto GetEventFlags() const -> int override
Gets the flags that represent which type of messages this IWinProc can handle.
auto OnLayout(IWindow* window, Math::Rectangle& parentBounds) -> void override
An event listener called every time the window layout is recalculated on a window this procedure is listening.
auto SetSerializer(Serializer& dst) -> void override
auto GetProxyID() const -> uint32_t override
Returns the ID that identifies this type of element in a SPUI file.
auto ToWinProc() const -> IWinProc* override
Returns the IWinProc representation of this ILayoutStyle, so that it can be used on an IWindow.
auto ApplyLayout(Math::Rectangle& area, const Math::Rectangle& parentArea) -> void override
Applies this layout to the given area.
auto RevertLayout(Math::Rectangle& area, const Math::Rectangle& parentArea) -> bool override
Reverts this layout to the given area.
auto GetProportions() const -> const float* virtual
auto SetProportions(float values[4]) -> void virtual

Protected variables

float mProportions

Function documentation

int UTFWin::ProportionalLayout::GetEventFlags() const override

Gets the flags that represent which type of messages this IWinProc can handle.

This allows for better performance, since generally a procedure only needs to listen specific events. The flags are in the kEventFlag... values.

void UTFWin::ProportionalLayout::OnLayout(IWindow* window, Math::Rectangle& parentBounds) override

An event listener called every time the window layout is recalculated on a window this procedure is listening.

Parameters
window
parentBounds

IWinProc* UTFWin::ProportionalLayout::ToWinProc() const override

Returns the IWinProc representation of this ILayoutStyle, so that it can be used on an IWindow.

This is preferred to the Cast method.

void UTFWin::ProportionalLayout::ApplyLayout(Math::Rectangle& area, const Math::Rectangle& parentArea) override

Applies this layout to the given area.

Parameters
area in/out The current area of the window. The result will be written here as well.
parentArea in The area of the parent window, some layouts might use this. Even if this parameter is used, the resulting area will be relative to the parent window position.

The parent area of the window must also be specified as some layouts might use it; the resulting area will still be relative to the parent window position, however.

bool UTFWin::ProportionalLayout::RevertLayout(Math::Rectangle& area, const Math::Rectangle& parentArea) override

Reverts this layout to the given area.

Parameters
area in/out The current area of the window. The result will be written here as well.
parentArea in The area of the parent window, some layouts might use this. Even if this parameter is used, the resulting area will be relative to the parent window position.
Returns True if the layout was successfully reverted.

The parent area of the window must also be specified as some layouts might use it; the resulting area will still be relative to the parent window position, however. This is the inverse of ApplyLayout().