]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/metafile.cpp
don't use wxSubwindows with a single element to store the dummy radio item, store...
[wxWidgets.git] / src / msw / metafile.cpp
index cca6815690841db997c113d15bf7cb32c08e1abd..3076145d20bff433c6cabef2871df602bf515d73 100644 (file)
@@ -94,6 +94,16 @@ wxMetafile::~wxMetafile()
 {
 }
 
+wxGDIRefData *wxMetafile::CreateGDIRefData() const
+{
+    return new wxMetafileRefData;
+}
+
+wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const
+{
+    return new wxMetafileRefData(wx_static_cast(wxMetafileRefData *, data));
+}
+
 bool wxMetafile::SetClipboard(int width, int height)
 {
 #if !wxUSE_CLIPBOARD
@@ -191,7 +201,7 @@ wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, i
     m_maxY = -10000;
     if ( !file.empty() && wxFileExists(file) )
         wxRemoveFile(file);
-    m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.c_str());
+    m_hDC = (WXHDC) CreateMetaFile(file.empty() ? NULL : file.wx_str());
 
     m_ok = true;
 
@@ -218,14 +228,13 @@ void wxMetafileDC::DoGetTextExtent(const wxString& string,
     if (!fontToUse)
         fontToUse = &m_font;
 
-    HDC dc = GetDC(NULL);
+    ScreenHDC dc;
+    SelectInHDC selFont(dc, GetHfontOf(*fontToUse));
 
     SIZE sizeRect;
     TEXTMETRIC tm;
     ::GetTextExtentPoint32(dc, WXSTRINGCAST string, wxStrlen(WXSTRINGCAST string), &sizeRect);
-    GetTextMetrics(dc, &tm);
-
-    ReleaseDC(NULL, dc);
+    ::GetTextMetrics(dc, &tm);
 
     if ( x )
         *x = sizeRect.cx;