summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-05-28 15:28:27 +0000
committersmatz <smatz@openttd.org>2008-05-28 15:28:27 +0000
commitf7233786d2bd7211421c76cbfdbc269eb1c44566 (patch)
treeff3f7bc2a7c47e268c3a4f05feffa64a42242f99 /src
parent17ccd5ec655d6a6632f6191be59efaf1c0ef54a4 (diff)
downloadopenttd-f7233786d2bd7211421c76cbfdbc269eb1c44566.tar.xz
(svn r13310) -Fix: invalidate OSK when parent editbox changes (from keyboard)
Diffstat (limited to 'src')
-rw-r--r--src/misc_gui.cpp5
-rw-r--r--src/osk_gui.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 24829904c..c28f7ee20 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1083,6 +1083,11 @@ struct QueryStringWindow : public QueryStringBaseWindow
{
EventState state;
switch (this->HandleEditBoxKey(QUERY_STR_WIDGET_TEXT, key, keycode, state)) {
+ default: NOT_REACHED();
+ case 0: {
+ Window *osk = FindWindowById(WC_OSK, 0);
+ if (osk != NULL && osk->parent == this) osk->OnInvalidateData();
+ } break;
case 1: this->OnOk(); // Enter pressed, confirms change
/* FALL THROUGH */
case 2: delete this; break; // ESC pressed, closes window, abandons changes
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp
index bd7bc16bd..2f1bc41ea 100644
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -203,6 +203,11 @@ struct OskWindow : public Window {
/* make the caret of the parent window also blink */
this->parent->InvalidateWidget(this->text_btn);
}
+
+ virtual void OnInvalidateData(int)
+ {
+ this->InvalidateWidget(OSK_WIDGET_TEXT);
+ }
};
static const Widget _osk_widgets[] = {