diff options
author | truelight <truelight@openttd.org> | 2006-08-19 09:31:22 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2006-08-19 09:31:22 +0000 |
commit | 83d56d6d798a28169f00a4c67323a407037c0b0a (patch) | |
tree | 99ae4703fae7e532aba0086cf644ec2230755e2e /settings_gui.c | |
parent | ee0daa0a4fdbafba224f48d7749ba13b79fa3fdc (diff) | |
download | openttd-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 'settings_gui.c')
-rw-r--r-- | settings_gui.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/settings_gui.c b/settings_gui.c index 6de19cc76..2d140d4b1 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -840,7 +840,7 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e) WP(w,def_d).data_3 = btn; SetDParam(0, value); - ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, WC_GAME_OPTIONS, 0); + ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, WC_GAME_OPTIONS, 0, CS_NUMERAL); } } @@ -1138,6 +1138,7 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e) int len = 0; int x = e->click.pt.x; StringID str = 0; + CharSetFilter afilter = CS_ALPHANUMERAL; switch ( line ) { case 0: // rate @@ -1154,6 +1155,7 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e) str = STR_CONFIG_PATCHES_INT32; len = 4; edittext = true; + afilter = CS_NUMERAL; } break; case 1: // separator @@ -1193,6 +1195,7 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e) str = STR_CONFIG_PATCHES_INT32; len = 4; edittext = true; + afilter = CS_NUMERAL; } break; } @@ -1205,7 +1208,7 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e) len + 1, // maximum number of characters OR 250, // characters up to this width pixels, whichever is satisfied first w->window_class, - w->window_number); + w->window_number, afilter); } w->flags4 |= 5 << WF_TIMEOUT_SHL; |