#include "wx/setup.h"
#endif
-#if USE_METAFILE
+#if wxUSE_METAFILE
#ifndef WX_PRECOMP
#include "wx/utils.h"
wxMetaFile::~wxMetaFile(void)
{
if (m_metaFile)
- { DeleteMetaFile((HANDLE) m_metaFile); m_metaFile = 0; }
+ { DeleteMetaFile((HMETAFILE) m_metaFile); m_metaFile = 0; }
}
bool wxMetaFile::SetClipboard(int width, int height)
wxOpenClipboard();
if (!wxEmptyClipboard()) return FALSE;
}
- bool success = wxSetClipboardData(wxCF_METAFILE,this, width,height);
+ bool success = wxSetClipboardData(wxDF_METAFILE,this, width,height);
if (!alreadyOpen) wxCloseClipboard();
return (bool) success;
}
dc->BeginDrawing();
if (dc->GetHDC() && m_metaFile)
- PlayMetaFile((HDC) dc->GetHDC(), (HANDLE) m_metaFile);
+ PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) m_metaFile);
dc->EndDrawing();
if (!file.IsNull() && wxFileExists(file))
wxRemoveFile(file);
- m_hDC = (WXHDC) CreateMetaFile(file);
- m_ok = TRUE;
+ if (!file.IsNull() && (file != ""))
+ m_hDC = (WXHDC) CreateMetaFile(file);
+ else
+ m_hDC = (WXHDC) CreateMetaFile(NULL);
+
+ m_ok = (m_hDC != (WXHDC) 0) ;
// Actual Windows mapping mode, for future reference.
m_windowsMappingMode = MM_TEXT;
m_hDC = 0;
}
-void wxMetaFileDC::GetTextExtent(const wxString& string, float *x, float *y,
- float *descent, float *externalLeading, wxFont *theFont, bool use16bit)
+void wxMetaFileDC::GetTextExtent(const wxString& string, long *x, long *y,
+ long *descent, long *externalLeading, wxFont *theFont, bool use16bit) const
{
wxFont *fontToUse = theFont;
if (!fontToUse)
- fontToUse = &m_font;
+ fontToUse = (wxFont*) &m_font;
HDC dc = GetDC(NULL);
ReleaseDC(NULL, dc);
- *x = (float)XDEV2LOGREL(sizeRect.cx);
- *y = (float)YDEV2LOGREL(sizeRect.cy);
- if (descent) *descent = (float)tm.tmDescent;
- if (externalLeading) *externalLeading = (float)tm.tmExternalLeading;
+ *x = XDEV2LOGREL(sizeRect.cx);
+ *y = YDEV2LOGREL(sizeRect.cy);
+ if (descent) *descent = tm.tmDescent;
+ if (externalLeading) *externalLeading = tm.tmExternalLeading;
}
wxMetaFile *wxMetaFileDC::Close(void)
return TRUE;
}
-#endif // USE_METAFILE
+#endif // wxUSE_METAFILE