X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/96d3780753c7f6acfa4e29c1365f8abbfaba8f8c..24bd64eec17776d9f3ad4cabcd13697e56f568d1:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index d94b86b315..6c0c06db8e 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -424,7 +424,23 @@ void wxNotebook::OnSelChange(wxNotebookEvent& event) { // is it our tab control? if ( event.GetEventObject() == this ) - ChangePage(event.GetOldSelection(), event.GetSelection()); + { + // don't call ChangePage() here because it will generate redundant + // notification events + int sel = event.GetOldSelection(); + if ( sel != -1 ) + m_aPages[sel]->Show(FALSE); + + sel = event.GetSelection(); + if ( sel != -1 ) + { + wxNotebookPage *pPage = m_aPages[sel]; + pPage->Show(TRUE); + pPage->SetFocus(); + } + + m_nSelection = sel; + } // we want to give others a chance to process this message as well event.Skip();