X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..99d21c0e1f8d87570702c52dccd3ad698f0a0931:/src/msw/enhmeta.cpp diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index 037b749003..aaf3f59857 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: msw/enhmeta.cpp +// Name: src/msw/enhmeta.cpp // Purpose: implementation of wxEnhMetaFileXXX classes // Author: Vadim Zeitlin // Modified by: @@ -57,7 +57,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxEnhMetaFileDC, wxDC) // 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 @@ -75,7 +75,7 @@ void wxEnhMetaFile::Init() } 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()); @@ -194,7 +194,9 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, int width, int height, const wxString& description) { - ScreenHDC hdcRef; + m_width = width; + m_height = height; + RECT rect; RECT *pRect; if ( width && height ) @@ -215,14 +217,23 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, 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") );