40 #ifndef _uilayoutstrategy_cpp
41 #define _uilayoutstrategy_cpp
43 #include "UI/layoutstrategy.h"
44 #include "UI/widget.h"
46 #include "exception.h"
68 Boolean QuadPositionUpdated = (OldSelfRect.
Position != NewSelfRect.
Position);
69 Boolean QuadSizeUpdated = (OldSelfRect.
Size != NewSelfRect.
Size);
70 for(
ConstChildIterator ChildIt = ChildQuads.begin() ; ChildIt != ChildQuads.end() ; ++ChildIt )
78 Rect NewChildRect = OldChildRect;
81 if( QuadSizeUpdated ) {
85 if( QuadSizeUpdated || QuadPositionUpdated ) {
118 Ret = ( NewSelfRect.
Position.
X + ( NewSelfRect.
Size.
X * 0.5 ) ) - ( NewChildSize.
X * 0.5 );
142 Ret = ( NewSelfRect.
Position.
Y + ( NewSelfRect.
Size.
Y * 0.5 ) ) - ( NewChildSize.
Y * 0.5 );
200 default:
return OldSize.
X;
break;
214 default:
return OldSize.
Y;
break;
225 Real XChange = NewChildSize.
X / OldChildSize.
X;
226 Real YChange = NewChildSize.
Y / OldChildSize.
Y;
228 if( XChange > YChange ) {
230 NewChildSize.
Y = OldChildSize.
Y * XChange;
232 NewChildSize.
X = OldChildSize.
X * YChange;
233 }
else if( YChange > XChange ) {
235 NewChildSize.
X = OldChildSize.
X * YChange;
237 NewChildSize.
Y = OldChildSize.
Y * XChange;
249 NewChildSize.
X = std::max(NewChildSize.
X,TempVec.
X);
250 NewChildSize.
Y = std::max(NewChildSize.
Y,TempVec.
Y);
261 NewChildSize.
X = std::min(NewChildSize.
X,TempVec.
X);
262 NewChildSize.
Y = std::min(NewChildSize.
Y,TempVec.
Y);