]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/dockart.cpp
Use shared pointers throughout when managing history with the ie backend, simplifying...
[wxWidgets.git] / src / aui / dockart.cpp
index 3d9675b2baa5bb3dab3582327c3b8baabe5abebb..17f7083874f4585a9daace6e02fce1bf34a37c13 100644 (file)
 #ifdef __WXGTK__
 #include <gtk/gtk.h>
 #include "wx/renderer.h"
+#if GTK_CHECK_VERSION(2,0,0)
+   #include "wx/gtk/private/gtk2-compat.h"
+#else
+   #define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
+#endif
 #endif
 
 
@@ -410,11 +415,11 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation,
 
     if (!window) return;
     if (!window->m_wxwindow) return;
-    if (!GTK_WIDGET_DRAWABLE(window->m_wxwindow)) return;
+    if (!gtk_widget_is_drawable(window->m_wxwindow)) return;
 
     gtk_paint_handle
     (
-        window->m_wxwindow->style,
+        gtk_widget_get_style(window->m_wxwindow),
         window->GTKGetDrawingWindow(),
         // flags & wxCONTROL_CURRENT ? GTK_STATE_PRELIGHT : GTK_STATE_NORMAL,
         GTK_STATE_NORMAL,
@@ -547,6 +552,14 @@ void wxAuiDefaultDockArt::DrawCaption(wxDC& dc, wxWindow *WXUNUSED(window),
     DrawCaptionBackground(dc, rect,
                           (pane.state & wxAuiPaneInfo::optionActive)?true:false);
 
+    int caption_offset = 0;
+    if ( pane.icon.IsOk() )
+    {
+        DrawIcon(dc, rect, pane);
+
+        caption_offset += pane.icon.GetWidth() + 3;
+    }
+
     if (pane.state & wxAuiPaneInfo::optionActive)
         dc.SetTextForeground(m_active_caption_text_colour);
     else
@@ -569,10 +582,19 @@ void wxAuiDefaultDockArt::DrawCaption(wxDC& dc, wxWindow *WXUNUSED(window),
     wxString draw_text = wxAuiChopText(dc, text, clip_rect.width);
 
     dc.SetClippingRegion(clip_rect);
-    dc.DrawText(draw_text, rect.x+3, rect.y+(rect.height/2)-(h/2)-1);
+    dc.DrawText(draw_text, rect.x+3 + caption_offset, rect.y+(rect.height/2)-(h/2)-1);
     dc.DestroyClippingRegion();
 }
 
+void
+wxAuiDefaultDockArt::DrawIcon(wxDC& dc, const wxRect& rect, wxAuiPaneInfo& pane)
+{
+   // Draw the icon centered vertically
+   dc.DrawBitmap(pane.icon,
+                 rect.x+2, rect.y+(rect.height-pane.icon.GetHeight())/2,
+                 true);
+}
+
 void wxAuiDefaultDockArt::DrawGripper(wxDC& dc, wxWindow *WXUNUSED(window),
                                    const wxRect& rect,
                                    wxAuiPaneInfo& pane)