]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/auibook.cpp
rename gsockmsw files to sockmsw
[wxWidgets.git] / src / aui / auibook.cpp
index 30409be22fa7e485d1c3dafa36420d6d792e0a9a..dc5ce849495170c46e3fd6333c4e382c41101a3b 100644 (file)
@@ -34,7 +34,9 @@
 #include "wx/renderer.h"
 
 #ifdef __WXMAC__
 #include "wx/renderer.h"
 
 #ifdef __WXMAC__
-#include "wx/osx/carbon/private.h"
+#include "wx/osx/private.h"
+// for themeing support
+#include <Carbon/Carbon.h>
 #endif
 
 #include "wx/arrimpl.cpp"
 #endif
 
 #include "wx/arrimpl.cpp"
@@ -193,7 +195,7 @@ wxAuiDefaultTabArt::wxAuiDefaultTabArt()
     m_fixed_tab_width = 100;
     m_tab_ctrl_height = 0;
 
     m_fixed_tab_width = 100;
     m_tab_ctrl_height = 0;
 
-#ifdef __WXMAC__
+#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
     wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
 #else
     wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
     wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
 #else
     wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
@@ -2191,6 +2193,7 @@ BEGIN_EVENT_TABLE(wxAuiTabCtrl, wxControl)
     EVT_SET_FOCUS(wxAuiTabCtrl::OnSetFocus)
     EVT_KILL_FOCUS(wxAuiTabCtrl::OnKillFocus)
     EVT_CHAR(wxAuiTabCtrl::OnChar)
     EVT_SET_FOCUS(wxAuiTabCtrl::OnSetFocus)
     EVT_KILL_FOCUS(wxAuiTabCtrl::OnKillFocus)
     EVT_CHAR(wxAuiTabCtrl::OnChar)
+    EVT_MOUSE_CAPTURE_LOST(wxAuiTabCtrl::OnCaptureLost)
 END_EVENT_TABLE()
 
 
 END_EVENT_TABLE()
 
 
@@ -2273,6 +2276,10 @@ void wxAuiTabCtrl::OnLeftDown(wxMouseEvent& evt)
     }
 }
 
     }
 }
 
+void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
+{
+}
+
 void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
 {
     if (GetCapture() == this)
 void wxAuiTabCtrl::OnLeftUp(wxMouseEvent& evt)
 {
     if (GetCapture() == this)
@@ -2712,16 +2719,23 @@ public:
 
         for (i = 0; i < page_count; ++i)
         {
 
         for (i = 0; i < page_count; ++i)
         {
+            int height = m_rect.height - m_tab_ctrl_height;
+            if ( height < 0 )
+            {
+                // avoid passing negative height to wxWindow::SetSize(), this
+                // results in assert failures/GTK+ warnings
+                height = 0;
+            }
+
             wxAuiNotebookPage& page = pages.Item(i);
             if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
             {
             wxAuiNotebookPage& page = pages.Item(i);
             if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
             {
-                page.window->SetSize(m_rect.x, m_rect.y,
-                                     m_rect.width, m_rect.height - m_tab_ctrl_height);
+                page.window->SetSize(m_rect.x, m_rect.y, m_rect.width, height);
             }
             else //TODO: if (GetFlags() & wxAUI_NB_TOP)
             {
                 page.window->SetSize(m_rect.x, m_rect.y + m_tab_ctrl_height,
             }
             else //TODO: if (GetFlags() & wxAUI_NB_TOP)
             {
                 page.window->SetSize(m_rect.x, m_rect.y + m_tab_ctrl_height,
-                                  m_rect.width, m_rect.height - m_tab_ctrl_height);
+                                     m_rect.width, height);
             }
             // TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
             // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
             }
             // TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
             // TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
@@ -4250,7 +4264,7 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt)
         {
             // if the close button is to the right, use the active
             // page selection to determine which page to close
         {
             // if the close button is to the right, use the active
             // page selection to determine which page to close
-            selection = GetSelection();
+            selection = tabs->GetActivePage();
         }
 
         if (selection != -1)
         }
 
         if (selection != -1)