|
|
@ -2,6 +2,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
using namespace MWGui;
|
|
|
|
using namespace MWGui;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MessageBoxManager::MessageBoxManager (WindowManager *windowManager)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mWindowManager = windowManager;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MessageBoxManager::createMessageBox (const std::string& message)
|
|
|
|
void MessageBoxManager::createMessageBox (const std::string& message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::cout << "create non-interactive message box" << std::endl;
|
|
|
|
std::cout << "create non-interactive message box" << std::endl;
|
|
|
@ -20,4 +25,24 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
|
|
|
|
, mMessageBoxManager(parMessageBoxManager)
|
|
|
|
, mMessageBoxManager(parMessageBoxManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
setText("message", message);
|
|
|
|
setText("message", message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MyGUI::WidgetPtr messageWidget;
|
|
|
|
|
|
|
|
getWidget(messageWidget, "message");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MyGUI::IntSize size = messageWidget->_getTextSize();
|
|
|
|
|
|
|
|
size.width += 20;
|
|
|
|
|
|
|
|
size.height += 20;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
|
|
|
|
|
|
|
|
MyGUI::IntCoord coord;
|
|
|
|
|
|
|
|
coord.left = (gameWindowSize.width - size.width)/2;
|
|
|
|
|
|
|
|
coord.top = (gameWindowSize.height - size.height);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::cout << "Setting MainWidget to position (" << coord.left << "|" << coord.top
|
|
|
|
|
|
|
|
<< ") and size to (" << size.width << "|" << size.height << ")" << std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mMainWidget->setCoord(coord);
|
|
|
|
|
|
|
|
mMainWidget->setSize(size);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|