X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..1ba0367603b07756b5524067eaa5c6962d059edd:/src/aui/auibook.cpp?ds=sidebyside diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 607722c115..cfeaa264a6 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2898,7 +2898,7 @@ void wxAuiNotebook::InitNotebook(long style) wxAuiNotebook::~wxAuiNotebook() { // Indicate we're deleting pages - m_isBeingDeleted = true; + SendDestroyEvent(); while ( GetPageCount() > 0 ) DeletePage(0); @@ -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); }