///////////////////////////////////////////////////////////////////////////////
-// Name: msw/enhmeta.cpp
+// Name: src/msw/enhmeta.cpp
// Purpose: implementation of wxEnhMetaFileXXX classes
// Author: Vadim Zeitlin
// Modified by:
// we must pass NULL if the string is empty to metafile functions
static inline const wxChar *GetMetaFileName(const wxString& fn)
- { return !fn ? (wxChar *)NULL : fn.c_str(); }
+ { return !fn ? (const wxChar *)NULL : (const wxChar*)fn.wx_str(); }
// ============================================================================
// implementation
}
else // have valid file name, load metafile from it
{
- m_hMF = GetEnhMetaFile(m_filename);
+ m_hMF = (WXHANDLE)::GetEnhMetaFile(m_filename.fn_str());
if ( !m_hMF )
wxLogSysError(_("Failed to load metafile from file \"%s\"."),
m_filename.c_str());
int width, int height,
const wxString& description)
{
- ScreenHDC hdcRef;
+ m_width = width;
+ m_height = height;
+
RECT rect;
RECT *pRect;
if ( width && height )
pRect = (LPRECT)NULL;
}
+ ScreenHDC hdcRef;
m_hDC = (WXHDC)::CreateEnhMetaFile(hdcRef, GetMetaFileName(filename),
- pRect, description);
+ pRect, description.wx_str());
if ( !m_hDC )
{
wxLogLastError(_T("CreateEnhMetaFile"));
}
}
+void wxEnhMetaFileDC::DoGetSize(int *width, int *height) const
+{
+ if ( width )
+ *width = m_width;
+ if ( height )
+ *height = m_height;
+}
+
wxEnhMetaFile *wxEnhMetaFileDC::Close()
{
wxCHECK_MSG( Ok(), NULL, _T("invalid wxEnhMetaFileDC") );