summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:30:44 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:30:44 +0000
commit5cb174c6b86c58b2ff6ec0d245e546328fae6480 (patch)
tree3daf547fa10b3e701086c7e0546cded7e6261bbb /src/dock_gui.cpp
parent62913838237c474419c68124ea7aebd74e72c628 (diff)
downloadopenttd-5cb174c6b86c58b2ff6ec0d245e546328fae6480.tar.xz
(svn r25412) -Codechange: Make use of Window::OnHotkey
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index 19b8f1bc1..c25bca0e3 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -164,14 +164,6 @@ struct BuildDocksToolbarWindow : Window {
this->last_clicked_widget = (DockToolbarWidgets)widget;
}
- virtual EventState OnKeyPress(uint16 key, uint16 keycode)
- {
- int num = this->hotkeys.CheckMatch(keycode);
- if (num == -1) return ES_NOT_HANDLED;
- this->OnClick(Point(), num, 1);
- return ES_HANDLED;
- }
-
virtual void OnPlaceObject(Point pt, TileIndex tile)
{
switch (this->last_clicked_widget) {
@@ -318,7 +310,8 @@ static WindowDesc _build_docks_toolbar_desc(
WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0,
WC_BUILD_TOOLBAR, WC_NONE,
WDF_CONSTRUCTION,
- _nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets)
+ _nested_build_docks_toolbar_widgets, lengthof(_nested_build_docks_toolbar_widgets),
+ &BuildDocksToolbarWindow::hotkeys
);
/**
@@ -342,7 +335,7 @@ EventState DockToolbarGlobalHotkeys(uint16 key, uint16 keycode)
if (num == -1) return ES_NOT_HANDLED;
Window *w = ShowBuildDocksToolbar();
if (w == NULL) return ES_NOT_HANDLED;
- return w->OnKeyPress(key, keycode);
+ return w->OnHotkey(num);
}
/**