# vehicle_gui_base.h

Go to the documentation of this file.

    00001 /* $Id: vehicle_gui_base.h 15027 2009-01-12 17:11:45Z truebrain $ */
    00002
    00005 #ifndef VEHICLE_GUI_BASE_H
    00006 #define VEHICLE_GUI_BASE_H
    00007
    00008 #include "sortlist_type.h"
    00009
    00011 enum {
    00012   PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
    00013   PLY_WND_PRC__SIZE_OF_ROW_TINY  = 13,
    00014   PLY_WND_PRC__SIZE_OF_ROW_SMALL = 26,
    00015   PLY_WND_PRC__SIZE_OF_ROW_BIG   = 39,
    00016 };
    00017
    00018 typedef GUIList<const Vehicle*> GUIVehicleList;
    00019
    00020 struct BaseVehicleListWindow: public Window {
    00021   GUIVehicleList vehicles;
    00022   Listing *sorting;
    00023   VehicleType vehicle_type;
    00024
    00025   static const StringID vehicle_sorter_names[];
    00026   static GUIVehicleList::SortFunction *const vehicle_sorter_funcs[];
    00027
    00028   BaseVehicleListWindow(const WindowDesc *desc, WindowNumber window_number) : Window(desc, window_number)
    00029   {
    00030     this->vehicles.SetSortFuncs(this->vehicle_sorter_funcs);
    00031   }
    00032
    00033   void DrawVehicleListItems(int x, VehicleID selected_vehicle);
    00034   void SortVehicleList();
    00035   void BuildVehicleList(Owner owner, uint16 index, uint16 window_type);
    00036 };
    00037
    00038 struct Sorting {
    00039   Listing aircraft;
    00040   Listing roadveh;
    00041   Listing ship;
    00042   Listing train;
    00043 };
    00044
    00045 extern Sorting _sorting;
    00046
    00047 #endif /* VEHICLE_GUI_BASE_H */