summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-19 09:31:22 +0000
committertruelight <truelight@openttd.org>2006-08-19 09:31:22 +0000
commit83d56d6d798a28169f00a4c67323a407037c0b0a (patch)
tree99ae4703fae7e532aba0086cf644ec2230755e2e /window.h
parentee0daa0a4fdbafba224f48d7749ba13b79fa3fdc (diff)
downloadopenttd-83d56d6d798a28169f00a4c67323a407037c0b0a.tar.xz
(svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only
allow certain patterns (like numbers only)
Diffstat (limited to 'window.h')
-rw-r--r--window.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/window.h b/window.h
index a5700f22e..8134e929c 100644
--- a/window.h
+++ b/window.h
@@ -3,6 +3,8 @@
#ifndef WINDOW_H
#define WINDOW_H
+#include "string.h"
+
typedef union WindowEvent WindowEvent;
typedef void WindowProc(Window *w, WindowEvent *e);
@@ -244,19 +246,11 @@ typedef struct Textbuf {
uint16 caretxoffs; /* the current position of the caret in pixels */
} Textbuf;
-typedef struct querystr_d {
- StringID caption;
- WindowClass wnd_class;
- WindowNumber wnd_num;
- Textbuf text;
- const char *orig;
-} querystr_d;
-
#define WP(ptr,str) (*(str*)(ptr)->custom)
/* You cannot 100% reliably calculate the biggest custom struct as
* the number of pointers in it and alignment will have a huge impact.
- * 88 is the largest window-size for 64-bit machines currently */
-#define WINDOW_CUSTOM_SIZE 88
+ * 96 is the largest window-size for 64-bit machines currently */
+#define WINDOW_CUSTOM_SIZE 96
typedef struct Scrollbar {
uint16 count, cap, pos;
@@ -300,6 +294,16 @@ struct Window {
byte custom[WINDOW_CUSTOM_SIZE];
};
+typedef struct querystr_d {
+ StringID caption;
+ WindowClass wnd_class;
+ WindowNumber wnd_num;
+ Textbuf text;
+ const char *orig;
+ CharSetFilter afilter;
+} querystr_d;
+assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
+
typedef struct {
byte item_count; /* follow_vehicle */
byte sel_index; /* scrollpos_x */