summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-10-25 14:52:46 +0000
committeralberth <alberth@openttd.org>2009-10-25 14:52:46 +0000
commitbd05f2eca64d8d6fff73ad907e7e6c0db61b5eaa (patch)
tree47a20dbc94636e5576e0e4dba6703c296d1d43c5
parent38687193fed422570f5cbde8496738b9b920fb7c (diff)
downloadopenttd-bd05f2eca64d8d6fff73ad907e7e6c0db61b5eaa.tar.xz
(svn r17867) -Codechange: Prepare BaseVehicleListWindow for nested widgets.
-rw-r--r--src/vehicle_gui.cpp2
-rw-r--r--src/vehicle_gui_base.h7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index b8c932136..00c8f5783 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -807,7 +807,7 @@ static void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection
* @param line_height Height of a single item line.
* @param r Rectangle with edge positions of the matrix widget.
*/
-void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r)
+void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const
{
int left = r.left + WD_MATRIX_LEFT;
int right = r.right - WD_MATRIX_RIGHT;
diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h
index 4b7eb8fb3..7cad95687 100644
--- a/src/vehicle_gui_base.h
+++ b/src/vehicle_gui_base.h
@@ -37,7 +37,12 @@ struct BaseVehicleListWindow: public Window {
this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs);
}
- void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r);
+ BaseVehicleListWindow() : Window()
+ {
+ this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs);
+ }
+
+ void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const;
void SortVehicleList();
void BuildVehicleList(Owner owner, uint16 index, uint16 window_type);
};