MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / RaiseButtons

Method RaiseButtons

src/window.cpp:532–552  ·  view source on GitHub ↗

* Raise the buttons of the window. * @param autoraise Raise only the push buttons of the window. */

Source from the content-addressed store, hash-verified

530 * @param autoraise Raise only the push buttons of the window.
531 */
532void 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.

Callers 15

OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
UpdateModeMethod · 0.80
DecreaseWindowCountersFunction · 0.80
OnClickMethod · 0.80
OnTimeoutMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80
OnPlaceObjectAbortMethod · 0.80

Calls 4

IsLoweredMethod · 0.80
SetLoweredMethod · 0.80
GetWidgetOfTypeMethod · 0.80
SetDirtyMethod · 0.45

Tested by

no test coverage detected