X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92976ab62b850005f9b1e506d0e5ccf2ed465c15..50ef256ed3e52defe91655da5e3f6a9e913c9e2a:/src/msw/notebook.cpp?ds=inline diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 28577f7992..34e0b589af 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -27,20 +27,26 @@ #include #include +#include +#include #include #include // Windows standard headers #ifndef __WIN95__ - #error "wxNotebook is not supported under Windows 3.1" + #error "wxNotebook is only supported Windows 95 and above" #endif //Win95 #include // for SetWindowFont +#ifndef __TWIN32__ #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" -#else //!GnuWin32 +#endif +#endif + +#if !defined(__GNUWIN32__) || defined(__TWIN32__) #include #endif @@ -358,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;