Public Types | |
enum | ActionDropdownItem { ADI_REPLACE, ADI_SERVICE, ADI_DEPOT, ADI_ADD_SHARED, ADI_REMOVE_ALL } |
Public Member Functions | |
BaseVehicleListWindow (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. | |
DropDownList * | BuildActionDropdownList (bool show_autoreplace, bool show_group) |
Display the Action dropdown window. | |
Data Fields | |
GUIVehicleList | vehicles |
The list of vehicles. | |
Listing * | sorting |
Pointer to the vehicle type related sorting. | |
byte | unitnumber_digits |
The number of digits of the highest unit number. | |
Scrollbar * | vscroll |
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 [] |
Definition at line 22 of file vehicle_gui_base.h.
DropDownList * BaseVehicleListWindow::BuildActionDropdownList | ( | bool | show_autoreplace, | |
bool | show_group | |||
) |
Display the Action dropdown window.
show_autoreplace | If true include the autoreplace item. | |
show_group | If true include group-related stuff. |
Definition at line 158 of file vehicle_gui.cpp.
References vli, and VehicleListIdentifier::vtype.
Referenced by VehicleListWindow::OnClick(), and VehicleGroupWindow::OnClick().
void BaseVehicleListWindow::DrawVehicleListItems | ( | VehicleID | selected_vehicle, | |
int | line_height, | |||
const Rect & | r | |||
) | const |
Draw all the vehicle list items.
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 1303 of file vehicle_gui.cpp.
References _current_text_dir, Vehicle::age, Vehicle::cur_real_order_index, DAYS_IN_LEAP_YEAR, DEFAULT_GROUP, DrawString(), DrawVehicleImage(), DrawVehicleProfitButton(), EIT_IN_LIST, FONT_HEIGHT_NORMAL, FONT_HEIGHT_SMALL, Scrollbar::GetCapacity(), GetDigitWidth(), Vehicle::GetDisplayProfitLastYear(), Vehicle::GetDisplayProfitThisYear(), Scrollbar::GetPosition(), GetSpriteSize(), Vehicle::group_id, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, Vehicle::IsInDepot(), SmallVector< T, S >::Length(), max(), Vehicle::max_age, min(), Vehicle::name, SetDParam(), Vehicle::unitnumber, unitnumber_digits, vehicles, vli, VehicleListIdentifier::vtype, WD_FRAMERECT_BOTTOM, and Window::width.
Referenced by VehicleListWindow::DrawWidget(), and VehicleGroupWindow::DrawWidget().
Dimension BaseVehicleListWindow::GetActionDropdownSize | ( | bool | show_autoreplace, | |
bool | show_group | |||
) |
Compute the size for the Action dropdown.
show_autoreplace | If true include the autoreplace item. | |
show_group | If true include group-related stuff. |
Definition at line 136 of file vehicle_gui.cpp.
References GetStringBoundingBox(), maxdim(), vli, and VehicleListIdentifier::vtype.
Referenced by VehicleListWindow::UpdateWidgetSize(), and VehicleGroupWindow::UpdateWidgetSize().
const StringID BaseVehicleListWindow::vehicle_depot_name [static] |
{ 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] |
{ &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] |
{ 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.