diff options
author | Darkvater <darkvater@openttd.org> | 2006-10-21 22:50:57 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-10-21 22:50:57 +0000 |
commit | e550bccf15bb423f135e4a3c07aae9f29a53207a (patch) | |
tree | 34b54ccc365c7e78b67c42eb083c2b239062455d /misc_gui.c | |
parent | c12a9e19c33f7a98a0f290d7cff9f02556b10fed (diff) | |
download | openttd-e550bccf15bb423f135e4a3c07aae9f29a53207a.tar.xz |
(svn r6879) -Codechange: Remove the superflouos argument CharsetFilter parameter from HandleEditBoxKey
as the same information is present in querystr_d->afilter
-Also (&((querystr_d *)&WP(w, querystr_d))->text is the same as &WP(w, querystr_d).text
Diffstat (limited to 'misc_gui.c')
-rw-r--r-- | misc_gui.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/misc_gui.c b/misc_gui.c index 68e125e4f..7df37a8d3 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -901,7 +901,7 @@ void UpdateTextBufferSize(Textbuf *tb) tb->caretxoffs = tb->width; } -int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *e, CharSetFilter afilter) +int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *e) { e->we.keypress.cont = false; @@ -925,11 +925,11 @@ int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *e, Cha InvalidateWidget(w, wid); break; default: - if (IsValidAsciiChar(e->we.keypress.ascii, afilter)) { + if (IsValidAsciiChar(e->we.keypress.ascii, string->afilter)) { if (InsertTextBufferChar(&string->text, e->we.keypress.ascii)) InvalidateWidget(w, wid); } else { // key wasn't caught. Continue only if standard entry specified - e->we.keypress.cont = (afilter == CS_ALPHANUMERAL); + e->we.keypress.cont = (string->afilter == CS_ALPHANUMERAL); } } @@ -1019,7 +1019,7 @@ press_ok:; } break; case WE_KEYPRESS: { - switch (HandleEditBoxKey(w, &WP(w, querystr_d), 5, e, WP(w, querystr_d).afilter)) { + switch (HandleEditBoxKey(w, &WP(w, querystr_d), 5, e)) { case 1: // Return goto press_ok; case 2: // Escape @@ -1455,7 +1455,7 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e) } if (_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO) { - if (HandleEditBoxKey(w, &WP(w, querystr_d), 10, e, CS_ALPHANUMERAL) == 1) /* Press Enter */ + if (HandleEditBoxKey(w, &WP(w, querystr_d), 10, e) == 1) /* Press Enter */ HandleButtonClick(w, 12); } break; @@ -1580,6 +1580,7 @@ void ShowSaveLoadDialog(int mode) WP(w,querystr_d).text.maxlength = lengthof(_edit_str_buf); WP(w,querystr_d).text.maxwidth = 240; WP(w,querystr_d).text.buf = _edit_str_buf; + WP(w,querystr_d).afilter = CS_ALPHANUMERAL; UpdateTextBufferSize(&WP(w, querystr_d).text); // pause is only used in single-player, non-editor mode, non-menu mode. It |