OpenTTD Source 20250312-master-gcdcc6b491d
textbuf_gui.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef TEXTBUF_GUI_H
11#define TEXTBUF_GUI_H
12
13#include "window_type.h"
14#include "string_type.h"
15#include "strings_type.h"
16
18enum class QueryStringFlag : uint8_t {
22};
23
25
27typedef void QueryCallbackProc(Window*, bool);
28
29void ShowQueryString(std::string_view str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
30void ShowQuery(EncodedString &&caption, EncodedString &&message, Window *w, QueryCallbackProc *callback, bool focus = false);
31
33static const uint OSK_KEYBOARD_ENTRIES = 50;
34
39extern std::string _keyboard_opt[2];
40
41#endif /* TEXTBUF_GUI_H */
Container for an encoded string, created by GetEncodedString.
Types for strings.
CharSetFilter
Valid filter types for IsValidChar.
Definition string_type.h:24
Types related to strings.
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Data structure for an opened window.
Definition window_gui.h:274
QueryStringFlag
Flags used in ShowQueryString() call.
Definition textbuf_gui.h:18
@ AcceptUnchanged
return success even when the text didn't change
@ EnableDefault
enable the 'Default' button ("\0" is returned)
@ LengthIsInChars
the length of the string is counted in characters
std::string _keyboard_opt[2]
The number of characters has to be OSK_KEYBOARD_ENTRIES.
Definition osk_gui.cpp:27
void QueryCallbackProc(Window *, bool)
Callback procedure for the ShowQuery method.
Definition textbuf_gui.h:27
void ShowQuery(EncodedString &&caption, EncodedString &&message, Window *w, QueryCallbackProc *callback, bool focus=false)
Show a confirmation window with standard 'yes' and 'no' buttons The window is aligned to the centre o...
void ShowQueryString(std::string_view str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
static const uint OSK_KEYBOARD_ENTRIES
The number of 'characters' on the on-screen keyboard.
Definition textbuf_gui.h:33
Types related to windows.