| 907 | WidgetID last_user_action = INVALID_WIDGET; ///< Last started user action. |
| 908 | |
| 909 | QueryStringWindow(std::string_view str, StringID caption, uint max_bytes, uint max_chars, WindowDesc &desc, Window *parent, CharSetFilter afilter, QueryStringFlags flags) : |
| 910 | Window(desc), editbox(max_bytes, max_chars) |
| 911 | { |
| 912 | this->editbox.text.Assign(str); |
| 913 | |
| 914 | if (!flags.Test(QueryStringFlag::AcceptUnchanged)) this->editbox.orig = this->editbox.text.GetText(); |
| 915 | |
| 916 | this->querystrings[WID_QS_TEXT] = &this->editbox; |
| 917 | this->editbox.caption = caption; |
| 918 | this->editbox.cancel_button = WID_QS_CANCEL; |
| 919 | this->editbox.ok_button = WID_QS_OK; |
| 920 | this->editbox.text.afilter = afilter; |
| 921 | this->flags = flags; |
| 922 | |
| 923 | this->CreateNestedTree(); |
| 924 | this->GetWidget<NWidgetStacked>(WID_QS_DEFAULT_SEL)->SetDisplayedPlane((this->flags.Test(QueryStringFlag::EnableDefault)) ? 0 : SZSP_NONE); |
| 925 | this->GetWidget<NWidgetStacked>(WID_QS_MOVE_SEL)->SetDisplayedPlane((this->flags.Test(QueryStringFlag::EnableMove)) ? 0 : SZSP_NONE); |
| 926 | this->FinishInitNested(WN_QUERY_STRING); |
| 927 | |
| 928 | this->parent = parent; |
| 929 | |
| 930 | this->SetFocusedWidget(WID_QS_TEXT); |
| 931 | } |
| 932 | |
| 933 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 934 | { |
nothing calls this directly
no test coverage detected