diff options
author | rubidium <rubidium@openttd.org> | 2009-02-09 01:22:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-02-09 01:22:29 +0000 |
commit | 5080feba0d5d5811048f1cece0b76f6396034c49 (patch) | |
tree | 2efbc4cf44063706f8bd6b787f55a92c57290fbb /src/osk_gui.cpp | |
parent | 66cb1fe1ff78b80f0acebdcadf0818f70090eab1 (diff) | |
download | openttd-5080feba0d5d5811048f1cece0b76f6396034c49.tar.xz |
(svn r15424) -Codechange: make it possible to have multiple windows with edit box open simultaniously (Zuu).
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r-- | src/osk_gui.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index a4906c1ed..42208110e 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -131,6 +131,21 @@ struct OskWindow : public Window { } switch (widget) { + case OSK_WIDGET_TEXT: + /* Find the edit box of the parent window and give focus to that */ + for (uint i = 0; i < this->parent->widget_count; i++) { + Widget &wi = this->parent->widget[i]; + if (wi.type == WWT_EDITBOX) { + this->parent->focused_widget = &wi; + break; + } + } + + /* Give focus to parent window */ + SetFocusedWindow(this->parent); + + break; + case OSK_WIDGET_BACKSPACE: if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateParent(); break; |