40 #ifndef _uiverticallayoutstrategy_cpp
41 #define _uiverticallayoutstrategy_cpp
43 #include "UI/verticallayoutstrategy.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().CanExpandVertically() )
80 ++NextNonExpandingChild;
81 ++ExpandingChildCount;
85 if( ExpandingChildCount == 0 ) {
99 if( NextNonExpandingChild != ChildQuads.end() )
100 ++NextNonExpandingChild;
101 ChildIt = NextNonExpandingChild;
105 Real FixedBottomPos = 0;
108 if( NextNonExpandingChild != ChildQuads.end() ) {
131 Real YPos = PrevBottomPos;
132 Real YSpacePerChild = (NextTopPos - PrevBottomPos) / ExpandingChildCount;
134 while( ChildIt != NextNonExpandingChild )
142 NewChildRect.
Size.
Y = YSpacePerChild;
154 PrevBottomPos = FixedBottomPos;
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.
VerticalLayoutStrategy()
Class constructor.
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.
virtual Whole GetHorizontalSizingRules() const
Gets the current behavior this quad will follow for the X axis when it is resized.
Unified dimensions are ignored and will instead us all available space.
virtual Real HandleChildHorizontalSizing(const Rect &OldSelfRect, const Rect &NewSelfRect, const Real PrevAxisResult, QuadRenderable *Child)
Handles the sizing of a child on the X axis.
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 ~VerticalLayoutStrategy()
Class destructor.
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.
virtual Real HandleChildHorizontalPositioning(const Rect &OldSelfRect, const Rect &NewSelfRect, const Vector2 &NewChildSize, QuadRenderable *Child)
Handles the positioning of a child on the X axis.
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.