]> git.saurik.com Git - wxWidgets.git/commitdiff
"selection changed" events are not generated any more when notebook
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 31 Jan 1999 23:53:21 +0000 (23:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 31 Jan 1999 23:53:21 +0000 (23:53 +0000)
changes size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/notebook.cpp

index 07112916d4027cb94628c5e7972d84ce9118e1b5..34e0b589af998ad257ff1eb6b72cf8abf736f886 100644 (file)
@@ -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;