MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / onTextInput

Method onTextInput

src/openrct2-ui/scripting/CustomWindow.cpp:689–704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 }
688
689 void onTextInput(WidgetIndex widgetIndex, std::string_view text) override
690 {
691 auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
692 if (widgetDesc != nullptr)
693 {
694 if (widgetDesc->Type == "textbox")
695 {
696 UpdateWidgetText(this, widgetIndex, text);
697
698 std::vector<JSValue> args;
699 std::string textStr(text);
700 args.push_back(JSFromStdString(widgetDesc->OnChange.context, textStr));
701 InvokeEventHandler(_info.Owner, widgetDesc->OnChange, args);
702 }
703 }
704 }
705
706 ScreenSize onScrollGetSize(int32_t scrollIndex) override
707 {

Callers

nothing calls this directly

Calls 5

UpdateWidgetTextFunction · 0.85
JSFromStdStringFunction · 0.85
InvokeEventHandlerFunction · 0.85
GetCustomWidgetDescMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected