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

Method UnfocusFocusedWidget

src/window.cpp:471–480  ·  view source on GitHub ↗

* Makes no widget on this window have focus. The function however doesn't change which window has focus. */

Source from the content-addressed store, hash-verified

469 * Makes no widget on this window have focus. The function however doesn't change which window has focus.
470 */
471void Window::UnfocusFocusedWidget()
472{
473 if (this->nested_focus != nullptr) {
474 if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxLostFocus();
475
476 /* Repaint the widget that lost focus. A focused edit box may else leave the caret on the screen. */
477 this->nested_focus->SetDirty(this);
478 this->nested_focus = nullptr;
479 }
480}
481
482/**
483 * Set focus within this window to the given widget. The function however doesn't change which window has focus.

Callers 3

SetShadedMethod · 0.95
HandleEditBoxKeyMethod · 0.95
UnfocusWidgetsMethod · 0.80

Calls 2

EditBoxLostFocusMethod · 0.45
SetDirtyMethod · 0.45

Tested by

no test coverage detected