summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:42 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:42 +0000
commitc8c040d0577597c7cd849db06535942d454ebc96 (patch)
treed96f7d16a16500c2a5c09982f65731251f0c6ee8 /src/window.cpp
parentc283a412485700ab8e81a374f080c1ef94fbf64d (diff)
downloadopenttd-c8c040d0577597c7cd849db06535942d454ebc96.tar.xz
(svn r24744) -Codechange: Handle clicking on editboxed also via QueryString.
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 088233fc0..62109e82c 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -463,20 +463,19 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
if ((widget_type & ~WWB_PUSHBUTTON) < WWT_LAST && (widget_type & WWB_PUSHBUTTON)) w->HandleButtonClick(widget_index);
+ Point pt = { x, y };
+
switch (widget_type) {
case NWID_VSCROLLBAR:
case NWID_HSCROLLBAR:
ScrollbarClickHandler(w, nw, x, y);
break;
- case WWT_EDITBOX:
- if (!focused_widget_changed) { // Only open the OSK window if clicking on an already focused edit box
- /* Open the OSK window if clicked on an edit box */
- if (w->querystrings.Contains(widget_index)) {
- ShowOnScreenKeyboard(w, widget_index);
- }
- }
+ case WWT_EDITBOX: {
+ QueryString *query = w->GetQueryString(widget_index);
+ if (query != NULL) query->ClickEditBox(w, pt, widget_index, click_count, focused_widget_changed);
break;
+ }
case WWT_CLOSEBOX: // 'X'
delete w;
@@ -520,7 +519,6 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count)
Game::NewEvent(new ScriptEventWindowWidgetClick((ScriptWindow::WindowClass)w->window_class, w->window_number, widget_index));
}
- Point pt = { x, y };
w->OnClick(pt, widget_index, click_count);
}