]> git.saurik.com Git - wxWidgets.git/commitdiff
Added wxGCDC(wxEnhMetaFileDC) ctor too.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Jul 2011 22:35:41 +0000 (22:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Jul 2011 22:35:41 +0000 (22:35 +0000)
Make it possible to create wxGCDC associated with a metafile DC in wxMSW too.

Closes #13326.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/dcgraph.h
interface/wx/dcgraph.h
src/common/dcgraph.cpp

index 22a7ec3bdcd4ca55a59654a16b26f66780c30519..ee0d0fc1c0cc3c74977f8156c4f329f4c37c1ecf 100644 (file)
@@ -450,6 +450,10 @@ GTK:
 
 - Generate events for two auxiliary mouse buttons in wxGTK (Marcin Wojdyr).
 
+MSW:
+
+- Added wxGCDC(wxEnhMetaFileDC) ctor (Marcin Wojdyr).
+
 
 2.9.2: (released 2011-07-05)
 ------
index 15369a32fe8cf70f21f7db2829f85dd4bc272c63..38ebbb61cc03d72df1437ba8e68dedc0cef09e0b 100644 (file)
@@ -28,6 +28,9 @@ public:
     wxGCDC( const wxMemoryDC& dc );
 #if wxUSE_PRINTING_ARCHITECTURE
     wxGCDC( const wxPrinterDC& dc );
+#endif
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+    wxGCDC( const wxEnhMetaFileDC& dc );
 #endif
     wxGCDC();
     virtual ~wxGCDC();
@@ -55,6 +58,9 @@ public:
     wxGCDCImpl( wxDC *owner, const wxMemoryDC& dc );
 #if wxUSE_PRINTING_ARCHITECTURE
     wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc );
+#endif
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+    wxGCDCImpl( wxDC *owner, const wxEnhMetaFileDC& dc );
 #endif
     wxGCDCImpl( wxDC *owner );
 
index acd5b58b2df02ec45cac708bb28df742f80bb292..5d086485c1509eafaad21b1448e24d107a8a7c9f 100644 (file)
@@ -35,6 +35,17 @@ public:
     */
     wxGCDC( const wxPrinterDC& dc );
 
+    /**
+       Constructs a wxGCDC from a wxEnhMetaFileDC.
+
+       This constructor is only available in wxMSW port and when @c
+       wxUSE_ENH_METAFILE build option is enabled, i.e. when wxEnhMetaFileDC
+       class itself is available.
+
+       @since 2.9.3
+    */
+    wxGCDC( const wxEnhMetaFileDC& dc );
+
     /**
        Retrieves associated wxGraphicsContext
     */
index 0582a2e025ca1bc4b8133ab61c372f4adbc4b2de..a06cd25382a4ec19db041675f1a142b9e1fb23bf 100644 (file)
@@ -114,6 +114,13 @@ wxGCDC::wxGCDC( const wxPrinterDC& dc) :
 }
 #endif
 
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+wxGCDC::wxGCDC(const wxEnhMetaFileDC& dc)
+   : wxDC(new wxGCDCImpl(this, dc))
+{
+}
+#endif
+
 wxGCDC::wxGCDC() :
   wxDC( new wxGCDCImpl( this ) )
 {
@@ -193,6 +200,15 @@ wxGCDCImpl::wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc ) :
 }
 #endif
 
+#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
+wxGCDCImpl::wxGCDCImpl(wxDC *owner, const wxEnhMetaFileDC& dc)
+   : wxDCImpl(owner)
+{
+    Init();
+    SetGraphicsContext(wxGraphicsContext::Create(dc));
+}
+#endif
+
 void wxGCDCImpl::Init()
 {
     m_ok = false;