Make BirthDialog use the new WindowBase

This commit is contained in:
Jan-Peter Nilsson 2010-11-06 11:26:17 +01:00
parent 6bf10c93c8
commit 933af72d60
2 changed files with 4 additions and 11 deletions

View file

@ -12,15 +12,10 @@ using namespace MWGui;
using namespace Widgets; using namespace Widgets;
BirthDialog::BirthDialog(MWWorld::Environment& environment) BirthDialog::BirthDialog(MWWorld::Environment& environment)
: Layout("openmw_chargen_birth_layout.xml") : WindowBase("openmw_chargen_birth_layout.xml", environment)
, environment(environment)
{ {
// Centre dialog // Centre dialog
MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize(); center();
MyGUI::IntCoord coord = mMainWidget->getCoord();
coord.left = (gameWindowSize.width - coord.width)/2;
coord.top = (gameWindowSize.height - coord.height)/2;
mMainWidget->setCoord(coord);
getWidget(spellArea, "SpellArea"); getWidget(spellArea, "SpellArea");

View file

@ -1,7 +1,7 @@
#ifndef MWGUI_BIRTH_H #ifndef MWGUI_BIRTH_H
#define MWGUI_BIRTH_H #define MWGUI_BIRTH_H
#include <openengine/gui/layout.hpp> #include "window_base.hpp"
namespace MWWorld namespace MWWorld
{ {
@ -17,7 +17,7 @@ namespace MWGui
{ {
using namespace MyGUI; using namespace MyGUI;
class BirthDialog : public OEngine::GUI::Layout class BirthDialog : public WindowBase
{ {
public: public:
BirthDialog(MWWorld::Environment& environment); BirthDialog(MWWorld::Environment& environment);
@ -57,8 +57,6 @@ namespace MWGui
void updateBirths(); void updateBirths();
void updateSpells(); void updateSpells();
MWWorld::Environment& environment;
MyGUI::ListPtr birthList; MyGUI::ListPtr birthList;
MyGUI::WidgetPtr spellArea; MyGUI::WidgetPtr spellArea;
MyGUI::StaticImagePtr birthImage; MyGUI::StaticImagePtr birthImage;