|
|
|
@ -232,54 +232,6 @@ namespace MWGui
|
|
|
|
|
buttonsWidth += buttonLeftPadding;
|
|
|
|
|
|
|
|
|
|
MyGUI::IntSize mainWidgetSize;
|
|
|
|
|
if(buttonsWidth < fixedWidth)
|
|
|
|
|
{
|
|
|
|
|
// on one line
|
|
|
|
|
if(textSize.width + 2*textPadding < buttonsWidth)
|
|
|
|
|
{
|
|
|
|
|
mainWidgetSize.width = buttonsWidth;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
mainWidgetSize.width = textSize.width + 3*textPadding;
|
|
|
|
|
}
|
|
|
|
|
mainWidgetSize.height = textSize.height + textButtonPadding + buttonHeight + buttonMainPadding;
|
|
|
|
|
|
|
|
|
|
MyGUI::IntPoint absPos;
|
|
|
|
|
absPos.left = (gameWindowSize.width - mainWidgetSize.width)/2;
|
|
|
|
|
absPos.top = (gameWindowSize.height - mainWidgetSize.height)/2;
|
|
|
|
|
|
|
|
|
|
mMainWidget->setPosition(absPos);
|
|
|
|
|
mMainWidget->setSize(mainWidgetSize);
|
|
|
|
|
|
|
|
|
|
MyGUI::IntCoord messageWidgetCoord;
|
|
|
|
|
messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
|
|
|
|
|
messageWidgetCoord.top = textPadding;
|
|
|
|
|
mMessageWidget->setCoord(messageWidgetCoord);
|
|
|
|
|
|
|
|
|
|
mMessageWidget->setSize(textSize);
|
|
|
|
|
|
|
|
|
|
MyGUI::IntCoord buttonCord;
|
|
|
|
|
MyGUI::IntSize buttonSize(0, buttonHeight);
|
|
|
|
|
int left = (mainWidgetSize.width - buttonsWidth)/2 + buttonPadding;
|
|
|
|
|
|
|
|
|
|
std::vector<MyGUI::Button*>::const_iterator button;
|
|
|
|
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
|
|
|
|
{
|
|
|
|
|
buttonCord.left = left;
|
|
|
|
|
buttonCord.top = textSize.height + textButtonPadding;
|
|
|
|
|
|
|
|
|
|
buttonSize.width = (*button)->getTextSize().width + 2*buttonPadding;
|
|
|
|
|
buttonSize.height = (*button)->getTextSize().height + 2*buttonPadding;
|
|
|
|
|
|
|
|
|
|
(*button)->setCoord(buttonCord);
|
|
|
|
|
(*button)->setSize(buttonSize);
|
|
|
|
|
|
|
|
|
|
left += buttonSize.width + buttonLeftPadding;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// among each other
|
|
|
|
|
if(biggestButtonWidth > textSize.width) {
|
|
|
|
|
mainWidgetSize.width = biggestButtonWidth + buttonTopPadding;
|
|
|
|
@ -323,11 +275,9 @@ namespace MWGui
|
|
|
|
|
messageWidgetCoord.width = textSize.width;
|
|
|
|
|
messageWidgetCoord.height = textSize.height;
|
|
|
|
|
mMessageWidget->setCoord(messageWidgetCoord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Set key focus to "Ok" button
|
|
|
|
|
std::string ok = Misc::StringUtils::lowerCase(MyGUI::LanguageManager::getInstance().replaceTags("#{sOK}"));
|
|
|
|
|
std::vector<MyGUI::Button*>::const_iterator button;
|
|
|
|
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
|
|
|
|
{
|
|
|
|
|
if(Misc::StringUtils::ciEqual((*button)->getCaption(), ok))
|
|
|
|
|