From b4772c241f010306b6f9e93edd2dabe763ff9c40 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 22 May 2005 13:04:23 +0000 Subject: [PATCH] Applied patch [ 1204244 ] [wxMSW] Use Win2K look (MS Shell Dlg 2) if possible Adam Strzelecki git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34242 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/font.cpp | 10 +++++++++- src/msw/settings.cpp | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/msw/font.cpp b/src/msw/font.cpp index c3ed95c514..c9f7b35890 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -606,8 +606,16 @@ void wxNativeFontInfo::SetFamily(wxFontFamily family) case wxDEFAULT: default: + { + // We want Windows 2000 or later to have new fonts even MS Shell Dlg + // is returned as default GUI font for compatibility + int verMaj; ff_family = FF_SWISS; - facename = _T("MS Sans Serif"); + if(wxGetOsVersion(&verMaj) == wxWINDOWS_NT && verMaj >= 5) + facename = _T("MS Shell Dlg 2"); + else + facename = _T("MS Shell Dlg"); + } } lf.lfPitchAndFamily = (BYTE)(DEFAULT_PITCH) | ff_family; diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index af0dfa0adb..602d3f8e62 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -225,6 +225,12 @@ wxFont wxCreateFontFromStockObject(int index) { wxNativeFontInfo info; info.lf = lf; + // We want Windows 2000 or later to have new fonts even MS Shell Dlg + // is returned as default GUI font for compatibility + int verMaj; + if(index == DEFAULT_GUI_FONT && wxGetOsVersion(&verMaj) == wxWINDOWS_NT && verMaj >= 5) + wxStrcpy(info.lf.lfFaceName, wxT("MS Shell Dlg 2")); + // Under MicroWindows we pass the HFONT as well // because it's hard to convert HFONT -> LOGFONT -> HFONT // It's OK to delete stock objects, the delete will be ignored. -- 2.47.2