From 1071d51508695978adcf9a184e0a26a65fff2705 Mon Sep 17 00:00:00 2001 From: frosch Date: Tue, 13 Nov 2012 21:46:37 +0000 Subject: (svn r24727) -Fix: In various windows the OSK looked shiny but using it had no effect whatsoever. --- src/genworld_gui.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/genworld_gui.cpp') diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4eb1f8f51..36b25dbff 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -697,15 +697,21 @@ struct GenerateLandscapeWindow : public QueryStringBaseWindow { virtual EventState OnKeyPress(uint16 key, uint16 keycode) { EventState state = ES_NOT_HANDLED; - this->HandleEditBoxKey(WID_GL_RANDOM_EDITBOX, key, keycode, state); - /* the seed is unsigned, therefore atoi cannot be used. - * As UINT32_MAX is a 'magic' value (use random seed) it - * should not be possible to be entered into the input - * field; the generate seed button can be used instead. */ - _settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1); + if (this->HandleEditBoxKey(WID_GL_RANDOM_EDITBOX, key, keycode, state) == HEBR_EDITING) this->OnOSKInput(WID_GL_RANDOM_EDITBOX); return state; } + virtual void OnOSKInput(int wid) + { + if (wid == WID_GL_RANDOM_EDITBOX) { + /* the seed is unsigned, therefore atoi cannot be used. + * As UINT32_MAX is a 'magic' value (use random seed) it + * should not be possible to be entered into the input + * field; the generate seed button can be used instead. */ + _settings_newgame.game_creation.generation_seed = minu(strtoul(this->edit_str_buf, NULL, 10), UINT32_MAX - 1); + } + } + virtual void OnDropdownSelect(int widget, int index) { switch (widget) { -- cgit v1.2.3-54-g00ecf