forked from mirror/openmw-tes3mp
Make TextInputDialog use the new WindowBase
This commit is contained in:
parent
e551c60e75
commit
5db021e99b
2 changed files with 4 additions and 11 deletions
|
@ -6,15 +6,10 @@
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
TextInputDialog::TextInputDialog(MWWorld::Environment& environment)
|
TextInputDialog::TextInputDialog(MWWorld::Environment& environment)
|
||||||
: Layout("openmw_text_input_layout.xml")
|
: WindowBase("openmw_text_input_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(textEdit, "TextEdit");
|
getWidget(textEdit, "TextEdit");
|
||||||
textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
|
textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef MWGUI_TEXT_INPUT_H
|
#ifndef MWGUI_TEXT_INPUT_H
|
||||||
#define MWGUI_TEXT_INPUT_H
|
#define MWGUI_TEXT_INPUT_H
|
||||||
|
|
||||||
#include <openengine/gui/layout.hpp>
|
#include "window_base.hpp"
|
||||||
|
|
||||||
namespace MWWorld
|
namespace MWWorld
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
using namespace MyGUI;
|
using namespace MyGUI;
|
||||||
|
|
||||||
class TextInputDialog : public OEngine::GUI::Layout
|
class TextInputDialog : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TextInputDialog(MWWorld::Environment& environment);
|
TextInputDialog(MWWorld::Environment& environment);
|
||||||
|
@ -40,8 +40,6 @@ namespace MWGui
|
||||||
void onTextAccepted(MyGUI::Edit* _sender);
|
void onTextAccepted(MyGUI::Edit* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MWWorld::Environment& environment;
|
|
||||||
|
|
||||||
MyGUI::EditPtr textEdit;
|
MyGUI::EditPtr textEdit;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue