src/querystring_gui.h
branchnoai
changeset 10513 33cb70ff2f5d
child 10645 8cbdb511a674
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/querystring_gui.h	Sun May 11 20:09:34 2008 +0000
@@ -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 */