OpenTTD Source: src/textbuf_gui.h Source File

OpenTTD Source 14.0-beta1

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
18 enum QueryStringFlags {
19 QSF_NONE = 0,
20 QSF_ACCEPT_UNCHANGED = 0x01,
21 QSF_ENABLE_DEFAULT = 0x02,
22 QSF_LEN_IN_CHARS = 0x04,
23 QSF_PASSWORD = 0x08,
24 };
25
26 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
27
28
29 typedef void QueryCallbackProc(Window*, bool);
30
31 void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
32 void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback, bool focus = false);
33
35 static const uint OSK_KEYBOARD_ENTRIES = 50;
36
41 extern std::string _keyboard_opt[2];
42
43 #endif /* TEXTBUF_GUI_H */
QSF_PASSWORD
@ QSF_PASSWORD
password entry box, show warning about password security
Definition: textbuf_gui.h:23
QSF_ACCEPT_UNCHANGED
@ QSF_ACCEPT_UNCHANGED
return success even when the text didn't change
Definition: textbuf_gui.h:20
StringID
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Definition: strings_type.h:16
window_type.h
strings_type.h
QSF_LEN_IN_CHARS
@ QSF_LEN_IN_CHARS
the length of the string is counted in characters
Definition: textbuf_gui.h:22
QueryStringFlags
QueryStringFlags
Flags used in ShowQueryString() call.
Definition: textbuf_gui.h:18
ShowQuery
void ShowQuery(StringID caption, StringID 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...
Definition: misc_gui.cpp:1227
OSK_KEYBOARD_ENTRIES
static const uint OSK_KEYBOARD_ENTRIES
The number of 'characters' on the on-screen keyboard.
Definition: textbuf_gui.h:35
ShowQueryString
void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags)
Show a query popup window with a textbox in it.
Definition: misc_gui.cpp:1083
string_type.h
_keyboard_opt
std::string _keyboard_opt[2]
The number of characters has to be OSK_KEYBOARD_ENTRIES.
Definition: osk_gui.cpp:27
DECLARE_ENUM_AS_BIT_SET
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Definition: company_manager_face.h:29
Window
Data structure for an opened window.
Definition: window_gui.h:267
QueryCallbackProc
void QueryCallbackProc(Window *, bool)
Callback procedure for the ShowQuery method.
Definition: textbuf_gui.h:29
QSF_ENABLE_DEFAULT
@ QSF_ENABLE_DEFAULT
enable the 'Default' button ("\0" is returned)
Definition: textbuf_gui.h:21
CharSetFilter
CharSetFilter
Valid filter types for IsValidChar.
Definition: string_type.h:24