summaryrefslogtreecommitdiff
path: root/src/genworld_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-13 21:46:37 +0000
committerfrosch <frosch@openttd.org>2012-11-13 21:46:37 +0000
commit1071d51508695978adcf9a184e0a26a65fff2705 (patch)
treedb442dc158e26b8f3e439edbe0b4a1b58c0de153 /src/genworld_gui.cpp
parent137adb3496a47f79d4e0a15463c756341f8217a9 (diff)
downloadopenttd-1071d51508695978adcf9a184e0a26a65fff2705.tar.xz
(svn r24727) -Fix: In various windows the OSK looked shiny but using it had no effect whatsoever.
Diffstat (limited to 'src/genworld_gui.cpp')
-rw-r--r--src/genworld_gui.cpp18
1 files changed, 12 insertions, 6 deletions
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) {