(svn r5944) -Merge TGP (r5578, r5579, r5724, r5726): -Feature: filter for textboxes to only

allow certain patterns (like numbers only)
This commit is contained in:
truelight
2006-08-19 09:31:22 +00:00
parent 9b18c11413
commit d3f2180438
19 changed files with 95 additions and 57 deletions

View File

@@ -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 */