(svn r20170) -Codechange: Add BaseVehicleListWindow::GetActionDropdownSize().

This commit is contained in:
frosch
2010-07-17 14:47:54 +00:00
parent c79d4f46a3
commit ce480fb4b5
3 changed files with 23 additions and 5 deletions

View File

@@ -125,6 +125,27 @@ void BaseVehicleListWindow::BuildVehicleList(Owner owner, uint16 index, uint16 w
this->vscroll.SetCount(this->vehicles.Length());
}
/**
* Compute the size for the Action dropdown.
* @param show_group If true include group-related stuff.
* @return Required size.
*/
Dimension BaseVehicleListWindow::GetActionDropdownSize(bool show_group)
{
Dimension d = {0, 0};
d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_REPLACE_VEHICLES));
d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_SEND_FOR_SERVICING));
d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT));
if (show_group) {
d = maxdim(d, GetStringBoundingBox(STR_GROUP_ADD_SHARED_VEHICLE));
d = maxdim(d, GetStringBoundingBox(STR_GROUP_REMOVE_ALL_VEHICLES));
}
return d;
}
/**
* Display the Action dropdown window.
* @param show_group If true include group-related stuff.