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

Function UpdateOSKOriginalText

src/osk_gui.cpp:406–414  ·  view source on GitHub ↗

* Updates the original text of the OSK so when the 'parent' changes the * original and you press on cancel you won't get the 'old' original text * but the updated one. * @param parent window that just updated its original text * @param button widget number of parent's textbox to update */

Source from the content-addressed store, hash-verified

404 * @param button widget number of parent's textbox to update
405 */
406void UpdateOSKOriginalText(const Window *parent, WidgetID button)
407{
408 OskWindow *osk = dynamic_cast<OskWindow *>(FindWindowById(WC_OSK, 0));
409 if (osk == nullptr || osk->parent != parent || osk->text_btn != button) return;
410
411 osk->orig_str = osk->qs->text.GetText();
412
413 osk->SetDirty();
414}
415
416/**
417 * Check whether the OSK is opened for a specific editbox.

Callers 1

RandomTownNameMethod · 0.85

Calls 3

FindWindowByIdFunction · 0.85
GetTextMethod · 0.45
SetDirtyMethod · 0.45

Tested by

no test coverage detected