X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..ec5006bdc630dd6b3d4cad1a3b572ab4c695a029:/src/mac/classic/dcmemory.cpp diff --git a/src/mac/classic/dcmemory.cpp b/src/mac/classic/dcmemory.cpp index b1be90dbe9..ad765139d9 100644 --- a/src/mac/classic/dcmemory.cpp +++ b/src/mac/classic/dcmemory.cpp @@ -1,15 +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 ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + #include "wx/dcmemory.h" + #include "wx/mac/private.h" //----------------------------------------------------------------------------- @@ -18,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() @@ -66,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; } } @@ -92,5 +98,3 @@ void wxMemoryDC::DoGetSize( int *width, int *height ) const if (height) (*height) = 0; } } - -