* Raise the buttons of the window. * @param autoraise Raise only the push buttons of the window. */
| 530 | * @param autoraise Raise only the push buttons of the window. |
| 531 | */ |
| 532 | void Window::RaiseButtons(bool autoraise) |
| 533 | { |
| 534 | for (auto &pair : this->widget_lookup) { |
| 535 | WidgetType type = pair.second->type; |
| 536 | NWidgetCore *wid = dynamic_cast<NWidgetCore *>(pair.second); |
| 537 | if (wid != nullptr && ((type & ~WWB_PUSHBUTTON) < WWT_LAST || type == NWID_PUSHBUTTON_DROPDOWN) && |
| 538 | (!autoraise || (type & WWB_PUSHBUTTON) || type == WWT_EDITBOX) && wid->IsLowered()) { |
| 539 | wid->SetLowered(false); |
| 540 | wid->SetDirty(this); |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | /* Special widgets without widget index */ |
| 545 | { |
| 546 | NWidgetCore *wid = this->nested_root != nullptr ? dynamic_cast<NWidgetCore *>(this->nested_root->GetWidgetOfType(WWT_DEFSIZEBOX)) : nullptr; |
| 547 | if (wid != nullptr) { |
| 548 | wid->SetLowered(false); |
| 549 | wid->SetDirty(this); |
| 550 | } |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | /** |
| 555 | * Invalidate a widget, i.e. mark it as being changed and in need of redraw. |
no test coverage detected