]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/enhmeta.cpp
fixed incorrect GetTextExtent for wxTELETYPE font
[wxWidgets.git] / src / msw / enhmeta.cpp
index 6602ce9a2471df2f6603e5b7075bc91dc4598aa8..2f1661b329820921583386800871c6e11c45584b 100644 (file)
@@ -36,6 +36,7 @@
 #endif //WX_PRECOMP
 
 #include "wx/metafile.h"
+#include "wx/clipbrd.h"
 
 #include "wx/msw/private.h"
 
@@ -161,6 +162,18 @@ wxSize wxEnhMetaFile::GetSize() const
     return size;
 }
 
+bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
+{
+#if wxUSE_DRAG_AND_DROP
+    wxCHECK_MSG( m_hMF, FALSE, _T("can't copy invalid metafile to clipboard") );
+
+    return wxTheClipboard->AddData(new wxEnhMetaFileDataObject(*this));
+#else // !wxUSE_DRAG_AND_DROP
+    wxFAIL_MSG(_T("not implemented"));
+    return FALSE;
+#endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP
+}
+
 // ----------------------------------------------------------------------------
 // wxEnhMetaFileDC
 // ----------------------------------------------------------------------------
@@ -225,6 +238,8 @@ wxEnhMetaFileDC::~wxEnhMetaFileDC()
 // wxEnhMetaFileDataObject
 // ----------------------------------------------------------------------------
 
+#if wxUSE_DRAG_AND_DROP
+
 wxDataFormat
 wxEnhMetaFileDataObject::GetPreferredFormat(Direction WXUNUSED(dir)) const
 {
@@ -376,5 +391,6 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format,
 
     return TRUE;
 }
+#endif // wxUSE_DRAG_AND_DROP
 
 #endif // wxUSE_ENH_METAFILE