From f57258724a56bca5c473737fbe19e2fc60ce7bd3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Oct 2008 16:09:09 +0000 Subject: [PATCH] added wxDC::GetHDC() for backwards compatibility with the existing wxMSW code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dc.h | 4 ++++ src/msw/dc.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/include/wx/dc.h b/include/wx/dc.h index fefa92f50e..ce9356e653 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1121,8 +1121,12 @@ public: wxDEPRECATED( void GetLogicalOrigin(long *x, long *y) const ); wxDEPRECATED( void GetDeviceOrigin(long *x, long *y) const ); wxDEPRECATED( void GetClippingBox(long *x, long *y, long *w, long *h) const ); + #endif // WXWIN_COMPATIBILITY_2_8 +#ifdef __WXMSW__ + WXHDC GetHDC() const; +#endif // __WXMSW__ protected: // ctor takes ownership of the pointer diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index c912e076aa..d878f66645 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -399,6 +399,16 @@ wxBrushAttrsSetter::wxBrushAttrsSetter(wxMSWDCImpl& dc) } } +// ---------------------------------------------------------------------------- +// wxDC MSW-specific methods +// ---------------------------------------------------------------------------- + +WXHDC wxDC::GetHDC() const +{ + wxMSWDCImpl * const impl = wxDynamicCast(GetImpl(), wxMSWDCImpl); + return impl ? impl->GetHDC() : 0; +} + // --------------------------------------------------------------------------- // wxMSWDCImpl // --------------------------------------------------------------------------- -- 2.45.2