summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-13 21:47:02 +0000
committerfrosch <frosch@openttd.org>2012-11-13 21:47:02 +0000
commitc4d7c8dd427287d42374b5a83842f570642b100c (patch)
tree2f27364c8fa88537277244fade47f87bcbe4b6fd /src/misc_gui.cpp
parent7699a7dc06049956b90d3f41a14109ee05b97514 (diff)
downloadopenttd-c4d7c8dd427287d42374b5a83842f570642b100c.tar.xz
(svn r24733) -Codechange: Move handling of editbox keys to window class.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 868c105a9..4d43db770 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -811,10 +811,10 @@ void QueryString::DrawEditBox(const Window *w, int wid) const
_cur_dpi = old_dpi;
}
-HandleEditBoxResult QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key, uint16 keycode, EventState &state)
+EventState QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key, uint16 keycode)
{
- HandleEditBoxResult result = this->QueryString::HandleEditBoxKey(this, wid, key, keycode, state);
- switch (result) {
+ EventState state = ES_NOT_HANDLED;
+ switch (this->QueryString::HandleEditBoxKey(this, wid, key, keycode, state)) {
case HEBR_EDITING:
this->OnOSKInput(wid);
break;
@@ -835,7 +835,7 @@ HandleEditBoxResult QueryStringBaseWindow::HandleEditBoxKey(int wid, uint16 key,
default: break;
}
- return result;
+ return state;
}
/** Class for the string query window. */
@@ -916,13 +916,6 @@ struct QueryStringWindow : public QueryStringBaseWindow
}
}
- virtual EventState OnKeyPress(uint16 key, uint16 keycode)
- {
- EventState state = ES_NOT_HANDLED;
- this->HandleEditBoxKey(WID_QS_TEXT, key, keycode, state);
- return state;
- }
-
~QueryStringWindow()
{
if (!this->handled && this->parent != NULL) {