* Show a query popup window with a textbox in it. * @param str StringID for the text shown in the textbox * @param caption StringID of text shown in caption of querywindow * @param maxsize maximum size in bytes or characters (including terminating '\0') depending on flags * @param parent pointer to a Window that will handle the events (ok/cancel) of this window. * @param afilter filters out u
| 1062 | * @param flags various flags, @see QueryStringFlags |
| 1063 | */ |
| 1064 | void ShowQueryString(std::string_view str, StringID caption, uint maxsize, Window *parent, CharSetFilter afilter, QueryStringFlags flags) |
| 1065 | { |
| 1066 | assert(parent != nullptr); |
| 1067 | |
| 1068 | CloseWindowByClass(WC_QUERY_STRING); |
| 1069 | new QueryStringWindow(str, caption, (flags.Test(QueryStringFlag::LengthIsInChars) ? MAX_CHAR_LENGTH : 1) * maxsize, maxsize, _query_string_desc, parent, afilter, flags); |
| 1070 | } |
| 1071 | |
| 1072 | /** |
| 1073 | * Window used for asking the user a YES/NO question. |
no test coverage detected