diff options
author | frosch <frosch@openttd.org> | 2013-06-15 15:30:44 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2013-06-15 15:30:44 +0000 |
commit | 5cb174c6b86c58b2ff6ec0d245e546328fae6480 (patch) | |
tree | 3daf547fa10b3e701086c7e0546cded7e6261bbb /src/airport_gui.cpp | |
parent | 62913838237c474419c68124ea7aebd74e72c628 (diff) | |
download | openttd-5cb174c6b86c58b2ff6ec0d245e546328fae6480.tar.xz |
(svn r25412) -Codechange: Make use of Window::OnHotkey
Diffstat (limited to 'src/airport_gui.cpp')
-rw-r--r-- | src/airport_gui.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 81c873ad1..e2fed7f9c 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -100,14 +100,6 @@ struct BuildAirToolbarWindow : Window { } - 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_user_action) { @@ -170,7 +162,8 @@ static WindowDesc _air_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, - _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets) + _nested_air_toolbar_widgets, lengthof(_nested_air_toolbar_widgets), + &BuildAirToolbarWindow::hotkeys ); /** @@ -195,7 +188,7 @@ EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode) if (num == -1) return ES_NOT_HANDLED; Window *w = ShowBuildAirToolbar(); if (w == NULL) return ES_NOT_HANDLED; - return w->OnKeyPress(key, keycode); + return w->OnHotkey(num); } class BuildAirportWindow : public PickerWindowBase { |