]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/art_aui.cpp
Improve support for ribbon panel sizers: panels with sizers should now automatically...
[wxWidgets.git] / src / ribbon / art_aui.cpp
index 0e452bdd6bbefa09a8c1d292692204c90f6c585e..2c7d56de4211f287223086b350a27cdc9d1c5bd9 100644 (file)
@@ -33,8 +33,6 @@
 #include "wx/msw/private.h"
 #elif defined(__WXMAC__)
 #include "wx/osx/private.h"
 #include "wx/msw/private.h"
 #elif defined(__WXMAC__)
 #include "wx/osx/private.h"
-// only for kThemeBrushToolbarBackground
-#include <Carbon/Carbon.h>
 #endif
 
 wxRibbonAUIArtProvider::wxRibbonAUIArtProvider()
 #endif
 
 wxRibbonAUIArtProvider::wxRibbonAUIArtProvider()
@@ -389,9 +387,12 @@ void wxRibbonAUIArtProvider::DrawTab(wxDC& dc,
         icon = tab.page->GetIcon();
         if((m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) == 0)
         {
         icon = tab.page->GetIcon();
         if((m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS) == 0)
         {
+            if(icon.IsOk())
+            {
             int x = tab.rect.x + (tab.rect.width - icon.GetWidth()) / 2;
             dc.DrawBitmap(icon, x, tab.rect.y + 1 + (tab.rect.height - 1 -
                 icon.GetHeight()) / 2, true);
             int x = tab.rect.x + (tab.rect.width - icon.GetWidth()) / 2;
             dc.DrawBitmap(icon, x, tab.rect.y + 1 + (tab.rect.height - 1 -
                 icon.GetHeight()) / 2, true);
+            }
         }
     }
     if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
         }
     }
     if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
@@ -863,7 +864,7 @@ void wxRibbonAUIArtProvider::DrawGalleryBackground(
     dc.SetPen(m_gallery_border_pen);
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
     dc.SetPen(m_gallery_border_pen);
     dc.SetBrush(*wxTRANSPARENT_BRUSH);
     dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
-    
+
     DrawGalleryBackgroundCommon(dc, wnd, rect);
 }
 
     DrawGalleryBackgroundCommon(dc, wnd, rect);
 }
 
@@ -1121,7 +1122,7 @@ void wxRibbonAUIArtProvider::DrawTool(
         avail_width -= 8;
         if(is_split_hybrid)
         {
         avail_width -= 8;
         if(is_split_hybrid)
         {
-            dc.DrawLine(rect.x + avail_width + 1, rect.y, 
+            dc.DrawLine(rect.x + avail_width + 1, rect.y,
                 rect.x + avail_width + 1, rect.y + rect.height);
         }
         dc.DrawBitmap(m_toolbar_drop_bitmap, bg_rect.x + avail_width + 2,
                 rect.x + avail_width + 1, rect.y + rect.height);
         }
         dc.DrawBitmap(m_toolbar_drop_bitmap, bg_rect.x + avail_width + 2,