2010-11-06 10:25:16 +00:00
|
|
|
#include "window_base.hpp"
|
|
|
|
#include "window_manager.hpp"
|
|
|
|
|
|
|
|
using namespace MWGui;
|
|
|
|
|
2011-02-21 19:36:35 +00:00
|
|
|
WindowBase::WindowBase(const std::string& parLayout, WindowManager& parWindowManager)
|
2010-11-06 10:25:16 +00:00
|
|
|
: Layout(parLayout)
|
2011-02-21 19:36:35 +00:00
|
|
|
, mWindowManager(parWindowManager)
|
2010-11-06 10:25:16 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WindowBase::open()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WindowBase::center()
|
|
|
|
{
|
|
|
|
// Centre dialog
|
2011-02-21 19:36:35 +00:00
|
|
|
MyGUI::IntSize gameWindowSize = mWindowManager.getGui()->getViewSize();
|
2010-11-06 10:25:16 +00:00
|
|
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
|
|
|
coord.left = (gameWindowSize.width - coord.width)/2;
|
|
|
|
coord.top = (gameWindowSize.height - coord.height)/2;
|
|
|
|
mMainWidget->setCoord(coord);
|
|
|
|
}
|