diff options
Diffstat (limited to 'src/gui/textdialog.cpp')
-rw-r--r-- | src/gui/textdialog.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/textdialog.cpp b/src/gui/textdialog.cpp index 6faa1162..28792a0b 100644 --- a/src/gui/textdialog.cpp +++ b/src/gui/textdialog.cpp @@ -30,14 +30,18 @@ int TextDialog::instances = 0; TextDialog::TextDialog(const std::string &title, const std::string &msg, - Window *parent): - Window(title, true, parent), - mTextField(new TextField) + Window *parent, bool autoCompleteEnabled): + Window(title, true, parent) { gcn::Label *textLabel = new Label(msg); mOkButton = new Button(_("OK"), "OK", this); gcn::Button *cancelButton = new Button(_("Cancel"), "CANCEL", this); + // In TextField the escape key will either cause autoComplete or lose focus + mTextField = new TextField("", ! autoCompleteEnabled); + if (autoCompleteEnabled) + mTextField->setAutoComplete(true); + mTextField->addActionListener(this); place(0, 0, textLabel, 4); |