X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0398b1d65dce1e2479ff41b272b815359655f5df..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/msw/notebook.cpp?ds=sidebyside diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index f8d4ed27d1..d2fe79e557 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -22,16 +22,16 @@ // wxWindows #ifndef WX_PRECOMP - #include + #include "wx/string.h" #endif // WX_PRECOMP -#include -#include -#include -#include -#include +#include "wx/log.h" +#include "wx/imaglist.h" +#include "wx/event.h" +#include "wx/control.h" +#include "wx/notebook.h" -#include +#include "wx/msw/private.h" // Windows standard headers #ifndef __WIN95__ @@ -329,6 +329,9 @@ bool wxNotebook::RemovePage(int nPage) m_aPages.Remove(nPage); + if ( m_aPages.IsEmpty() ) + m_nSelection = -1; + return TRUE; } @@ -344,6 +347,8 @@ bool wxNotebook::DeleteAllPages() TabCtrl_DeleteAllItems(m_hwnd); + m_nSelection = -1; + return TRUE; } @@ -414,8 +419,6 @@ bool wxNotebook::InsertPage(int nPage, GetSize((int *)&rc.right, (int *)&rc.bottom); TabCtrl_AdjustRect(m_hwnd, FALSE, &rc); pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); - if ( pPage->GetAutoLayout() ) - pPage->Layout(); // some page should be selected: either this one or the first one if there is @@ -448,8 +451,6 @@ void wxNotebook::OnSize(wxSizeEvent& event) for ( size_t nPage = 0; nPage < nCount; nPage++ ) { wxNotebookPage *pPage = m_aPages[nPage]; pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); - if ( pPage->GetAutoLayout() ) - pPage->Layout(); } event.Skip();