1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 15:39:02 +00:00
OpenMW/apps/openmw/mwgui/window_base.cpp

25 lines
590 B
C++
Raw Normal View History

2010-11-06 10:25:16 +00:00
#include "window_base.hpp"
#include "window_manager.hpp"
using namespace MWGui;
WindowBase::WindowBase(const std::string& parLayout, WindowManager& parWindowManager)
2010-11-06 10:25:16 +00:00
: Layout(parLayout)
, mWindowManager(parWindowManager)
2010-11-06 10:25:16 +00:00
{
}
void WindowBase::open()
{
}
void WindowBase::center()
{
// Centre dialog
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);
}