diff options
author | frosch <frosch@openttd.org> | 2010-01-30 18:34:48 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2010-01-30 18:34:48 +0000 |
commit | 88019e64e1de6966c9cfe26beda537664332d7ec (patch) | |
tree | 4e907f0b62170a086d3297d50ff5743cacb4491c /src/build_vehicle_gui.cpp | |
parent | 2f6fe85f23256a116cb4e85606c8714d8fc8a399 (diff) | |
download | openttd-88019e64e1de6966c9cfe26beda537664332d7ec.tar.xz |
(svn r18966) -Codechange: Remove Window::OnDoubleClick() in favour of a parameter for OnClick().
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r-- | src/build_vehicle_gui.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index a68ab9f23..0693d84e9 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1002,7 +1002,7 @@ struct BuildVehicleWindow : Window { this->eng_list.RebuildDone(); } - void OnClick(Point pt, int widget) + void OnClick(Point pt, int widget, int click_count) { switch (widget) { case BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING: @@ -1017,6 +1017,7 @@ struct BuildVehicleWindow : Window { size_t num_items = this->eng_list.Length(); this->sel_engine = (i < num_items) ? this->eng_list[i] : INVALID_ENGINE; this->SetDirty(); + if (click_count > 1) this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD, 1); break; } @@ -1128,14 +1129,6 @@ struct BuildVehicleWindow : Window { } } - virtual void OnDoubleClick(Point pt, int widget) - { - if (widget == BUILD_VEHICLE_WIDGET_LIST) { - /* When double clicking, we want to buy a vehicle */ - this->OnClick(pt, BUILD_VEHICLE_WIDGET_BUILD); - } - } - virtual void OnQueryTextFinished(char *str) { if (str == NULL) return; |