@ -171,9 +171,11 @@ namespace Gui
total_width + = mSpacing ;
total_width + = mSpacing ;
}
}
if ( mAutoResize & & ( total_width + mPadding * 2 ! = get Size ( ) . width | | total_height + mPadding * 2 ! = get Size ( ) . height ) )
if ( mAutoResize & & ( total_width + mPadding * 2 ! = get ClientCoord ( ) . width | | total_height + mPadding * 2 ! = get ClientCoord ( ) . height ) )
{
{
setSize ( MyGUI : : IntSize ( total_width + mPadding * 2 , total_height + mPadding * 2 ) ) ;
int xmargin = getSize ( ) . width - getClientCoord ( ) . width ;
int ymargin = getSize ( ) . height - getClientCoord ( ) . height ;
setSize ( MyGUI : : IntSize ( total_width + mPadding * 2 + xmargin , total_height + mPadding * 2 + ymargin ) ) ;
return ;
return ;
}
}
@ -191,19 +193,19 @@ namespace Gui
continue ;
continue ;
bool vstretch = w - > getUserString ( " VStretch " ) = = " true " ;
bool vstretch = w - > getUserString ( " VStretch " ) = = " true " ;
int max_height = get Size ( ) . height - mPadding * 2 ;
int max_height = get ClientCoord ( ) . height - mPadding * 2 ;
int height = vstretch ? max_height : sizes [ i ] . first . height ;
int height = vstretch ? max_height : sizes [ i ] . first . height ;
MyGUI : : IntCoord widgetCoord ;
MyGUI : : IntCoord widgetCoord ;
widgetCoord . left = curX ;
widgetCoord . left = curX ;
widgetCoord . top = mPadding + ( get Size ( ) . height - mPadding * 2 - height ) / 2 ;
widgetCoord . top = mPadding + ( get ClientCoord ( ) . height - mPadding * 2 - height ) / 2 ;
int width = 0 ;
int width = 0 ;
if ( sizes [ i ] . second )
if ( sizes [ i ] . second )
{
{
if ( h_stretched_count = = 0 )
if ( h_stretched_count = = 0 )
throw std : : logic_error ( " unexpected " ) ;
throw std : : logic_error ( " unexpected " ) ;
width = sizes [ i ] . first . width + ( get Size ( ) . width - mPadding * 2 - total_width ) / h_stretched_count ;
width = sizes [ i ] . first . width + ( get ClientCoord ( ) . width - mPadding * 2 - total_width ) / h_stretched_count ;
}
}
else
else
width = sizes [ i ] . first . width ;
width = sizes [ i ] . first . width ;
@ -317,13 +319,14 @@ namespace Gui
total_height + = mSpacing ;
total_height + = mSpacing ;
}
}
if ( mAutoResize & & ( total_width + mPadding * 2 ! = get Size ( ) . width | | total_height + mPadding * 2 ! = get Size ( ) . height ) )
if ( mAutoResize & & ( total_width + mPadding * 2 ! = get ClientCoord ( ) . width | | total_height + mPadding * 2 ! = get ClientCoord ( ) . height ) )
{
{
setSize ( MyGUI : : IntSize ( total_width + mPadding * 2 , total_height + mPadding * 2 ) ) ;
int xmargin = getSize ( ) . width - getClientCoord ( ) . width ;
int ymargin = getSize ( ) . height - getClientCoord ( ) . height ;
setSize ( MyGUI : : IntSize ( total_width + mPadding * 2 + xmargin , total_height + mPadding * 2 + ymargin ) ) ;
return ;
return ;
}
}
int curY = 0 ;
int curY = 0 ;
for ( unsigned int i = 0 ; i < count ; + + i )
for ( unsigned int i = 0 ; i < count ; + + i )
{
{
@ -337,19 +340,19 @@ namespace Gui
continue ;
continue ;
bool hstretch = w - > getUserString ( " HStretch " ) = = " true " ;
bool hstretch = w - > getUserString ( " HStretch " ) = = " true " ;
int maxWidth = get Size ( ) . width - mPadding * 2 ;
int maxWidth = get ClientCoord ( ) . width - mPadding * 2 ;
int width = hstretch ? maxWidth : sizes [ i ] . first . width ;
int width = hstretch ? maxWidth : sizes [ i ] . first . width ;
MyGUI : : IntCoord widgetCoord ;
MyGUI : : IntCoord widgetCoord ;
widgetCoord . top = curY ;
widgetCoord . top = curY ;
widgetCoord . left = mPadding + ( get Size ( ) . width - mPadding * 2 - width ) / 2 ;
widgetCoord . left = mPadding + ( get ClientCoord ( ) . width - mPadding * 2 - width ) / 2 ;
int height = 0 ;
int height = 0 ;
if ( sizes [ i ] . second )
if ( sizes [ i ] . second )
{
{
if ( v_stretched_count = = 0 )
if ( v_stretched_count = = 0 )
throw std : : logic_error ( " unexpected " ) ;
throw std : : logic_error ( " unexpected " ) ;
height = sizes [ i ] . first . height + ( get Size ( ) . height - mPadding * 2 - total_height ) / v_stretched_count ;
height = sizes [ i ] . first . height + ( get ClientCoord ( ) . height - mPadding * 2 - total_height ) / v_stretched_count ;
}
}
else
else
height = sizes [ i ] . first . height ;
height = sizes [ i ] . first . height ;