summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-30 18:34:48 +0000
committerfrosch <frosch@openttd.org>2010-01-30 18:34:48 +0000
commit88019e64e1de6966c9cfe26beda537664332d7ec (patch)
tree4e907f0b62170a086d3297d50ff5743cacb4491c /src/build_vehicle_gui.cpp
parent2f6fe85f23256a116cb4e85606c8714d8fc8a399 (diff)
downloadopenttd-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.cpp11
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;