@ -146,8 +146,14 @@ void MessageBox::ApplySchemeSettings(IScheme *pScheme)
@@ -146,8 +146,14 @@ void MessageBox::ApplySchemeSettings(IScheme *pScheme)
m_pMessageLabel - > GetContentSize ( wide , tall ) ;
m_pMessageLabel - > SetSize ( wide , tall ) ;
wide + = 100 ;
tall + = 100 ;
int indent = 100 ;
if ( IsProportional ( ) )
{
indent = scheme ( ) - > GetProportionalScaledValueEx ( GetScheme ( ) , 100 ) ;
}
wide + = indent ;
tall + = indent ;
SetSize ( wide , tall ) ;
if ( m_bShowMessageBoxOverCursor )
@ -255,10 +261,23 @@ void MessageBox::PerformLayout()
@@ -255,10 +261,23 @@ void MessageBox::PerformLayout()
int oldWide , oldTall ;
m_pOkButton - > GetSize ( oldWide , oldTall ) ;
// calc proportionality scale
float scale = 1 ;
if ( IsProportional ( ) )
{
int screenW , screenH ;
surface ( ) - > GetScreenSize ( screenW , screenH ) ;
int proW , proH ;
surface ( ) - > GetProportionalBase ( proW , proH ) ;
scale = ( ( float ) ( screenH ) / ( float ) ( proH ) ) ;
}
int btnWide , btnTall ;
m_pOkButton - > GetContentSize ( btnWide , btnTall ) ;
btnWide = max ( oldWide , btnWide + 10 ) ;
btnTall = max ( oldTall , btnTall + 10 ) ;
btnWide = max ( oldWide , btnWide + 10 * scale ) ;
btnTall = max ( oldTall , btnTall + 10 * scale ) ;
m_pOkButton - > SetSize ( btnWide , btnTall ) ;
int btnWide2 = 0 , btnTall2 = 0 ;
@ -267,26 +286,26 @@ void MessageBox::PerformLayout()
@@ -267,26 +286,26 @@ void MessageBox::PerformLayout()
m_pCancelButton - > GetSize ( oldWide , oldTall ) ;
m_pCancelButton - > GetContentSize ( btnWide2 , btnTall2 ) ;
btnWide2 = max ( oldWide , btnWide2 + 10 ) ;
btnTall2 = max ( oldTall , btnTall2 + 10 ) ;
m_pCancelButton - > SetSize ( btnWide2 , btnTall2 ) ;
btnWide2 = max ( oldWide , btnWide2 + 10 * scale ) ;
btnTall2 = max ( oldTall , btnTall2 + 10 * scale ) ;
m_pCancelButton - > SetSize ( btnWide2 , boxTall ) ;
}
boxWidth = max ( boxWidth , m_pMessageLabel - > GetWide ( ) + 100 ) ;
boxWidth = max ( boxWidth , ( btnWide + btnWide2 ) * 2 + 30 ) ;
boxWidth = max ( boxWidth , m_pMessageLabel - > GetWide ( ) + 100 * scale ) ;
boxWidth = max ( boxWidth , ( btnWide + btnWide2 ) * 2 + 30 * scale ) ;
SetSize ( boxWidth , boxTall ) ;
GetSize ( boxWidth , boxTall ) ;
m_pMessageLabel - > SetPos ( ( wide / 2 ) - ( m_pMessageLabel - > GetWide ( ) / 2 ) + x , y + 5 ) ;
m_pMessageLabel - > SetPos ( ( wide / 2 ) - ( m_pMessageLabel - > GetWide ( ) / 2 ) + x , y + 5 * scale ) ;
if ( ! m_pCancelButton - > IsVisible ( ) )
{
m_pOkButton - > SetPos ( ( wide / 2 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 ) ;
m_pOkButton - > SetPos ( ( wide / 2 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 * scale ) ;
}
else
{
m_pOkButton - > SetPos ( ( wide / 4 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 ) ;
m_pCancelButton - > SetPos ( ( 3 * wide / 4 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 ) ;
m_pOkButton - > SetPos ( ( wide / 4 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 * scale ) ;
m_pCancelButton - > SetPos ( ( 3 * wide / 4 ) - ( m_pOkButton - > GetWide ( ) / 2 ) + x , tall - m_pOkButton - > GetTall ( ) - 15 * scale ) ;
}
BaseClass : : PerformLayout ( ) ;