From ee50eb743226f3aff8cddbe2136970ac5b6353d9 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Mon, 28 Apr 2008 02:29:44 +0000 Subject: [PATCH] Store the DC used to initialize wxGCDC, and make it retrievable. This helps with things like wxRenderer. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dcgraph.h | 3 +++ src/common/dcgraph.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/wx/dcgraph.h b/include/wx/dcgraph.h index dea6c8f7b7..d9d4ce7e21 100755 --- a/include/wx/dcgraph.h +++ b/include/wx/dcgraph.h @@ -94,6 +94,8 @@ public: wxGraphicsContext* GetGraphicsContext() { return m_graphicContext; } virtual void SetGraphicsContext( wxGraphicsContext* ctx ); + wxDC* GetBaseDC() { return m_baseDC; } + protected: // the true implementations virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, @@ -183,6 +185,7 @@ protected: double m_formerScaleX, m_formerScaleY; wxGraphicsContext* m_graphicContext; + wxDC* m_baseDC; }; #endif diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 82abf02b33..348012270c 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -79,6 +79,7 @@ void wxGCDC::SetGraphicsContext( wxGraphicsContext* ctx ) wxGCDC::wxGCDC(const wxWindowDC& dc) { Init(); + m_baseDC = (wxDC*)&dc; SetGraphicsContext( wxGraphicsContext::Create(dc) ); } @@ -86,6 +87,7 @@ wxGCDC::wxGCDC(const wxWindowDC& dc) wxGCDC::wxGCDC(const wxMemoryDC& dc) { Init(); + m_baseDC = (wxDC*)&dc; SetGraphicsContext( wxGraphicsContext::Create(dc) ); } #endif @@ -102,6 +104,7 @@ void wxGCDC::Init() m_brush = *wxWHITE_BRUSH; m_graphicContext = NULL; + m_baseDC = NULL; m_logicalFunctionSupported = true; }