]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dc.cpp
Fix file paths in wxFileSystemWatcherEvent under OS X.
[wxWidgets.git] / src / msw / dc.cpp
index b5f8cd1298e7da88509d2b37a0a9cb1185ed3024..c630843c6751945836b61785fd7f00cca06b5ee6 100644 (file)
@@ -1048,11 +1048,11 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points)
     lppt[ bezier_pos ] = lppt[ bezier_pos-1 ];
     bezier_pos++;
 
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
     while ((node = node->GetNext()) != NULL)
 #else
     while ((node = node->GetNext()))
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
     {
         p = (wxPoint *)node->GetData();
         x1 = x2;
@@ -1722,6 +1722,31 @@ wxCoord wxMSWDCImpl::GetCharWidth() const
     return lpTextMetric.tmAveCharWidth;
 }
 
+void wxMSWDCImpl::DoGetFontMetrics(int *height,
+                                   int *ascent,
+                                   int *descent,
+                                   int *internalLeading,
+                                   int *externalLeading,
+                                   int *averageWidth) const
+{
+    TEXTMETRIC tm;
+
+    GetTextMetrics(GetHdc(), &tm);
+
+    if ( height )
+        *height = tm.tmHeight;
+    if ( ascent )
+        *ascent = tm.tmAscent;
+    if ( descent )
+        *descent = tm.tmDescent;
+    if ( internalLeading )
+        *internalLeading = tm.tmInternalLeading;
+    if ( externalLeading )
+        *externalLeading = tm.tmExternalLeading;
+    if ( averageWidth )
+        *averageWidth = tm.tmAveCharWidth;
+}
+
 void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
                            wxCoord *descent, wxCoord *externalLeading,
                            const wxFont *font) const
@@ -1791,13 +1816,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
 
     if ( descent || externalLeading )
     {
-        TEXTMETRIC tm;
-        ::GetTextMetrics(GetHdc(), &tm);
-
-        if (descent)
-            *descent = tm.tmDescent;
-        if (externalLeading)
-            *externalLeading = tm.tmExternalLeading;
+        DoGetFontMetrics(NULL, NULL, descent, NULL, externalLeading, NULL);
     }
 
     if ( hfontOld )