Public Types | Public Member Functions | Data Fields | Static Public Attributes

BaseVehicleListWindow Struct Reference

Inheritance diagram for BaseVehicleListWindow:
Window ZeroedMemoryAllocator VehicleGroupWindow VehicleListWindow

Public Types

enum  ActionDropdownItem {
  ADI_REPLACE, ADI_SERVICE, ADI_DEPOT, ADI_ADD_SHARED,
  ADI_REMOVE_ALL
}

Public Member Functions

 BaseVehicleListWindow (WindowDesc *desc, WindowNumber wno)
void DrawVehicleListItems (VehicleID selected_vehicle, int line_height, const Rect &r) const
 Draw all the vehicle list items.
void SortVehicleList ()
void BuildVehicleList ()
Dimension GetActionDropdownSize (bool show_autoreplace, bool show_group)
 Compute the size for the Action dropdown.
DropDownListBuildActionDropdownList (bool show_autoreplace, bool show_group)
 Display the Action dropdown window.

Data Fields

GUIVehicleList vehicles
 The list of vehicles.
Listingsorting
 Pointer to the vehicle type related sorting.
byte unitnumber_digits
 The number of digits of the highest unit number.
Scrollbarvscroll
VehicleListIdentifier vli
 Identifier of the vehicle list we want to currently show.

Static Public Attributes

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

Detailed Description

Definition at line 22 of file vehicle_gui_base.h.


Member Function Documentation

DropDownList * BaseVehicleListWindow::BuildActionDropdownList ( bool  show_autoreplace,
bool  show_group 
)

Display the Action dropdown window.

Parameters:
show_autoreplace If true include the autoreplace item.
show_group If true include group-related stuff.
Returns:
Itemlist for dropdown

Definition at line 155 of file vehicle_gui.cpp.

References SmallVector< T, S >::Append(), vli, and VehicleListIdentifier::vtype.

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

Dimension BaseVehicleListWindow::GetActionDropdownSize ( bool  show_autoreplace,
bool  show_group 
)

Compute the size for the Action dropdown.

Parameters:
show_autoreplace If true include the autoreplace item.
show_group If true include group-related stuff.
Returns:
Required size.

Definition at line 133 of file vehicle_gui.cpp.

References GetStringBoundingBox(), maxdim(), vli, and VehicleListIdentifier::vtype.

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


Field Documentation

const StringID BaseVehicleListWindow::vehicle_depot_name [static]
Initial value:
 {
  STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT,
  STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT,
  STR_VEHICLE_LIST_SEND_SHIP_TO_DEPOT,
  STR_VEHICLE_LIST_SEND_AIRCRAFT_TO_HANGAR
}

Definition at line 37 of file vehicle_gui_base.h.

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 39 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 38 of file vehicle_gui_base.h.


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