diff --git a/apps/openmw/mwgui/text_input.cpp b/apps/openmw/mwgui/text_input.cpp index e1fc216c9..3758e75e6 100644 --- a/apps/openmw/mwgui/text_input.cpp +++ b/apps/openmw/mwgui/text_input.cpp @@ -6,15 +6,10 @@ using namespace MWGui; TextInputDialog::TextInputDialog(MWWorld::Environment& environment) - : Layout("openmw_text_input_layout.xml") - , environment(environment) + : WindowBase("openmw_text_input_layout.xml", environment) { // Centre dialog - MyGUI::IntSize gameWindowSize = environment.mWindowManager->getGui()->getViewSize(); - MyGUI::IntCoord coord = mMainWidget->getCoord(); - coord.left = (gameWindowSize.width - coord.width)/2; - coord.top = (gameWindowSize.height - coord.height)/2; - mMainWidget->setCoord(coord); + center(); getWidget(textEdit, "TextEdit"); textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted); diff --git a/apps/openmw/mwgui/text_input.hpp b/apps/openmw/mwgui/text_input.hpp index 5a38e9b46..9ca55715b 100644 --- a/apps/openmw/mwgui/text_input.hpp +++ b/apps/openmw/mwgui/text_input.hpp @@ -1,7 +1,7 @@ #ifndef MWGUI_TEXT_INPUT_H #define MWGUI_TEXT_INPUT_H -#include +#include "window_base.hpp" namespace MWWorld { @@ -15,7 +15,7 @@ namespace MWGui { using namespace MyGUI; - class TextInputDialog : public OEngine::GUI::Layout + class TextInputDialog : public WindowBase { public: TextInputDialog(MWWorld::Environment& environment); @@ -40,8 +40,6 @@ namespace MWGui void onTextAccepted(MyGUI::Edit* _sender); private: - MWWorld::Environment& environment; - MyGUI::EditPtr textEdit; }; }