X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78ce938eb8d3c9bca866802151ed2fc6da2bf945..562e60a0f2ef165ab75c999eb8002d547c3585aa:/src/common/overlaycmn.cpp diff --git a/src/common/overlaycmn.cpp b/src/common/overlaycmn.cpp index 3936c87c10..0551e88cc7 100644 --- a/src/common/overlaycmn.cpp +++ b/src/common/overlaycmn.cpp @@ -116,7 +116,7 @@ void wxDCOverlay::Init(wxWindowDC *dc, int x , int y , int width , int height ) m_overlay.BeginDrawing(dc); } -void wxDCOverlay::Clear() +void wxDCOverlay::Clear() { m_overlay.Clear(m_dc); } @@ -125,13 +125,13 @@ void wxDCOverlay::Clear() // generic implementation of wxOverlayImpl // ---------------------------------------------------------------------------- -#if !wxHAS_NATIVE_OVERLAY +#ifndef wxHAS_NATIVE_OVERLAY wxOverlayImpl::wxOverlayImpl() { #if defined(__WXGTK__) || defined(__WXMSW__) m_window = NULL ; -#endif +#endif m_x = m_y = m_width = m_height = 0 ; } @@ -139,20 +139,26 @@ wxOverlayImpl::~wxOverlayImpl() { } -bool wxOverlayImpl::IsOk() +bool wxOverlayImpl::IsOk() { return m_bmpSaved.Ok() ; } void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height ) { -#if defined(__WXGTK__) - m_window = dc->m_owner; +#if defined(__WXGTK20__) +#if wxUSE_NEW_DC + wxImplDC *impl = dc->GetImpl(); + wxGTKWindowImplDC *gtk_impl = wxDynamicCast( impl, wxGTKWindowImplDC ); + if (gtk_impl) + m_window = gtk_impl->m_owningWindow; #else - #if defined (__WXMSW__) + m_window = dc->m_owningWindow; +#endif +#elif defined(__WXGTK__) + m_window = dc->m_owner; +#elif defined(__WXMSW__) m_window = dc->GetWindow(); - #endif // __WXMSW__ - #endif wxMemoryDC dcMem ; m_bmpSaved.Create( width, height ); @@ -171,7 +177,7 @@ void wxOverlayImpl::Init( wxWindowDC* dc, int x , int y , int width , int height dcMem.SelectObject( wxNullBitmap ); } -void wxOverlayImpl::Clear(wxWindowDC* dc) +void wxOverlayImpl::Clear(wxWindowDC* dc) { wxMemoryDC dcMem ; dcMem.SelectObject( m_bmpSaved );