+ TabCtrl_AdjustRect(GetHwnd(), false, &rc);
+
+ int width = rc.right - rc.left,
+ height = rc.bottom - rc.top;
+ size_t nCount = m_pages.Count();
+ for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
+ wxNotebookPage *pPage = m_pages[nPage];
+ pPage->SetSize(rc.left, rc.top, width, height);
+ }
+
+
+ // unless we had already repainted everything, we now need to refresh
+ if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
+ {
+ // invalidate areas not covered by pages
+ RefreshRect(wxRect(0, 0, widthNbook, rc.top), false);
+ RefreshRect(wxRect(0, rc.top, rc.left, height), false);
+ RefreshRect(wxRect(0, rc.bottom, widthNbook, heightNbook - rc.bottom),
+ false);
+ RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.right, height),
+ false);
+ }
+
+#if USE_NOTEBOOK_ANTIFLICKER
+ // subclass the spin control used by the notebook to scroll pages to
+ // prevent it from flickering on resize
+ if ( !m_hasSubclassedUpdown )
+ {
+ // iterate over all child windows to find spin button
+ for ( HWND child = ::GetWindow(GetHwnd(), GW_CHILD);
+ child;
+ child = ::GetWindow(child, GW_HWNDNEXT) )
+ {
+ wxWindow *childWindow = wxFindWinFromHandle((WXHWND)child);
+
+ // see if it exists, if no wxWindow found then assume it's the spin
+ // btn
+ if ( !childWindow )
+ {
+ // subclass the spin button to override WM_ERASEBKGND
+ if ( !gs_wndprocNotebookSpinBtn )
+ gs_wndprocNotebookSpinBtn = (WXFARPROC)wxGetWindowProc(child);
+
+ wxSetWindowProc(child, wxNotebookSpinBtnWndProc);
+ m_hasSubclassedUpdown = true;
+ break;
+ }
+ }
+ }
+#endif // USE_NOTEBOOK_ANTIFLICKER
+
+ event.Skip();