summaryrefslogtreecommitdiff
path: root/src/signs_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:28:09 +0000
commit1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c (patch)
tree555791c9e1370b2caba036286b98f64efe970bd3 /src/signs_gui.cpp
parent40c2864e4dd478693ef6c108cc95cd2e6b5e70d0 (diff)
downloadopenttd-1b8b1f3f6cbd65b73399b1d39aacb7fb674a091c.tar.xz
(svn r25410) -Codechange: Put all hotkeys of a window into a static HotkeyList member.
Diffstat (limited to 'src/signs_gui.cpp')
-rw-r--r--src/signs_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 433165f3d..7e4cdfba4 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -284,7 +284,7 @@ struct SignListWindow : Window, SignList {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
EventState state = ES_NOT_HANDLED;
- if (CheckHotkeyMatch(signlist_hotkeys, keycode) == SLHK_FOCUS_FILTER_BOX) {
+ if (this->hotkeys.CheckMatch(keycode) == SLHK_FOCUS_FILTER_BOX) {
this->SetFocusedWidget(WID_SIL_FILTER_TEXT);
SetFocusedWindow(this); // The user has asked to give focus to the text box, so make sure this window is focused.
state = ES_HANDLED;
@@ -332,14 +332,14 @@ struct SignListWindow : Window, SignList {
}
}
- static Hotkey signlist_hotkeys[];
+ static HotkeyList hotkeys;
};
-Hotkey SignListWindow::signlist_hotkeys[] = {
+static Hotkey signlist_hotkeys[] = {
Hotkey('F', "focus_filter_box", SLHK_FOCUS_FILTER_BOX),
HOTKEY_LIST_END
};
-Hotkey *_signlist_hotkeys = SignListWindow::signlist_hotkeys;
+HotkeyList SignListWindow::hotkeys("signlist", signlist_hotkeys);
static const NWidgetPart _nested_sign_list_widgets[] = {
NWidget(NWID_HORIZONTAL),
@@ -389,7 +389,7 @@ Window *ShowSignList()
EventState SignListGlobalHotkeys(uint16 key, uint16 keycode)
{
- int num = CheckHotkeyMatch(_signlist_hotkeys, keycode, true);
+ int num = SignListWindow::hotkeys.CheckMatch(keycode, true);
if (num == -1) return ES_NOT_HANDLED;
Window *w = ShowSignList();
if (w == NULL) return ES_NOT_HANDLED;