* Some data on this window has become invalid. * @param data Information about the changed data. * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. */
| 529 | * @param gui_scope Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See #InvalidateWindowData() for details. |
| 530 | */ |
| 531 | void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override |
| 532 | { |
| 533 | if (data == 0) { |
| 534 | /* This needs to be done in command-scope to enforce rebuilding before resorting invalid data */ |
| 535 | this->vehgroups.ForceRebuild(); |
| 536 | this->groups.ForceRebuild(); |
| 537 | } else { |
| 538 | this->vehgroups.ForceResort(); |
| 539 | this->groups.ForceResort(); |
| 540 | } |
| 541 | |
| 542 | /* Process ID-invalidation in command-scope as well */ |
| 543 | if (this->group_rename != GroupID::Invalid() && !Group::IsValidID(this->group_rename)) { |
| 544 | CloseWindowByClass(WC_QUERY_STRING); |
| 545 | this->group_rename = GroupID::Invalid(); |
| 546 | } |
| 547 | |
| 548 | GroupID group = this->vli.ToGroupID(); |
| 549 | if (!(IsAllGroupID(group) || IsDefaultGroupID(group) || Group::IsValidID(group))) { |
| 550 | this->vli.SetIndex(ALL_GROUP); |
| 551 | this->CloseChildWindows(WC_DROPDOWN_MENU); |
| 552 | } |
| 553 | this->SetDirty(); |
| 554 | } |
| 555 | |
| 556 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 557 | { |
nothing calls this directly
no test coverage detected