From 83d56d6d798a28169f00a4c67323a407037c0b0a Mon Sep 17 00:00:00 2001 From: truelight Date: Sat, 19 Aug 2006 09:31:22 +0000 Subject: (svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only allow certain patterns (like numbers only) --- window.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'window.h') 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 */ -- cgit v1.2.3-54-g00ecf