From 3cb99894576612e347480d43c5f2e2550b6151cf Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Thu, 16 Oct 2003 11:17:38 +0000
Subject: [PATCH] added wxSYS_ICONTITLE_FONT (patch 816026)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/changes.txt           | 1 +
 docs/latex/wx/settings.tex | 6 ++++--
 include/wx/settings.h      | 6 +++++-
 src/msw/settings.cpp       | 8 ++++++++
 4 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/docs/changes.txt b/docs/changes.txt
index 76829f19d7..2a3a55e613 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -98,6 +98,7 @@ wxMSW:
 - make it possible to give focus to the notebook tabs (Hajo Kirchhoff)
 - MDI child frames are not always resizeable any more (Andrei Fortuna)
 - fixed enumerating of entries/groups under '/' in wxRegConfig
+- added wxSYS_ICONTITLE_FONT (Andreas Pflug)
 
 wxGTK:
 
diff --git a/docs/latex/wx/settings.tex b/docs/latex/wx/settings.tex
index c9f5edfe15..4fe7dc5e30 100644
--- a/docs/latex/wx/settings.tex
+++ b/docs/latex/wx/settings.tex
@@ -86,8 +86,10 @@ Returns a system font.
 \twocolitem{{\bf wxSYS\_ANSI\_VAR\_FONT}}{Windows variable-pitch (proportional) font.}
 \twocolitem{{\bf wxSYS\_SYSTEM\_FONT}}{System font.}
 \twocolitem{{\bf wxSYS\_DEVICE\_DEFAULT\_FONT}}{Device-dependent font (Windows NT only).}
-\twocolitem{{\bf wxSYS\_DEFAULT\_GUI\_FONT}}{Default font for user interface objects such as menus and dialog boxes.
-Not available in versions of Windows earlier than Windows 95 or Windows NT 4.0.}
+\twocolitem{{\bf wxSYS\_DEFAULT\_GUI\_FONT}}{Default font for user interface
+objects such as menus and dialog boxes.}
+\twocolitem{{\bf wxSYS\_ICONTITLE\_FONT}}{Font for the icon titles (Windows
+only, same as default GUI font on other platforms}
 \end{twocollist}
 
 \pythonnote{This static method is implemented in Python as a
diff --git a/include/wx/settings.h b/include/wx/settings.h
index 168db483f2..4d4f680457 100644
--- a/include/wx/settings.h
+++ b/include/wx/settings.h
@@ -28,7 +28,11 @@ enum wxSystemFont
     wxSYS_DEVICE_DEFAULT_FONT,
     wxSYS_DEFAULT_PALETTE,
     wxSYS_SYSTEM_FIXED_FONT,
-    wxSYS_DEFAULT_GUI_FONT
+    wxSYS_DEFAULT_GUI_FONT,
+    wxSYS_ICONTITLE_FONT
+#ifndef __WXMSW__
+    = wxSYS_DEFAULT_GUI_FONT
+#endif
 };
 
 // possible values for wxSystemSettings::GetColour() parameter
diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp
index 9ba29bc069..6087406cf4 100644
--- a/src/msw/settings.cpp
+++ b/src/msw/settings.cpp
@@ -250,6 +250,14 @@ wxFont wxCreateFontFromStockObject(int index)
 
 wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
 {
+    // this one is special: we don't get it from GetStockObject()
+    if ( index == wxSYS_ICONTITLE_FONT )
+    {
+        LOGFONT lf;
+        SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0);
+        return wxCreateFontFromLogFont(&lf);
+    }
+
     // wxWindow ctor calls GetSystemFont(wxSYS_DEFAULT_GUI_FONT) so we're
     // called fairly often - this is why we cache this particular font
     bool isDefaultRequested = index == wxSYS_DEFAULT_GUI_FONT;
-- 
2.47.2