vehicle_gui_base.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef VEHICLE_GUI_BASE_H
00013 #define VEHICLE_GUI_BASE_H
00014
00015 #include "sortlist_type.h"
00016 #include "window_gui.h"
00017
00018 typedef GUIList<const Vehicle*> GUIVehicleList;
00019
00020 struct BaseVehicleListWindow : public Window {
00021 GUIVehicleList vehicles;
00022 Listing *sorting;
00023 VehicleType vehicle_type;
00024 byte unitnumber_digits;
00025
00026 static const StringID vehicle_sorter_names[];
00027 static GUIVehicleList::SortFunction * const vehicle_sorter_funcs[];
00028
00029 BaseVehicleListWindow() : Window()
00030 {
00031 this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs);
00032 }
00033
00034 void DrawVehicleListItems(VehicleID selected_vehicle, int line_height, const Rect &r) const;
00035 void SortVehicleList();
00036 void BuildVehicleList(Owner owner, uint16 index, uint16 window_type);
00037 };
00038
00039 uint GetVehicleListHeight(VehicleType type, uint divisor = 1);
00040
00041 struct Sorting {
00042 Listing aircraft;
00043 Listing roadveh;
00044 Listing ship;
00045 Listing train;
00046 };
00047
00048 extern Sorting _sorting;
00049
00050 #endif