annotate src/textbuf_gui.h @ 20661:1e53dec875f8 draft

(svn r25617) -Fix [FS#5655] (r25377): crash when Ctrl+clicking the start date button in timetable window without any orders
author rubidium <rubidium@openttd.org>
date Wed, 17 Jul 2013 18:37:13 +0000
parents a413e5168939
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
1 /* $Id$ */
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
2
12778
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
3 /*
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
4 * This file is part of OpenTTD.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
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.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
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.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
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/>.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
8 */
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 10276
diff changeset
9
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
10 /** @file textbuf_gui.h Stuff related to the text buffer GUI. */
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
11
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
12 #ifndef TEXTBUF_GUI_H
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
13 #define TEXTBUF_GUI_H
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
14
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
15 #include "window_type.h"
8214
6385dffc0b37 (svn r11777) -Codechange: split the string header and make do not include it when it's not necessary.
rubidium <rubidium@openttd.org>
parents: 8124
diff changeset
16 #include "string_type.h"
8737
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
17 #include "strings_type.h"
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
18
10145
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
19 /** Flags used in ShowQueryString() call */
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
20 enum QueryStringFlags {
10148
81642658c8be (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
smatz <smatz@openttd.org>
parents: 10145
diff changeset
21 QSF_NONE = 0,
10145
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
22 QSF_ACCEPT_UNCHANGED = 0x01, ///< return success even when the text didn't change
10148
81642658c8be (svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
smatz <smatz@openttd.org>
parents: 10145
diff changeset
23 QSF_ENABLE_DEFAULT = 0x02, ///< enable the 'Default' button ("\0" is returned)
16676
00850d1ba2f2 (svn r21407) -Codechange: prepare the text buffer code for limiting on number of characters besides the number of bytes
rubidium <rubidium@openttd.org>
parents: 16675
diff changeset
24 QSF_LEN_IN_CHARS = 0x04, ///< the length of the string is counted in characters
10145
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
25 };
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
26
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
27 DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
dbe302da93a8 (svn r14331) -Codechange: use an enum as additional parameter for ShowQueryString()
smatz <smatz@openttd.org>
parents: 9319
diff changeset
28
17634
5117fc12b816 (svn r22405) -Document: some more "random-ish" tidbits
rubidium <rubidium@openttd.org>
parents: 17582
diff changeset
29 /** Callback procedure for the ShowQuery method. */
9319
7c3d6f855380 (svn r13191) -Fix: segfault after confirming query subwindow in the Generate New World window
smatz <smatz@openttd.org>
parents: 9179
diff changeset
30 typedef void QueryCallbackProc(Window*, bool);
7c3d6f855380 (svn r13191) -Fix: segfault after confirming query subwindow in the Generate New World window
smatz <smatz@openttd.org>
parents: 9179
diff changeset
31
17579
105b4e4eb168 (svn r22343) -Change: Remove pixel limiter for query strings.
terkhen <terkhen@openttd.org>
parents: 16676
diff changeset
32 void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
9319
7c3d6f855380 (svn r13191) -Fix: segfault after confirming query subwindow in the Generate New World window
smatz <smatz@openttd.org>
parents: 9179
diff changeset
33 void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
34
8737
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
35 /** The number of 'characters' on the on-screen keyboard. */
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
36 static const uint OSK_KEYBOARD_ENTRIES = 50;
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
37
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
38 /**
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
39 * The number of characters has to be OSK_KEYBOARD_ENTRIES. However, these
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
40 * have to be UTF-8 encoded, which means up to 4 bytes per character.
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
41 * Furthermore the string needs to be '\0'-terminated.
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
42 */
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
43 extern char _keyboard_opt[2][OSK_KEYBOARD_ENTRIES * 4 + 1];
b62e473a9029 (svn r12425) -Feature [FS#1846]: On Screen Keyboard for input fields so someone without a keyboard can enter text too. Patch by Dominik.
rubidium <rubidium@openttd.org>
parents: 8214
diff changeset
44
8107
f65cf2bc3255 (svn r11668) -Codechange: more refactoring aimed at reducing compile time and making it more logic where function definitions can be found.
rubidium <rubidium@openttd.org>
parents:
diff changeset
45 #endif /* TEXTBUF_GUI_H */