]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/dockart.cpp
Fix broken and missing DataView interface items for Phoenix
[wxWidgets.git] / src / aui / dockart.cpp
index 48b2336d93f87d1cabf3c7f3b4e74d45af00ee9e..8187939b028984f9039636d238bc6c56955c00cc 100644 (file)
@@ -27,6 +27,8 @@
 
 #include "wx/aui/framemanager.h"
 #include "wx/aui/dockart.h"
+#include "wx/aui/auibook.h"
+#include "wx/aui/tabart.h"
 
 #ifndef WX_PRECOMP
     #include "wx/settings.h"
 #ifdef __WXGTK__
 #include <gtk/gtk.h>
 #include "wx/renderer.h"
-#if GTK_CHECK_VERSION(2,0,0)
+#ifdef __WXGTK20__
    #include "wx/gtk/private/gtk2-compat.h"
 #else
    #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
 #endif
+#ifdef __WXGTK3__
+    #include "wx/graphics.h"
+#endif
 #endif
 
 
@@ -420,11 +425,17 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation,
     gtk_paint_handle
     (
         gtk_widget_get_style(window->m_wxwindow),
+#ifdef __WXGTK3__
+        static_cast<cairo_t*>(dc.GetGraphicsContext()->GetNativeContext()),
+#else
         window->GTKGetDrawingWindow(),
+#endif
         // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
         GTK_STATE_NORMAL,
         GTK_SHADOW_NONE,
+#ifndef __WXGTK3__
         NULL /* no clipping */,
+#endif
         window->m_wxwindow,
         "paned",
         rect.x,
@@ -457,7 +468,7 @@ void wxAuiDefaultDockArt::DrawBackground(wxDC& dc, wxWindow *WXUNUSED(window), i
     dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
 }
 
-void wxAuiDefaultDockArt::DrawBorder(wxDC& dc, wxWindow *WXUNUSED(window), const wxRect& _rect,
+void wxAuiDefaultDockArt::DrawBorder(wxDC& dc, wxWindow* window, const wxRect& _rect,
                                   wxAuiPaneInfo& pane)
 {
     dc.SetPen(m_borderPen);
@@ -483,10 +494,21 @@ void wxAuiDefaultDockArt::DrawBorder(wxDC& dc, wxWindow *WXUNUSED(window), const
     }
     else
     {
-        for (i = 0; i < border_width; ++i)
+        // notebooks draw the border themselves, so they can use native rendering (e.g. tabartgtk)
+        wxAuiTabArt* art = 0;
+        wxAuiNotebook* nb = wxDynamicCast(window, wxAuiNotebook);
+        if (nb)
+            art = nb->GetArtProvider();
+
+        if (art)
+            art->DrawBorder(dc, window, rect);
+        else
         {
-            dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
-            rect.Deflate(1);
+            for (i = 0; i < border_width; ++i)
+            {
+                dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
+                rect.Deflate(1);
+            }
         }
     }
 }