]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixes for Mac (use wxClientDC not wxMemoryDC for temporary DC)
authorJulian Smart <julian@anthemion.co.uk>
Fri, 18 Sep 2009 09:01:43 +0000 (09:01 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 18 Sep 2009 09:01:43 +0000 (09:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/ribbon/bar.cpp
src/ribbon/buttonbar.cpp
src/ribbon/panel.cpp

index 3aa34770023c4a13f29e79c9e9dc88dc1c920d83..6f285d7bda27fabd6f0cdf0074a1258749500951 100644 (file)
@@ -66,7 +66,7 @@ void wxRibbonBar::AddPage(wxRibbonPage *page)
     info.hovered = false;
     // info.rect not set (intentional)
 
-    wxMemoryDC dcTemp;
+    wxClientDC dcTemp(this);
     wxString label = wxEmptyString;
     if(m_flags & wxRIBBON_BAR_SHOW_PAGE_LABELS)
         label = page->GetLabel();
@@ -124,7 +124,7 @@ bool wxRibbonBar::Realize()
 {
     bool status = true;
 
-    wxMemoryDC dcTemp;
+    wxClientDC dcTemp(this);
     int sep = m_art->GetMetric(wxRIBBON_ART_TAB_SEPARATION_SIZE);
     size_t numtabs = m_pages.GetCount();
     size_t i;
@@ -377,7 +377,7 @@ void wxRibbonBar::RecalculateTabSizes()
             m_tab_scroll_buttons_shown = true;
         }
         {
-            wxMemoryDC temp_dc;
+            wxClientDC temp_dc(this);
             m_tab_scroll_left_button_rect.SetWidth(m_art->GetScrollButtonMinimumSize(temp_dc, this, wxRIBBON_SCROLL_BTN_LEFT | wxRIBBON_SCROLL_BTN_NORMAL | wxRIBBON_SCROLL_BTN_FOR_TABS).GetWidth());
             m_tab_scroll_left_button_rect.SetHeight(m_tab_height);
             m_tab_scroll_left_button_rect.SetX(m_tab_margin_left);
@@ -846,7 +846,7 @@ void wxRibbonBar::ScrollTabBar(int amount)
     if(show_right != (m_tab_scroll_right_button_rect.GetWidth() != 0) ||
         show_left != (m_tab_scroll_left_button_rect.GetWidth() != 0))
     {
-        wxMemoryDC temp_dc;
+        wxClientDC temp_dc(this);
         if(show_left)
         {
             m_tab_scroll_left_button_rect.SetWidth(m_art->GetScrollButtonMinimumSize(temp_dc, this, wxRIBBON_SCROLL_BTN_LEFT | wxRIBBON_SCROLL_BTN_NORMAL | wxRIBBON_SCROLL_BTN_FOR_TABS).GetWidth());
index b70f563f40f7b738e8bd5a4d95e1aeab1b3e5356..52d8e52e0a7c0655ce4ad1767e1555edad9ec8e4 100644 (file)
@@ -333,7 +333,7 @@ wxRibbonButtonBarButtonBase* wxRibbonButtonBar::AddButton(
     base->client_data = client_data;
     base->state = 0;
 
-    wxMemoryDC temp_dc;
+    wxClientDC temp_dc(this);
     FetchButtonSizeInfo(base, wxRIBBON_BUTTONBAR_BUTTON_SMALL, temp_dc);
     FetchButtonSizeInfo(base, wxRIBBON_BUTTONBAR_BUTTON_MEDIUM, temp_dc);
     FetchButtonSizeInfo(base, wxRIBBON_BUTTONBAR_BUTTON_LARGE, temp_dc);
@@ -454,7 +454,7 @@ void wxRibbonButtonBar::SetArtProvider(wxRibbonArtProvider* art)
 
     wxRibbonControl::SetArtProvider(art);
 
-    wxMemoryDC temp_dc;
+    wxClientDC temp_dc(this);
     size_t btn_count = m_buttons.Count();
     size_t btn_i;
     for(btn_i = 0; btn_i < btn_count; ++btn_i)
index b136bb12a24cb0f983e44b76d9e2c764deee4106..68a8d216e8acd3aac6b1a28909799dc68685460f 100644 (file)
@@ -309,7 +309,7 @@ wxSize wxRibbonPanel::DoGetNextSmallerSize(wxOrientation direction,
         wxRibbonControl* ribbon_child = wxDynamicCast(child, wxRibbonControl);
         if(m_art != NULL && ribbon_child != NULL)
         {
-            wxMemoryDC dc;
+            wxClientDC dc((wxRibbonPanel*) this);
             wxSize child_relative = m_art->GetPanelClientSize(dc, this, relative_to, NULL);
             wxSize smaller = ribbon_child->GetNextSmallerSize(direction, child_relative);
             if(smaller == child_relative)
@@ -406,7 +406,7 @@ wxSize wxRibbonPanel::DoGetNextLargerSize(wxOrientation direction,
         wxRibbonControl* ribbon_child = wxDynamicCast(child, wxRibbonControl);
         if(ribbon_child != NULL)
         {
-            wxMemoryDC dc;
+            wxClientDC dc((wxRibbonPanel*) this);
             wxSize child_relative = m_art->GetPanelClientSize(dc, this, relative_to, NULL);
             wxSize larger = ribbon_child->GetNextLargerSize(direction, child_relative);
             if(larger == child_relative)
@@ -415,7 +415,7 @@ wxSize wxRibbonPanel::DoGetNextLargerSize(wxOrientation direction,
             }
             else
             {
-                wxMemoryDC dc;
+                wxClientDC dc((wxRibbonPanel*) this);
                 return m_art->GetPanelSize(dc, this, larger, NULL);
             }
         }
@@ -472,7 +472,7 @@ wxSize wxRibbonPanel::GetMinNotMinimisedSize() const
     if(GetChildren().GetCount() == 1)
     {
         wxWindow* child = GetChildren().Item(0)->GetData();
-        wxMemoryDC dc;
+        wxClientDC dc((wxRibbonPanel*) this);
         return m_art->GetPanelSize(dc, this, child->GetMinSize(), NULL);
     }
 
@@ -487,7 +487,7 @@ wxSize wxRibbonPanel::DoGetBestSize() const
     if(GetChildren().GetCount() == 1)
     {
         wxWindow* child = GetChildren().Item(0)->GetData();
-        wxMemoryDC dc;
+        wxClientDC dc((wxRibbonPanel*) this);
         return m_art->GetPanelSize(dc, this, child->GetBestSize(), NULL);
     }
 
@@ -522,7 +522,7 @@ bool wxRibbonPanel::Realize()
 
     if(m_art != NULL)
     {
-        wxMemoryDC temp_dc;
+        wxClientDC temp_dc(this);
 
         m_smallest_unminimised_size =
             m_art->GetPanelSize(temp_dc, this, minimum_children_size, NULL);
@@ -583,7 +583,7 @@ bool wxRibbonPanel::Layout()
     {
         wxWindow* child = GetChildren().Item(0)->GetData();
         wxPoint position;
-        wxMemoryDC dc;
+        wxClientDC dc(this);
         wxSize size = m_art->GetPanelClientSize(dc, this, GetSize(), &position);
         child->SetSize(position.x, position.y, size.GetWidth(), size.GetHeight());
     }