]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
some cleanup, and plug a few small holes
[wxWidgets.git] / src / msw / notebook.cpp
index a7fcdfa20261e770a221b02a2c705c6563b3bd76..cd19ed2b0d0e419e9282cab664a5899257498d8a 100644 (file)
 
 #if wxUSE_NOTEBOOK
 
-#include  "wx/notebook.h"
+#include "wx/notebook.h"
 
 #ifndef WX_PRECOMP
-    #include  "wx/string.h"
-    #include  "wx/dc.h"
-    #include  "wx/log.h"
-    #include  "wx/event.h"
-    #include  "wx/app.h"
-    #include  "wx/dcclient.h"
-    #include  "wx/dcmemory.h"
-    #include  "wx/control.h"
+    #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
+    #include "wx/string.h"
+    #include "wx/dc.h"
+    #include "wx/log.h"
+    #include "wx/event.h"
+    #include "wx/app.h"
+    #include "wx/dcclient.h"
+    #include "wx/dcmemory.h"
+    #include "wx/control.h"
 #endif  // WX_PRECOMP
 
-#include  "wx/imaglist.h"
-#include  "wx/sysopt.h"
+#include "wx/imaglist.h"
+#include "wx/sysopt.h"
 
-#include  "wx/msw/private.h"
+#include "wx/msw/private.h"
 
-#include  <windowsx.h>
+#include <windowsx.h>
 #include "wx/msw/winundef.h"
 
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
-
 #if wxUSE_UXTHEME
     #include "wx/msw/uxtheme.h"
 #endif
@@ -763,6 +761,13 @@ bool wxNotebook::InsertPage(size_t nPage,
         return false;
     }
 
+    // need to update the bg brush when the first page is added
+    // so the first panel gets the correct themed background
+    if ( m_pages.empty() )
+    {
+        UpdateBgBrush();
+    }
+
     // succeeded: save the pointer to the page
     m_pages.Insert(pPage, nPage);
 
@@ -821,7 +826,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
             *flags |= wxBK_HITTEST_ONICON;
         if ((hitTestInfo.flags & TCHT_ONITEMLABEL) == TCHT_ONITEMLABEL)
             *flags |= wxBK_HITTEST_ONLABEL;
-        if ( item == wxNOT_FOUND && GetPageSize().Inside(pt) )
+        if ( item == wxNOT_FOUND && GetPageSize().Contains(pt) )
             *flags |= wxBK_HITTEST_ONPAGE;
     }