diff --git a/include/wx/dc.h b/include/wx/dc.h index 847b7f64e5..cc0a48238e 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -269,6 +269,8 @@ public: wxWindow* GetWindow() const { return m_window; } + void SetWindow(wxWindow* w) { m_window = w; } + virtual bool IsOk() const { return m_ok; } // query capabilities @@ -1364,6 +1366,9 @@ protected: wxDCImpl * const m_pimpl; + void SetWindow(wxWindow* w) + { return m_pimpl->SetWindow(w); } + private: wxDECLARE_ABSTRACT_CLASS(wxDC); wxDECLARE_NO_COPY_CLASS(wxDC); diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index 4a29fda820..8fc23d66cd 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -153,6 +153,8 @@ public: wxBufferedPaintDC(wxWindow *window, wxBitmap& buffer, int style = wxBUFFER_CLIENT_AREA) : m_paintdc(window) { + SetWindow(window); + // If we're buffering the virtual window, scale the paint DC as well if (style & wxBUFFER_VIRTUAL_AREA) window->PrepareDC( m_paintdc ); @@ -167,6 +169,8 @@ public: wxBufferedPaintDC(wxWindow *window, int style = wxBUFFER_CLIENT_AREA) : m_paintdc(window) { + SetWindow(window); + // If we're using the virtual window, scale the paint DC as well if (style & wxBUFFER_VIRTUAL_AREA) window->PrepareDC( m_paintdc );