This is a base class for the algorithms used by QuadRenderables to determine how they should update their dimensions. More...
#include <layoutstrategy.h>
Public Types | |
typedef std::vector< Widget * > | ChildContainer |
Basic container type for QuadRenderable storage by this class. | |
typedef ChildContainer::iterator | ChildIterator |
Iterator type for QuadRenderable instances stored by this class. | |
typedef ChildContainer::const_iterator | ConstChildIterator |
Const Iterator type for QuadRenderable instances stored by this class. | |
Public Member Functions | |
LayoutStrategy () | |
Class constructor. | |
virtual | ~LayoutStrategy () |
Class destructor. | |
virtual void | CheckChildAspectRatio (const Vector2 &OldChildSize, Vector2 &NewChildSize, QuadRenderable *Child) |
Preserves a child's aspect ratio if it is configured to do so. More... | |
virtual void | ClampChildToMaxSize (const Rect &NewSelfRect, Vector2 &NewChildSize, QuadRenderable *Child) |
Clamps the updated size to the set maximum size for the child quad. More... | |
virtual void | ClampChildToMinSize (const Rect &NewSelfRect, Vector2 &NewChildSize, QuadRenderable *Child) |
Clamps the updated size to the set minimum size for the child quad. More... | |
virtual Real | HandleChildHorizontalPositioning (const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child) |
Handles the positioning of a child on the X axis. More... | |
virtual Real | HandleChildHorizontalSizing (const Rect &OldSelfRect, const Rect &NewSelfRect, const Real PrevAxisResult, QuadRenderable *Child) |
Handles the sizing of a child on the X axis. More... | |
virtual Vector2 | HandleChildPositioning (const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child) |
Handles the positioning of a child that needs it's dimensions updated. More... | |
virtual Vector2 | HandleChildSizing (const Rect &OldSelfRect, const Rect &NewSelfRect, QuadRenderable *Child) |
Handles the sizing of a child that needs it's dimensions updated. More... | |
virtual Real | HandleChildVerticalPositioning (const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child) |
Handles the positioning of a child on the Y axis. More... | |
virtual Real | HandleChildVerticalSizing (const Rect &OldSelfRect, const Rect &NewSelfRect, const Real PrevAxisResult, QuadRenderable *Child) |
Handles the sizing of a child on the Y axis. More... | |
virtual void | Layout (const Rect &OldSelfRect, const Rect &NewSelfRect, const ChildContainer &ChildQuads) |
Updates the dimensions of a collection of QuadRenderables. More... | |
This is a base class for the algorithms used by QuadRenderables to determine how they should update their dimensions.
This class has default and implementations for the algorithms that handle the sizing, positioning, as well as how and when those methods are called. These methods can be overridden or expanded upon as neccessary to achieve any specific effect a particular Widget or QuadRenderable may need.
It is important to note that the base LayoutStrategy class does not contain any support for expanding widgets that use the "SR_Fill_Available" size rule.
Definition at line 59 of file layoutstrategy.h.
|
virtual |
Preserves a child's aspect ratio if it is configured to do so.
OldChildSize | The previous size of the child prior to the dimension update. |
NewChildSize | The updated and current dimensions of the calling quad. |
Child | The child to update. |
Definition at line 311 of file layoutstrategy.cpp.
|
virtual |
Clamps the updated size to the set maximum size for the child quad.
NewSelfRect | The updated and current dimensions of the calling quad. |
NewChildSize | The updated size to clamp to the set maximum size for the child. |
Child | The child to update. |
Definition at line 354 of file layoutstrategy.cpp.
|
virtual |
Clamps the updated size to the set minimum size for the child quad.
NewSelfRect | The updated and current dimensions of the calling quad. |
NewChildSize | The updated size to clamp to the set minimum size for the child. |
Child | The child to update. |
Definition at line 342 of file layoutstrategy.cpp.
|
virtual |
Handles the positioning of a child on the X axis.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
NewChildSize | The post-update size of the child being updated. |
Child | The child to update. |
Definition at line 109 of file layoutstrategy.cpp.
|
virtual |
Handles the sizing of a child on the X axis.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
PrevAxisResult | The result of the previous axis, in case the settings require it. |
Child | The child to update. |
Definition at line 267 of file layoutstrategy.cpp.
|
virtual |
Handles the positioning of a child that needs it's dimensions updated.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
NewChildSize | The post-update size of the child being updated. |
Child | The child to update. |
Definition at line 97 of file layoutstrategy.cpp.
|
virtual |
Handles the sizing of a child that needs it's dimensions updated.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
Child | The child to update. |
Definition at line 227 of file layoutstrategy.cpp.
|
virtual |
Handles the positioning of a child on the Y axis.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
NewChildSize | The post-update size of the child being updated. |
Child | The child to update. |
Definition at line 168 of file layoutstrategy.cpp.
|
virtual |
Handles the sizing of a child on the Y axis.
OldSelfRect | The previous dimensions of the calling quad prior to it's dimensions being updated. |
NewSelfRect | The updated and current dimensions of the calling quad. |
PrevAxisResult | The result of the previous axis, in case the settings require it. |
Child | The child to update. |
Definition at line 288 of file layoutstrategy.cpp.
|
virtual |
Updates the dimensions of a collection of QuadRenderables.
OldSelfRect | The pre-update dimensions of the calling quad. |
NewSelfRect | The post-update dimensions of the calling quad. |
ChildQuads | A container of all the Quads to be updated by this strategy. |
Reimplemented in Mezzanine::UI::HorizontalLayoutStrategy, and Mezzanine::UI::VerticalLayoutStrategy.
Definition at line 67 of file layoutstrategy.cpp.