From 1071d51508695978adcf9a184e0a26a65fff2705 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 13 Nov 2012 21:46:37 +0000 Subject: (svn r24727) -Fix: In various windows the OSK looked shiny but using it had no effect whatsoever. --- src/ai/ai_gui.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/ai/ai_gui.cpp') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index a1c0616c2..98feba077 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -1342,9 +1342,7 @@ struct AIDebugWindow : public QueryStringBaseWindow { EventState state = ES_NOT_HANDLED; switch (this->HandleEditBoxKey(WID_AID_BREAK_STR_EDIT_BOX, key, keycode, state)) { case HEBR_EDITING: - /* Save the current string to static member so it can be restored next time the window is opened. */ - strecpy(this->break_string, this->edit_str_buf, lastof(this->break_string)); - break_string_filter.SetFilterTerm(this->break_string); + this->OnOSKInput(WID_AID_BREAK_STR_EDIT_BOX); break; case HEBR_CANCEL: @@ -1373,6 +1371,15 @@ struct AIDebugWindow : public QueryStringBaseWindow { return state; } + virtual void OnOSKInput(int wid) + { + if (wid == WID_AID_BREAK_STR_EDIT_BOX) { + /* Save the current string to static member so it can be restored next time the window is opened. */ + strecpy(this->break_string, this->edit_str_buf, lastof(this->break_string)); + break_string_filter.SetFilterTerm(this->break_string); + } + } + /** * Some data on this window has become invalid. * @param data Information about the changed data. -- cgit v1.2.3-54-g00ecf