]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibook.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / aui / auibook.cpp
index f387d6ed67654c7b1cd77174075863f272b5ba70..048229f35fb6d3400a0c5f7f005b552e85316527 100644 (file)
@@ -194,9 +194,7 @@ wxAuiDefaultTabArt::wxAuiDefaultTabArt()
     m_tab_ctrl_height = 0;
 
 #ifdef __WXMAC__
-    wxBrush toolbarbrush;
-    toolbarbrush.MacSetTheme( kThemeBrushToolbarBackground );
-    wxColor base_colour = toolbarbrush.GetColour();
+    wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
 #else
     wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
 #endif
@@ -2865,6 +2863,9 @@ void wxAuiNotebook::InitNotebook(long style)
 
 wxAuiNotebook::~wxAuiNotebook()
 {
+    // Indicate we're deleting pages
+    m_isBeingDeleted = true;
+
     while ( GetPageCount() > 0 )
         DeletePage(0);
 
@@ -3061,6 +3062,10 @@ bool wxAuiNotebook::InsertPage(size_t page_idx,
                                bool select,
                                const wxBitmap& bitmap)
 {
+    wxASSERT_MSG(page, wxT("page pointer must be non-NULL"));
+    if (!page)
+        return false;
+    
     page->Reparent(this);
 
     wxAuiNotebookPage info;
@@ -3225,7 +3230,7 @@ bool wxAuiNotebook::RemovePage(size_t page_idx)
     RemoveEmptyTabFrames();
 
     // set new active pane
-    if (new_active)
+    if (new_active && !m_isBeingDeleted)
     {
         m_curpage = -1;
         SetSelectionToWindow(new_active);
@@ -4104,7 +4109,8 @@ void wxAuiNotebook::RemoveEmptyTabFrames()
         m_mgr.GetPane(first_good).Centre();
     }
 
-    m_mgr.Update();
+    if (!m_isBeingDeleted)
+        m_mgr.Update();
 }
 
 void wxAuiNotebook::OnChildFocusNotebook(wxChildFocusEvent& evt)