2010-09-14 21:17:08 +00:00
|
|
|
#ifndef MWGUI_TEXT_INPUT_H
|
|
|
|
#define MWGUI_TEXT_INPUT_H
|
|
|
|
|
2010-11-06 10:27:53 +00:00
|
|
|
#include "window_base.hpp"
|
2010-09-14 21:17:08 +00:00
|
|
|
|
2011-02-21 19:36:35 +00:00
|
|
|
namespace MWGui
|
2010-09-14 21:17:08 +00:00
|
|
|
{
|
2011-02-21 19:36:35 +00:00
|
|
|
class WindowManager;
|
2010-09-14 21:17:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
|
|
|
using namespace MyGUI;
|
|
|
|
|
2010-11-06 10:27:53 +00:00
|
|
|
class TextInputDialog : public WindowBase
|
2010-09-14 21:17:08 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-02-21 19:36:35 +00:00
|
|
|
TextInputDialog(WindowManager& parWindowManager);
|
2010-09-14 21:17:08 +00:00
|
|
|
|
|
|
|
std::string getTextInput() const { return textEdit ? textEdit->getOnlyText() : ""; }
|
|
|
|
void setTextInput(const std::string &text) { if (textEdit) textEdit->setOnlyText(text); }
|
|
|
|
|
2010-09-15 17:37:06 +00:00
|
|
|
void setNextButtonShow(bool shown);
|
|
|
|
void setTextLabel(const std::string &label);
|
2010-09-15 17:48:37 +00:00
|
|
|
void open();
|
2010-09-15 17:37:06 +00:00
|
|
|
|
2010-09-14 21:17:08 +00:00
|
|
|
protected:
|
|
|
|
void onOkClicked(MyGUI::Widget* _sender);
|
|
|
|
void onTextAccepted(MyGUI::Edit* _sender);
|
|
|
|
|
|
|
|
private:
|
|
|
|
MyGUI::EditPtr textEdit;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|