summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-03 13:59:05 +0000
committerrubidium <rubidium@openttd.org>2009-01-03 13:59:05 +0000
commite5c1a7b5c3afcdfd0671b6476055822eba665205 (patch)
treef69467d5bbbf0587e6289219150ab4a8313edf8c /src/window.cpp
parent0d54db5f9fb3a3987f908645ca9693684f34674b (diff)
downloadopenttd-e5c1a7b5c3afcdfd0671b6476055822eba665205.tar.xz
(svn r14804) -Codechange: unify opening the OSK (Zuu)
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 00b81c1d4..bf79b2b88 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -24,6 +24,7 @@
#include "window_func.h"
#include "tilehighlight_func.h"
#include "network/network.h"
+#include "querystring_gui.h"
#include "table/sprites.h"
@@ -184,6 +185,13 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, bool double_click)
}
} else if (wi->type == WWT_SCROLLBAR || wi->type == WWT_SCROLL2BAR || wi->type == WWT_HSCROLLBAR) {
ScrollbarClickHandler(w, wi, x, y);
+ } else if (wi->type == WWT_EDITBOX) {
+ /* Open the OSK window if clicked on an edit box */
+ QueryStringBaseWindow *qs = dynamic_cast<QueryStringBaseWindow*>(w);
+ if (qs != NULL) {
+ const int widget_index = wi - w->widget;
+ qs->OnOpenOSKWindow(widget_index);
+ }
}
if (w->desc_flags & WDF_STD_BTN) {