- // Blits the buffer to the dc, and detaches the dc from
- // the buffer. Usually called in the dtor or by the dtor
- // of derived classes if the BufferedDC must blit before
- // the derived class (which may own the dc it's blitting
- // to) is destroyed.
+private:
+ // check that the bitmap is valid and use it
+ void UseBuffer()
+ {
+ wxASSERT_MSG( m_buffer.Ok(), _T("invalid bitmap in wxBufferedDC") );
+
+ SelectObject(m_buffer);
+ }
+
+ // preserve the background if necessary
+ void SaveBg(const wxSize& area, int flags)
+ {
+ if ( flags & wxBUFFER_DC_PRESERVE_BG )
+ {
+ Blit(0, 0, area.GetWidth(), area.GetHeight(), m_dc, 0, 0);
+ }
+ }
+
+ // Without the existence of a wxNullDC, this must be
+ // a pointer, else it could probably be a reference.
+ wxDC *m_dc;