}
// Construct a wxBufferedDC with an internal buffer of 'area'
// (where area is usually something like the size of the window
// being buffered)
}
// Construct a wxBufferedDC with an internal buffer of 'area'
// (where area is usually something like the size of the window
// being buffered)
void Init(wxDC *dc,
const wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA)
{
InitCommon(dc, style);
void Init(wxDC *dc,
const wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA)
{
InitCommon(dc, style);
- wxCHECK_RET( m_dc, _T("No underlying DC in wxBufferedDC") );
+ wxCHECK_RET( m_dc, _T("no underlying wxDC?") );
+ wxASSERT_MSG( m_buffer.IsOk(), _T("invalid backing store") );
- m_dc->Blit(0, 0, m_buffer->GetWidth(), m_buffer->GetHeight(),
+ m_dc->Blit(0, 0, m_buffer.GetWidth(), m_buffer.GetHeight(),
// common part of Init()s
void InitCommon(wxDC *dc, int style)
{
// common part of Init()s
void InitCommon(wxDC *dc, int style)
{
- wxASSERT_MSG( !m_dc && !m_buffer, _T("wxBufferedDC already initialised") );
- wxCHECK_RET( dc, _T("can't associate NULL DC with wxBufferedDC") );
+ wxASSERT_MSG( !m_dc, _T("wxBufferedDC already initialised") );
Init(&m_paintdc, buffer, style);
else
Init(&m_paintdc, window->GetClientSize(), style);
Init(&m_paintdc, buffer, style);
else
Init(&m_paintdc, window->GetClientSize(), style);