]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/enhmeta.cpp
Added wxDataViewListCtrl, use it in the sample
[wxWidgets.git] / src / msw / enhmeta.cpp
index 818d796a81b51a983d475f2588aa6edd7ee34139..82d4adf106c93c072ef8a265ed75a63c4e21422e 100644 (file)
@@ -69,6 +69,21 @@ static inline const wxChar *GetMetaFileName(const wxString& fn)
 // wxEnhMetaFile
 // ----------------------------------------------------------------------------
 
+wxGDIRefData *wxEnhMetaFile::CreateGDIRefData() const
+{
+    wxFAIL_MSG( _T("must be implemented if used") );
+
+    return NULL;
+}
+
+wxGDIRefData *
+wxEnhMetaFile::CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const
+{
+    wxFAIL_MSG( _T("must be implemented if used") );
+
+    return NULL;
+}
+
 void wxEnhMetaFile::Init()
 {
     if ( m_filename.empty() )
@@ -142,7 +157,7 @@ bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound)
     wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl );
     if (!msw_impl)
         return false;
-        
+
     if ( !::PlayEnhMetaFile(GetHdcOf(*msw_impl), GetEMF(), &rect) )
     {
         wxLogLastError(_T("PlayEnhMetaFile"));
@@ -194,13 +209,13 @@ bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
 }
 
 // ----------------------------------------------------------------------------
-// wxEnhMetaFileDC
+// wxEnhMetaFileDCImpl
 // ----------------------------------------------------------------------------
 
 class wxEnhMetaFileDCImpl : public wxMSWDCImpl
 {
 public:
-    wxEnhMetaFileDCImpl( wxEnhMetaFileDC *owner, 
+    wxEnhMetaFileDCImpl( wxEnhMetaFileDC *owner,
                          const wxString& filename, int width, int height,
                          const wxString& description );
     virtual ~wxEnhMetaFileDCImpl();
@@ -218,21 +233,11 @@ private:
 };
 
 
-IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC, wxDC)
-
-wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename,
-                                 int width, int height,
-                                 const wxString& description)
-{
-    m_pimpl = new wxEnhMetaFileDCImpl( this, filename, width, height, description );
-}
-
-
 wxEnhMetaFileDCImpl::wxEnhMetaFileDCImpl( wxEnhMetaFileDC* owner,
                                  const wxString& filename,
                                  int width, int height,
                                  const wxString& description )
-   : wxMSWDCImpl( owner )
+                   : wxMSWDCImpl( owner )
 {
     m_width = width;
     m_height = height;
@@ -297,6 +302,31 @@ wxEnhMetaFileDCImpl::~wxEnhMetaFileDCImpl()
     m_hDC = 0;
 }
 
+// ----------------------------------------------------------------------------
+// wxEnhMetaFileDC
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC, wxDC)
+
+wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename,
+                                 int width, int height,
+                                 const wxString& description)
+               : wxDC(new wxEnhMetaFileDCImpl(this,
+                                              filename,
+                                              width, height,
+                                              description))
+{
+}
+
+wxEnhMetaFile *wxEnhMetaFileDC::Close()
+{
+    wxEnhMetaFileDCImpl * const
+        impl = static_cast<wxEnhMetaFileDCImpl *>(GetImpl());
+    wxCHECK_MSG( impl, NULL, _T("no wxEnhMetaFileDC implementation") );
+
+    return impl->Close();
+}
+
 #if wxUSE_DRAG_AND_DROP
 
 // ----------------------------------------------------------------------------