#include <wx/log.h>
#include <wx/imaglist.h>
+#include <wx/event.h>
+#include <wx/control.h>
#include <wx/notebook.h>
#include <wx/msw/private.h>
// 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 <windowsx.h> // for SetWindowFont
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
-#else //!GnuWin32
+#endif
+#endif
+
+#if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h>
#endif
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;