summaryrefslogtreecommitdiff
path: root/src/osk_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-09 01:22:29 +0000
committerrubidium <rubidium@openttd.org>2009-02-09 01:22:29 +0000
commit861e9cefb3c31f1cab46ddb068af7a3648f45b4a (patch)
tree2efbc4cf44063706f8bd6b787f55a92c57290fbb /src/osk_gui.cpp
parent9907742a0f73bdbbf578cd2b6c424b80d254fed1 (diff)
downloadopenttd-861e9cefb3c31f1cab46ddb068af7a3648f45b4a.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.cpp15
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;