/////////////////////////////////////////////////////////////////////////////
-// Name: msw/metafile.cpp
+// Name: src/msw/metafile.cpp
// Purpose: wxMetafileDC etc.
// Author: Julian Smart
// Modified by: VZ 07.01.00: implemented wxMetaFileDataObject
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "metafile.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#pragma hdrstop
#endif
-#ifndef WX_PRECOMP
- #include "wx/setup.h"
-#endif
-
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/app.h"
if (!m_refData)
return false;
- dc->BeginDrawing();
-
if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
{
if ( !::PlayMetaFile(GetHdcOf(*dc), (HMETAFILE)
}
}
- dc->EndDrawing();
-
return true;
}
m_minY = 10000;
m_maxX = -10000;
m_maxY = -10000;
- if ( !file.IsEmpty() && wxFileExists(file))
+ if ( !file.empty() && wxFileExists(file) )
wxRemoveFile(file);
- m_hDC = (WXHDC) CreateMetaFile(file);
+ m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.c_str());
m_ok = true;
SIZE sizeRect;
TEXTMETRIC tm;
- GetTextExtentPoint(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
+ ::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
GetTextMetrics(dc, &tm);
ReleaseDC(NULL, dc);
*externalLeading = tm.tmExternalLeading;
}
+void wxMetafileDC::DoGetSize(int *width, int *height) const
+{
+ wxCHECK_RET( m_refData, _T("invalid wxMetafileDC") );
+
+ if ( width )
+ *width = M_METAFILEDATA->m_width;
+ if ( height )
+ *height = M_METAFILEDATA->m_height;
+}
+
wxMetafile *wxMetafileDC::Close()
{
SelectOldObjects(m_hDC);
#endif // wxUSE_DRAG_AND_DROP
#endif // wxUSE_METAFILE
-