X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..f8d0234d39c66f3d1d7fc2346562cb96c8c7be20:/src/osx/carbon/dcclient.cpp diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 2a7404bd44..2ade63d5cc 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -96,6 +96,7 @@ void wxWindowDCImpl::DoGetSize( int* width, int* height ) const *height = m_height; } +#if wxOSX_USE_CARBON wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const { // wxScreenDC is derived from wxWindowDC, so a screen dc will @@ -103,7 +104,6 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const if (!m_window) return wxNullBitmap; -#if wxOSX_USE_CARBON ControlRef handle = (ControlRef) m_window->GetHandle(); if ( !handle ) return wxNullBitmap; @@ -136,10 +136,8 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const CGContextRestoreGState(context); return bmp; -#else - return wxNullBitmap; -#endif } +#endif /* * wxClientDCImpl @@ -182,6 +180,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner, window ) { + wxASSERT_MSG( window->MacGetCGContextRef() != NULL, _T("using wxPaintDC without being in a native paint event") ); wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); SetDeviceOrigin( origin.x, origin.y );