From ea34484ca3a572269c0f8872548cebc20219adbe Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 24 Feb 2009 19:34:01 +0000 Subject: [PATCH] focus fixes for wxAUINotebook (fixes #4361) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 690acc096b..cfeaa264a6 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3440,6 +3440,21 @@ void wxAuiNotebook::SetSelectionToWindow(wxWindow *win) const int idx = m_tabs.GetIdxFromWindow(win); wxCHECK_RET( idx != wxNOT_FOUND, _T("invalid notebook page") ); + + // since a tab was clicked, let the parent know that we received + // the focus, even if we will assign that focus immediately + // to the child tab in the SetSelection call below + // (the child focus event will also let wxAuiManager, if any, + // know that the notebook control has been activated) + + wxWindow* parent = GetParent(); + if (parent) + { + wxChildFocusEvent eventFocus(this); + parent->GetEventHandler()->ProcessEvent(eventFocus); + } + + SetSelection(idx); } -- 2.45.2