X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c3ead1d1513a5eb79091a604f4e42b45d1bdf5d..3571e1add4e6ceb45ad88c224c432609f837a8dd:/src/ribbon/panel.cpp diff --git a/src/ribbon/panel.cpp b/src/ribbon/panel.cpp index 69225d32c9..bb6257dfcf 100644 --- a/src/ribbon/panel.cpp +++ b/src/ribbon/panel.cpp @@ -8,21 +8,23 @@ // Copyright: (C) Peter Cawley // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// + #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#if wxUSE_RIBBON + +#include "wx/ribbon/panel.h" #include "wx/ribbon/art.h" #include "wx/ribbon/bar.h" -#include "wx/ribbon/panel.h" #include "wx/dcbuffer.h" #include "wx/display.h" -#if wxUSE_RIBBON - #ifndef WX_PRECOMP +#include "wx/frame.h" #endif #ifdef __WXMSW__ @@ -41,7 +43,7 @@ BEGIN_EVENT_TABLE(wxRibbonPanel, wxRibbonControl) EVT_SIZE(wxRibbonPanel::OnSize) END_EVENT_TABLE() -wxRibbonPanel::wxRibbonPanel() +wxRibbonPanel::wxRibbonPanel() : m_expanded_dummy(NULL), m_expanded_panel(NULL) { } @@ -308,7 +310,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) @@ -405,7 +407,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) @@ -414,7 +416,7 @@ wxSize wxRibbonPanel::DoGetNextLargerSize(wxOrientation direction, } else { - wxMemoryDC dc; + wxClientDC dc((wxRibbonPanel*) this); return m_art->GetPanelSize(dc, this, larger, NULL); } } @@ -471,7 +473,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); } @@ -486,7 +488,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); } @@ -521,7 +523,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); @@ -582,7 +584,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()); }