40 #ifndef _uihorizontalcontainer_cpp
41 #define _uihorizontalcontainer_cpp
43 #include "UI/horizontalcontainer.h"
44 #include "UI/horizontallayoutstrategy.h"
46 #include "UI/horizontalscrollbar.h"
47 #include "UI/spinner.h"
89 Real CurrXPos = ActPadding * 0.5;
90 this->VisibleChildren.clear();
94 while( ChildUpdateIt != this->
ChildWidgets.end() && CurrXPos < XTarget )
98 CurrXPos += ( (*ChildUpdateIt)->GetActualSize().X + ActPadding );
106 std::vector<Vector2> ChildSizeCache;
107 Real TotalLinearSize = 0;
110 CurrXPos = ActPadding * 0.5;
111 XTarget = NewSelfRect.
Size.
X;
119 if( CurrXPos + ChildSize.
X < XTarget ) {
121 if( ChildSize.
Y > NewSelfRect.
Size.
Y ) {
122 ChildSize.
Y = NewSelfRect.
Size.
Y;
124 ChildSizeCache.push_back( ChildSize );
126 CurrXPos += ( ChildSize.
X + ActPadding );
127 TotalLinearSize += ( ChildSize.
X + ActPadding );
142 TotalLinearSize -= ActPadding;
145 case UI::LA_TopLeft: CurrXPos = ActPadding * 0.5;
146 case UI::LA_Center: CurrXPos = ( NewSelfRect.
Position.
X + ( NewSelfRect.
Size.
X * 0.5 ) ) - ( TotalLinearSize * 0.5 );
147 case UI::LA_BottomRight: CurrXPos = ( NewSelfRect.
Position.
X + NewSelfRect.
Size.
X ) - ( TotalLinearSize + ActPadding * 0.5);
156 NewChildRect.
Size = ChildSizeCache.at(X);
161 this->
VisibleChildren.at(X)->UpdateDimensions(OldChildRect,NewChildRect);
163 CurrXPos += ( NewChildRect.
Size.
X + ActPadding );
165 ChildSizeCache.clear();