diff --git a/apps/openmw/mwgui/text_input.cpp b/apps/openmw/mwgui/text_input.cpp index b81b00c93..472c8d0df 100644 --- a/apps/openmw/mwgui/text_input.cpp +++ b/apps/openmw/mwgui/text_input.cpp @@ -47,6 +47,13 @@ void TextInputDialog::setTextLabel(const std::string &label) setText("LabelT", label); } +void TextInputDialog::open() +{ + // Make sure the edit box has focus + MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit); + setVisible(true); +} + // widget controls void TextInputDialog::onOkClicked(MyGUI::Widget* _sender) diff --git a/apps/openmw/mwgui/text_input.hpp b/apps/openmw/mwgui/text_input.hpp index eac6495ea..801626c58 100644 --- a/apps/openmw/mwgui/text_input.hpp +++ b/apps/openmw/mwgui/text_input.hpp @@ -25,6 +25,7 @@ namespace MWGui void setNextButtonShow(bool shown); void setTextLabel(const std::string &label); + void open(); // Events typedef delegates::CDelegate0 EventHandle_Void; diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 044198152..1992b0a28 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -107,7 +107,7 @@ void WindowManager::updateVisible() nameDialog->setTextLabel(sName); nameDialog->setNextButtonShow(nameChosen); nameDialog->eventDone = MyGUI::newDelegate(this, &WindowManager::onNameDialogDone); - nameDialog->setVisible(true); + nameDialog->open(); return; }