summaryrefslogtreecommitdiff
path: root/src/network
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/network
parent7699a7dc06049956b90d3f41a14109ee05b97514 (diff)
downloadopenttd-c4d7c8dd427287d42374b5a83842f570642b100c.tar.xz
(svn r24733) -Codechange: Move handling of editbox keys to window class.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_chat_gui.cpp8
-rw-r--r--src/network/network_content_gui.cpp8
-rw-r--r--src/network/network_gui.cpp28
3 files changed, 13 insertions, 31 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index 0cd9c0558..af2357dc1 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -510,13 +510,15 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
if (keycode == WKC_TAB) {
ChatTabCompletion();
state = ES_HANDLED;
- } else {
- _chat_tab_completion_active = false;
- this->HandleEditBoxKey(WID_NC_TEXTBOX, key, keycode, state);
}
return state;
}
+ virtual void OnOSKInput(int wid)
+ {
+ _chat_tab_completion_active = false;
+ }
+
/**
* Some data on this window has become invalid.
* @param data Information about the changed data.
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index 995f40ddf..2262a09fb 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -763,12 +763,8 @@ public:
}
/* FALL THROUGH, space is pressed and filter isn't focused. */
- default: {
- /* Handle editbox input */
- EventState state = ES_NOT_HANDLED;
- this->HandleEditBoxKey(WID_NCL_FILTER, key, keycode, state);
- return state;
- }
+ default:
+ return ES_NOT_HANDLED;
}
if (_network_content_client.Length() == 0) return ES_HANDLED;
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 7b4735629..a3b5726d8 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -835,14 +835,12 @@ public:
return ES_HANDLED;
}
- if (this->HandleEditBoxKey(WID_NG_CLIENT, key, keycode, state) == HEBR_NOT_FOCUSED) {
- if (this->server != NULL) {
- if (keycode == WKC_DELETE) { // Press 'delete' to remove servers
- NetworkGameListRemoveItem(this->server);
- if (this->server == this->last_joined) this->last_joined = NULL;
- this->server = NULL;
- this->list_pos = SLP_INVALID;
- }
+ if (this->server != NULL) {
+ if (keycode == WKC_DELETE) { // Press 'delete' to remove servers
+ NetworkGameListRemoveItem(this->server);
+ if (this->server == this->last_joined) this->last_joined = NULL;
+ this->server = NULL;
+ this->list_pos = SLP_INVALID;
}
}
@@ -1172,13 +1170,6 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow {
this->SetDirty();
}
- virtual EventState OnKeyPress(uint16 key, uint16 keycode)
- {
- EventState state = ES_NOT_HANDLED;
- this->HandleEditBoxKey(WID_NSS_GAMENAME, key, keycode, state);
- return state;
- }
-
virtual void OnOSKInput(int wid)
{
if (wid == WID_NSS_GAMENAME) {
@@ -2151,13 +2142,6 @@ struct NetworkCompanyPasswordWindow : public QueryStringBaseWindow {
break;
}
}
-
- virtual EventState OnKeyPress(uint16 key, uint16 keycode)
- {
- EventState state = ES_NOT_HANDLED;
- this->HandleEditBoxKey(WID_NCP_PASSWORD, key, keycode, state);
- return state;
- }
};
static const NWidgetPart _nested_network_company_password_window_widgets[] = {