# BaseVehicleListWindow Struct Reference

Inheritance diagram for BaseVehicleListWindow:

## Public Member Functions

void | DrawVehicleListItems (VehicleID selected_vehicle, int line_height, const Rect &r) const
| Draw all the vehicle list items.
void | SortVehicleList ()
void | BuildVehicleList (Owner owner, uint16 index, uint16 window_type)

## Data Fields

GUIVehicleList | vehicles
| The list of vehicles.
Listing * | sorting
| Pointer to the vehicle type related sorting.
VehicleType | vehicle_type
| The vehicle type that is sorted.
byte | unitnumber_digits
| The number of digits of the highest unit number.

## Static Public Attributes

static const StringID | vehicle_sorter_names []
static GUIVehicleList::SortFunction *const | vehicle_sorter_funcs []

## Detailed Description

Definition at line 20 of file vehicle_gui_base.h.

## Member Function Documentation

void BaseVehicleListWindow::DrawVehicleListItems | ( | VehicleID | selected_vehicle,
|  | int | line_height,
|  | const Rect & | r |
| ) |  |  | const

Draw all the vehicle list items.

Parameters:

  | selected_vehicle | The vehicle that is to be highlighted.
  | line_height | Height of a single item line.
  | r | Rectangle with edge positions of the matrix widget.

Definition at line 877 of file vehicle_gui.cpp.

References _dynlang, Vehicle::cur_order_index, DAYS_IN_LEAP_YEAR, DEFAULT_GROUP, DrawString(), DrawVehicleImage(), DrawVehicleProfitButton(), FONT_HEIGHT_NORMAL, FONT_HEIGHT_SMALL, Scrollbar::GetCapacity(), GetDigitWidth(), Vehicle::GetDisplayProfitLastYear(), Vehicle::GetDisplayProfitThisYear(), Scrollbar::GetPosition(), Vehicle::group_id, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >::index, Vehicle::IsInDepot(), SmallVector< T, S >::Length(), max(), min(), Vehicle::name, SetDParam(), TD_RTL, DynamicLanguages::text_dir, unitnumber_digits, VEH_SHIP, vehicle_type, vehicles, Window::vscroll, WD_FRAMERECT_BOTTOM, WD_FRAMERECT_RIGHT, WD_MATRIX_LEFT, WD_MATRIX_RIGHT, and Window::width.

Referenced by VehicleListWindow::DrawWidget(), and VehicleGroupWindow::DrawWidget().

## Field Documentation

GUIVehicleList::SortFunction *const BaseVehicleListWindow::vehicle_sorter_funcs`[static]`

Initial value:

     {
      &VehicleNumberSorter,
      &VehicleNameSorter,
      &VehicleAgeSorter,
      &VehicleProfitThisYearSorter,
      &VehicleProfitLastYearSorter,
      &VehicleCargoSorter,
      &VehicleReliabilitySorter,
      &VehicleMaxSpeedSorter,
      &VehicleModelSorter,
      &VehicleValueSorter,
      &VehicleLengthSorter,
      &VehicleTimeToLiveSorter,
      &VehicleTimetableDelaySorter,
    }

Definition at line 27 of file vehicle_gui_base.h.

const StringID BaseVehicleListWindow::vehicle_sorter_names`[static]`

Initial value:

     {
      STR_SORT_BY_NUMBER,
      STR_SORT_BY_NAME,
      STR_SORT_BY_AGE,
      STR_SORT_BY_PROFIT_THIS_YEAR,
      STR_SORT_BY_PROFIT_LAST_YEAR,
      STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE,
      STR_SORT_BY_RELIABILITY,
      STR_SORT_BY_MAX_SPEED,
      STR_SORT_BY_MODEL,
      STR_SORT_BY_VALUE,
      STR_SORT_BY_LENGTH,
      STR_SORT_BY_LIFE_TIME,
      STR_SORT_BY_TIMETABLE_DELAY,
      INVALID_STRING_ID
    }

Definition at line 26 of file vehicle_gui_base.h.

The documentation for this struct was generated from the following files:

- src/vehicle_gui_base.h
- src/vehicle_gui.cpp