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

Method GetFocusedTextbuf

src/window.cpp:366–373  ·  view source on GitHub ↗

* Get the current input text buffer. * @return The currently focused input text buffer or nullptr if no input focused. */ virtual */

Source from the content-addressed store, hash-verified

364 * @return The currently focused input text buffer or nullptr if no input focused.
365 */
366/* virtual */ const Textbuf *Window::GetFocusedTextbuf() const
367{
368 if (this->nested_focus != nullptr && this->nested_focus->type == WWT_EDITBOX) {
369 return &this->GetQueryString(this->nested_focus->GetIndex())->text;
370 }
371
372 return nullptr;
373}
374
375/**
376 * Get the current caret position if an edit box has the focus.

Callers

nothing calls this directly

Calls 2

GetQueryStringMethod · 0.95
GetIndexMethod · 0.45

Tested by

no test coverage detected