From 4fa688d8bced718a7ef35d4ebd3c4db6eb2afa7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 Jan 1999 23:53:21 +0000 Subject: [PATCH] "selection changed" events are not generated any more when notebook changes size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/notebook.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 07112916d4..34e0b589af 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -364,11 +364,13 @@ bool wxNotebook::InsertPage(int nPage, void wxNotebook::OnSize(wxSizeEvent& event) { - // emulate page change (it's esp. important to do it first time because - // otherwise our page would stay invisible) - int nSel = m_nSelection; - m_nSelection = -1; - SetSelection(nSel); + // make sure the current page is shown and has focus (it's useful because all + // pages are created invisible initially) + if ( m_nSelection != -1 ) { + wxNotebookPage *pPage = m_aPages[m_nSelection]; + pPage->Show(TRUE); + pPage->SetFocus(); + } // fit the notebook page to the tab control's display area RECT rc; -- 2.47.2