Factor out OnClick dispatching in Window::HandleEditBoxKey
[openttd/fttd.git] / src / textbuf_gui.h
blobb4e760a24178196f052b6bd7b769710f11116f6f
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file textbuf_gui.h Stuff related to the text buffer GUI. */
12 #ifndef TEXTBUF_GUI_H
13 #define TEXTBUF_GUI_H
15 #include "window_type.h"
16 #include "textbuf_type.h"
17 #include "strings_type.h"
19 /** Flags used in ShowQueryString() call */
20 enum QueryStringFlags {
21 QSF_NONE = 0,
22 QSF_ACCEPT_UNCHANGED = 0x01, ///< return success even when the text didn't change
23 QSF_ENABLE_DEFAULT = 0x02, ///< enable the 'Default' button ("\0" is returned)
24 QSF_LEN_IN_CHARS = 0x04, ///< the length of the string is counted in characters
27 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
29 /** Callback procedure for the ShowQuery method. */
30 typedef void QueryCallbackProc(Window*, bool);
32 void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
33 void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
35 /** The number of 'characters' on the on-screen keyboard. */
36 static const uint OSK_KEYBOARD_ENTRIES = 50;
38 /**
39 * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these
40 * have to be UTF-8 encoded, which means up to 4 bytes per character.
41 * Furthermore the string needs to be '\0'-terminated.
43 extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
45 #endif /* TEXTBUF_GUI_H */