X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3096bd2fa7b88105bc54c08e3c878585de1a9b91..c6e62f74fcac5b62889b59e7ce7a41d0ce884d7b:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index aec8a9979a..43b70d1dbb 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -83,7 +83,6 @@ // event table // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARIES BEGIN_EVENT_TABLE(wxNotebook, wxControl) EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) @@ -96,7 +95,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent) -#endif // ============================================================================ // implementation @@ -316,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 +330,11 @@ bool wxNotebook::RemovePage(int nPage) m_aPages.Remove(nPage); + if ( m_aPages.IsEmpty() ) + m_nSelection = -1; + else + m_nSelection = TabCtrl_GetCurSel(m_hwnd); + return TRUE; } @@ -344,6 +350,8 @@ bool wxNotebook::DeleteAllPages() TabCtrl_DeleteAllItems(m_hwnd); + m_nSelection = -1; + return TRUE; }