diff options
author | alberth <alberth@openttd.org> | 2009-06-04 14:07:05 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-06-04 14:07:05 +0000 |
commit | b144a5451cb451d91bacafd80cab04640d1c1af1 (patch) | |
tree | 9eb3dc83f5dfd3b398f76ce3784fef22cdd5767b /src/osk_gui.cpp | |
parent | 1a4934ef070aee3e506603707850de28c7f872cd (diff) | |
download | openttd-b144a5451cb451d91bacafd80cab04640d1c1af1.tar.xz |
(svn r16516) -Codechange: Added click and drag handling for nested widgets.
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r-- | src/osk_gui.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 1b2a825d4..43b434edb 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -149,8 +149,14 @@ struct OskWindow : public Window { switch (widget) { case OSK_WIDGET_TEXT: { /* Find the edit box of the parent window and give focus to that */ - const Widget *wi = this->parent->GetWidgetOfType(WWT_EDITBOX); - if (wi != NULL) this->parent->focused_widget = wi; + if (this->parent->widget != NULL) { + const Widget *wi = this->parent->GetWidgetOfType(WWT_EDITBOX); + if (wi != NULL) this->parent->focused_widget = wi; + } + if (this->parent->nested_root != NULL) { + const NWidgetCore *nwid = dynamic_cast<const NWidgetCore *>(this->parent->nested_root->GetWidgetOfType(WWT_EDITBOX)); + if (nwid != NULL) this->parent->nested_focus = nwid; + } /* Give focus to parent window */ SetFocusedWindow(this->parent); |