]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
help search is much faster now (7 times! that's what I call optimization ;-)
[wxWidgets.git] / src / msw / notebook.cpp
index 8f6ad71029e5350d768a3a444c73d50e54ade519..185a915c58371ac75858c62ce13781887ced3fe4 100644 (file)
@@ -83,7 +83,7 @@
 // event table
 // ----------------------------------------------------------------------------
 
-  BEGIN_EVENT_TABLE(wxNotebook, wxControl)
+BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
 
     EVT_SIZE(wxNotebook::OnSize)
     EVT_SET_FOCUS(wxNotebook::OnSetFocus)
 
     EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
-  END_EVENT_TABLE()
+END_EVENT_TABLE()
 
-  IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
-  IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
 // ============================================================================
 // implementation
@@ -314,6 +314,9 @@ bool wxNotebook::DeletePage(int nPage)
       // no selection if the notebook became empty
       m_nSelection = -1;
   }
+  else
+      m_nSelection = TabCtrl_GetCurSel(m_hwnd);
+
 
   return TRUE;
 }
@@ -329,6 +332,8 @@ bool wxNotebook::RemovePage(int nPage)
 
   if ( m_aPages.IsEmpty() )
       m_nSelection = -1;
+    else
+      m_nSelection = TabCtrl_GetCurSel(m_hwnd);
 
   return TRUE;
 }