40 #ifndef _uihorizontallayoutstrategy_cpp
41 #define _uihorizontallayoutstrategy_cpp
43 #include "UI/horizontallayoutstrategy.h"
44 #include "UI/widget.h"
45 #include "MathTools/mathtools.h"
73 while( ChildIt != ChildQuads.end() )
76 UInt32 ExpandingChildCount = 0;
78 while( NextNonExpandingChild != ChildQuads.end() && (*NextNonExpandingChild)->GetSizingPolicy().CanExpandHorizontally() )
80 ++NextNonExpandingChild;
81 ++ExpandingChildCount;
85 if( ExpandingChildCount == 0 ) {
99 if( NextNonExpandingChild != ChildQuads.end() )
100 ++NextNonExpandingChild;
101 ChildIt = NextNonExpandingChild;
105 Real FixedRightPos = 0;
108 if( NextNonExpandingChild != ChildQuads.end() ) {
131 Real XPos = PrevRightPos;
132 Real XSpacePerChild = (NextLeftPos - PrevRightPos) / ExpandingChildCount;
134 while( ChildIt != NextNonExpandingChild )
141 NewChildRect.
Size.
X = XSpacePerChild;
154 PrevRightPos = FixedRightPos;
157 if( NextNonExpandingChild != ChildQuads.end() )
158 ++NextNonExpandingChild;
159 ChildIt = NextNonExpandingChild;
virtual Rect GetRect() const
Gets this QuadRenderables' Rect.
ChildContainer::const_iterator ConstChildIterator
Const Iterator type for QuadRenderable instances stored by this class.
virtual Vector2 HandleChildSizing(const Rect &OldSelfRect, const Rect &NewSelfRect, QuadRenderable *Child)
Handles the sizing of a child that needs it's dimensions updated.
Vector2 Size
Vector2 representing the width and height of the rect.
Unified dimensions are ignored and will instead us all available space.
std::vector< Widget * > ChildContainer
Basic container type for QuadRenderable storage by this class.
virtual void CheckChildAspectRatio(const Vector2 &OldChildSize, Vector2 &NewChildSize, QuadRenderable *Child)
Preserves a child's aspect ratio if it is configured to do so.
This class represents a box shaped area on the screen.
This implements the exception hiearchy for Mezzanine.
float Real
A Datatype used to represent a real floating point number.
virtual Boole GetManualTransformUpdates() const
Gets whether or not this quad will be automatically updated when parent transforms are updated...
Real Y
Coordinate on the Y vector.
Real X
Coordinate on the X vector.
uint32_t UInt32
An 32-bit unsigned integer.
virtual void Layout(const Rect &OldSelfRect, const Rect &NewSelfRect, const ChildContainer &ChildQuads)
Updates the dimensions of a collection of QuadRenderables.
virtual ~HorizontalLayoutStrategy()
Class destructor.
HorizontalLayoutStrategy()
Class constructor.
The bulk of the engine components go in this namspace.
virtual void ClampChildToMinSize(const Rect &NewSelfRect, Vector2 &NewChildSize, QuadRenderable *Child)
Clamps the updated size to the set minimum size for the child quad.
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.
This represents a nestable quad for an object in a GUI layout.
virtual void UpdateDimensions()
Updates the dimensions of this QuadRenderable based on the transform of it's parent.
Vector2 Position
Vector2 representing the top-left position of the rect.
virtual void ClampChildToMaxSize(const Rect &NewSelfRect, Vector2 &NewChildSize, QuadRenderable *Child)
Clamps the updated size to the set maximum size for the child quad.
virtual Real HandleChildVerticalPositioning(const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child)
Handles the positioning of a child on the Y axis.
virtual Whole GetVerticalSizingRules() const
Gets the current behavior this quad will follow for the Y axis when it is resized.
virtual Real HandleChildVerticalSizing(const Rect &OldSelfRect, const Rect &NewSelfRect, const Real PrevAxisResult, QuadRenderable *Child)
Handles the sizing of a child on the Y axis.