| 419 | |
| 420 | public: |
| 421 | VehicleGroupWindow(WindowDesc &desc, WindowNumber window_number, const VehicleListIdentifier &vli) : BaseVehicleListWindow(desc, vli) |
| 422 | { |
| 423 | this->CreateNestedTree(); |
| 424 | |
| 425 | this->vscroll = this->GetScrollbar(WID_GL_LIST_VEHICLE_SCROLLBAR); |
| 426 | this->group_sb = this->GetScrollbar(WID_GL_LIST_GROUP_SCROLLBAR); |
| 427 | |
| 428 | this->vli.SetIndex(ALL_GROUP); |
| 429 | |
| 430 | this->groups.ForceRebuild(); |
| 431 | this->groups.NeedResort(); |
| 432 | this->BuildGroupList(vli.company); |
| 433 | this->group_sb->SetCount(this->groups.size()); |
| 434 | |
| 435 | this->GetWidget<NWidgetCore>(WID_GL_CAPTION)->SetString(STR_VEHICLE_LIST_TRAIN_CAPTION + this->vli.vtype); |
| 436 | this->GetWidget<NWidgetCore>(WID_GL_LIST_VEHICLE)->SetToolTip(STR_VEHICLE_LIST_TRAIN_LIST_TOOLTIP + this->vli.vtype); |
| 437 | |
| 438 | this->GetWidget<NWidgetCore>(WID_GL_CREATE_GROUP)->SetSprite(SPR_GROUP_CREATE_TRAIN + this->vli.vtype); |
| 439 | this->GetWidget<NWidgetCore>(WID_GL_RENAME_GROUP)->SetSprite(SPR_GROUP_RENAME_TRAIN + this->vli.vtype); |
| 440 | this->GetWidget<NWidgetCore>(WID_GL_DELETE_GROUP)->SetSprite(SPR_GROUP_DELETE_TRAIN + this->vli.vtype); |
| 441 | this->GetWidget<NWidgetCore>(WID_GL_LIVERY_GROUP)->SetSprite(SPR_GROUP_LIVERY_TRAIN + this->vli.vtype); |
| 442 | this->GetWidget<NWidgetCore>(WID_GL_REPLACE_PROTECTION)->SetSprite(SPR_GROUP_REPLACE_OFF_TRAIN + this->vli.vtype); |
| 443 | |
| 444 | this->FinishInitNested(window_number); |
| 445 | this->owner = vli.company; |
| 446 | |
| 447 | this->BuildVehicleList(); |
| 448 | this->SortVehicleList(); |
| 449 | } |
| 450 | |
| 451 | ~VehicleGroupWindow() |
| 452 | { |
nothing calls this directly
no test coverage detected