X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2646f485163f410baaad5bcf49028c604a352d19..277ccdafe111a97a22431a4acc81b9e9ef7c2f8a:/src/mac/classic/dcmemory.cpp diff --git a/src/mac/classic/dcmemory.cpp b/src/mac/classic/dcmemory.cpp index e850a59e4d..ad765139d9 100644 --- a/src/mac/classic/dcmemory.cpp +++ b/src/mac/classic/dcmemory.cpp @@ -1,19 +1,18 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dcmemory.cpp +// Name: src/mac/classic/dcmemory.cpp // Purpose: wxMemoryDC class // Author: Stefan Csomor // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "dcmemory.h" -#endif +#include "wx/wxprec.h" #include "wx/dcmemory.h" + #include "wx/mac/private.h" //----------------------------------------------------------------------------- @@ -22,24 +21,27 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) -wxMemoryDC::wxMemoryDC(void) -: m_selected() +wxMemoryDC::wxMemoryDC( const wxBitmap& bitmap ) + : m_selected() { - m_ok = TRUE; + m_ok = true; SetBackground(*wxWHITE_BRUSH); SetBrush(*wxWHITE_BRUSH); SetPen(*wxBLACK_PEN); - m_ok = FALSE; + m_ok = false; + + if ( bitmap.IsOk() ) + SelectObject(bitmap); }; wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) -: m_selected() + : m_selected() { - m_ok = TRUE; + m_ok = true; SetBackground(*wxWHITE_BRUSH); SetBrush(*wxWHITE_BRUSH); SetPen(*wxBLACK_PEN); - m_ok = FALSE; + m_ok = false; }; wxMemoryDC::~wxMemoryDC() @@ -70,16 +72,16 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) } SetRectRgn( (RgnHandle) m_macBoundaryClipRgn , 0 , 0 , m_selected.GetWidth() , m_selected.GetHeight() ) ; CopyRgn( (RgnHandle) m_macBoundaryClipRgn ,(RgnHandle) m_macCurrentClipRgn ) ; - m_ok = TRUE ; + m_ok = true ; } else { - m_ok = FALSE; + m_ok = false; } } else { - m_ok = FALSE; + m_ok = false; } } @@ -96,5 +98,3 @@ void wxMemoryDC::DoGetSize( int *width, int *height ) const if (height) (*height) = 0; } } - -