// (where area is usually something like the size of the window
// being buffered)
wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA)
// (where area is usually something like the size of the window
// being buffered)
wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA)
- wxCHECK_RET( m_dc, _T("No underlying DC in wxBufferedDC") );
+ wxCHECK_RET( m_dc, _T("no underlying wxDC?") );
+ wxASSERT_MSG( m_buffer && m_buffer->IsOk(), _T("invalid backing store") );
// 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") );
: m_paintdc(window)
{
// If we're buffering the virtual window, scale the paint DC as well
if (style & wxBUFFER_VIRTUAL_AREA)
window->PrepareDC( m_paintdc );
: m_paintdc(window)
{
// If we're buffering the virtual window, scale the paint DC as well
if (style & wxBUFFER_VIRTUAL_AREA)
window->PrepareDC( m_paintdc );
Init(&m_paintdc, buffer, style);
else
Init(&m_paintdc, window->GetClientSize(), style);
Init(&m_paintdc, buffer, style);
else
Init(&m_paintdc, window->GetClientSize(), style);