Make TextInputDialog use the new WindowBase

This commit is contained in:
Jan-Peter Nilsson 2010-11-06 11:27:53 +01:00
parent e551c60e75
commit 5db021e99b
2 changed files with 4 additions and 11 deletions

View file

@ -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);

View file

@ -1,7 +1,7 @@
#ifndef MWGUI_TEXT_INPUT_H
#define MWGUI_TEXT_INPUT_H
#include <openengine/gui/layout.hpp>
#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;
};
}