From b144a5451cb451d91bacafd80cab04640d1c1af1 Mon Sep 17 00:00:00 2001 From: alberth Date: Thu, 4 Jun 2009 14:07:05 +0000 Subject: (svn r16516) -Codechange: Added click and drag handling for nested widgets. --- src/osk_gui.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/osk_gui.cpp') 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(this->parent->nested_root->GetWidgetOfType(WWT_EDITBOX)); + if (nwid != NULL) this->parent->nested_focus = nwid; + } /* Give focus to parent window */ SetFocusedWindow(this->parent); -- cgit v1.2.3-54-g00ecf