]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
Test using wxString::ToCDouble() in wxAny.
[wxWidgets.git] / src / msw / notebook.cpp
index 1d69e439bbe43f7fb73cda7a8d1cec1c180c0324..6b171c7a7479323934735687b92a3af99eb417ce 100644 (file)
@@ -736,6 +736,14 @@ bool wxNotebook::InsertPage(size_t nPage,
     if ( m_pages.GetCount() == 1 || HasFlag(wxNB_MULTILINE) )
     {
         AdjustPageSize(pPage);
+
+        // Additionally, force the layout of the notebook itself by posting a
+        // size event to it. If we don't do it, notebooks with pages on the
+        // left or the right side may fail to account for the fact that they
+        // are now big enough to fit all all of their pages on one row and
+        // still reserve space for the second row of tabs, see #1792.
+        const wxSize s = GetSize();
+        ::PostMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED, MAKELPARAM(s.x, s.y));
     }
 
     // now deal with the selection
@@ -1317,11 +1325,11 @@ bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result)
   NMHDR* hdr = (NMHDR *)lParam;
   switch ( hdr->code ) {
     case TCN_SELCHANGE:
-      event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
+      event.SetEventType(wxEVT_NOTEBOOK_PAGE_CHANGED);
       break;
 
     case TCN_SELCHANGING:
-      event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING);
+      event.SetEventType(wxEVT_NOTEBOOK_PAGE_CHANGING);
       break;
 
     default: