summaryrefslogtreecommitdiff
path: root/src/querystring_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-11 12:26:20 +0000
committerrubidium <rubidium@openttd.org>2008-05-11 12:26:20 +0000
commiteb2d47b547fe550b3e14d15e5b74cedf481bfe4e (patch)
treea81c22c0f013ed28d69e04f6dbf703d89d6db427 /src/querystring_gui.h
parente63137f47f01b9567d9d4d9984ef0c5871d95db4 (diff)
downloadopenttd-eb2d47b547fe550b3e14d15e5b74cedf481bfe4e.tar.xz
(svn r13042) -Codechange: make a class of CreateScenarioWindow, GenerateLandscapeWindow, NetworkChatWindow, NetworkCompanyPasswordWindow, NetworkGameWindow, NetworkStartServerWindow, QueryStringWindow, SaveLoadWindow. All these classes depended on the 'querystr_d' object which is now put into QueryStringBaseWindow. As a side effect this removes quite a lot of WP macro usages and a few global variables.
Diffstat (limited to 'src/querystring_gui.h')
-rw-r--r--src/querystring_gui.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/querystring_gui.h b/src/querystring_gui.h
new file mode 100644
index 000000000..7b001dadd
--- /dev/null
+++ b/src/querystring_gui.h
@@ -0,0 +1,38 @@
+/* $Id$ */
+
+/** @file querystring_gui.h Base for the GUIs that have an edit box in them. */
+
+#ifndef QUERYSTRING_GUI_H
+#define QUERYSTRING_GUI_H
+
+#include "textbuf_gui.h"
+#include "window_gui.h"
+
+struct QueryString {
+ StringID caption;
+ Textbuf text;
+ const char *orig;
+ CharSetFilter afilter;
+ bool handled;
+
+ void DrawEditBox(Window *w, int wid);
+ void HandleEditBox(Window *w, int wid);
+ int HandleEditBoxKey(Window *w, int wid, uint16 key, uint16 keycode, bool &cont);
+};
+
+struct QueryStringBaseWindow : public Window, public QueryString {
+ char edit_str_buf[64];
+ char orig_str_buf[64];
+
+ QueryStringBaseWindow(const WindowDesc *desc, void *data = NULL, WindowNumber window_number = 0) : Window(desc, data, window_number)
+ {
+ }
+
+ void DrawEditBox(int wid);
+ void HandleEditBox(int wid);
+ int HandleEditBoxKey(int wid, uint16 key, uint16 keycode, bool &cont);
+};
+
+void ShowOnScreenKeyboard(QueryStringBaseWindow *parent, int button, int cancel, int ok);
+
+#endif /* QUERYSTRING_GUI_H */