• R/O
  • SSH
  • HTTPS

tortoisesvn: コミット


コミットメタ情報

リビジョン28284 (tree)
日時2018-07-13 02:53:54
作者stefankueng

ログメッセージ

Change font size of all dialogs to 9 units: this is what's the default since Vista.
Note: dialogs and controls take the font and font size from the resource files, but property sheets set their own default font and size when they're created, and then also apply that font and size to all property pages.
So to make the font size change work for property sheets and their pages, we have to interfere with the creation of the property sheet and change the font and size there by code.

変更サマリ

差分

--- trunk/ext/ResizableLib/ResizableSheetEx.cpp (revision 28283)
+++ trunk/ext/ResizableLib/ResizableSheetEx.cpp (revision 28284)
@@ -560,6 +560,11 @@
560560 // Set the resizable border style
561561 ((LPDLGTEMPLATE)lParam)->style |= (DS_3DLOOK | DS_SETFONT
562562 | WS_THICKFRAME | WS_SYSMENU | WS_POPUP | WS_VISIBLE | WS_CAPTION);
563+ // Change the font and font size
564+ LPDLGTEMPLATE pResource = (LPDLGTEMPLATE)lParam;
565+ CDialogTemplate dlgTemplate(pResource);
566+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
567+ memmove((void*)lParam, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
563568 break;
564569 }
565570 return nRes;
--- trunk/ext/ResizableLib/ResizableSheetEx.h (revision 28283)
+++ trunk/ext/ResizableLib/ResizableSheetEx.h (revision 28284)
@@ -26,6 +26,7 @@
2626 #include "ResizableGrip.h"
2727 #include "ResizableMinMax.h"
2828 #include "ResizableSheetState.h"
29+#include <afxpriv.h>
2930
3031 /////////////////////////////////////////////////////////////////////////////
3132 // ResizableSheetEx.h : header file
@@ -107,7 +108,22 @@
107108 BOOL bWithPage = FALSE, BOOL bHorzResize = TRUE, BOOL bVertResize = TRUE);
108109 int GetMinWidth(); // minimum width to display all buttons
109110
111+ void BuildPropPageArray() override
112+ {
113+ CPropertySheet::BuildPropPageArray();
110114
115+ LPCPROPSHEETPAGE ppsp = m_psh.ppsp;
116+ auto nSize = m_pages.GetSize();
117+ for (decltype(nSize) nPage = 0; nPage < nSize; nPage++)
118+ {
119+ const DLGTEMPLATE* pResource = ppsp->pResource;
120+ CDialogTemplate dlgTemplate(pResource);
121+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
122+ memmove((void*)pResource, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
123+ (BYTE*&)ppsp += ppsp->dwSize;
124+ }
125+ }
126+
111127 virtual CWnd* GetResizableWnd() const
112128 {
113129 // make the layout know its parent window
--- trunk/ext/TreePropSheet/TreePropSheet.cpp (revision 28283)
+++ trunk/ext/TreePropSheet/TreePropSheet.cpp (revision 28284)
@@ -33,6 +33,21 @@
3333
3434 namespace TreePropSheet
3535 {
36+ int CALLBACK PropSheetProc(HWND /*hWndDlg*/, UINT uMsg, LPARAM lParam)
37+ {
38+ switch (uMsg)
39+ {
40+ case PSCB_PRECREATE:
41+ {
42+ LPDLGTEMPLATE pResource = (LPDLGTEMPLATE)lParam;
43+ CDialogTemplate dlgTemplate(pResource);
44+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
45+ memmove((void*)lParam, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
46+ }
47+ break;
48+ }
49+ return 0;
50+ }
3651
3752 //-------------------------------------------------------------------
3853 // class CTreePropSheet
@@ -67,7 +82,10 @@
6782 m_nPageTreeWidth(150),
6883 m_pwndPageTree(NULL),
6984 m_pFrame(NULL)
70-{}
85+{
86+ m_psh.pfnCallback = PropSheetProc;
87+ m_psh.dwFlags |= PSH_USECALLBACK;
88+}
7189
7290
7391 CTreePropSheet::CTreePropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
@@ -80,6 +98,8 @@
8098 m_pwndPageTree(NULL),
8199 m_pFrame(NULL)
82100 {
101+ m_psh.pfnCallback = PropSheetProc;
102+ m_psh.dwFlags |= PSH_USECALLBACK;
83103 }
84104
85105
@@ -93,6 +113,8 @@
93113 m_pwndPageTree(NULL),
94114 m_pFrame(NULL)
95115 {
116+ m_psh.pfnCallback = PropSheetProc;
117+ m_psh.dwFlags |= PSH_USECALLBACK;
96118 }
97119
98120
--- trunk/ext/TreePropSheet/TreePropSheet.h (revision 28283)
+++ trunk/ext/TreePropSheet/TreePropSheet.h (revision 28284)
@@ -29,6 +29,7 @@
2929 #include <afxtempl.h>
3030 #include <afxdlgs.h> // Needed for CPropertySheet
3131 #include <afxcmn.h> // Needed for CTreeCtrl
32+#include <afxpriv.h>
3233
3334 namespace TreePropSheet
3435 {
@@ -409,6 +410,21 @@
409410 //{{AFX_VIRTUAL(CTreePropSheet)
410411 public:
411412 virtual BOOL OnInitDialog();
413+ void BuildPropPageArray() override
414+ {
415+ CPropertySheet::BuildPropPageArray();
416+
417+ LPCPROPSHEETPAGE ppsp = m_psh.ppsp;
418+ auto nSize = m_pages.GetSize();
419+ for (decltype(nSize) nPage = 0; nPage < nSize; nPage++)
420+ {
421+ const DLGTEMPLATE* pResource = ppsp->pResource;
422+ CDialogTemplate dlgTemplate(pResource);
423+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
424+ memmove((void*)pResource, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
425+ (BYTE*&)ppsp += ppsp->dwSize;
426+ }
427+ }
412428 //}}AFX_VIRTUAL
413429
414430 // Message handlers
--- trunk/src/TortoiseMerge/Settings.cpp (revision 28283)
+++ trunk/src/TortoiseMerge/Settings.cpp (revision 28284)
@@ -1,6 +1,6 @@
1-// TortoiseMerge - a Diff/Patch program
1+// TortoiseMerge - a Diff/Patch program
22
3-// Copyright (C) 2006, 2009-2010, 2014-2015, 2017 - TortoiseSVN
3+// Copyright (C) 2006, 2009-2010, 2014-2015, 2017-2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -23,6 +23,22 @@
2323
2424 #define BOTTOMMARG 32
2525
26+int CALLBACK PropSheetProc(HWND /*hWndDlg*/, UINT uMsg, LPARAM lParam)
27+{
28+ switch (uMsg)
29+ {
30+ case PSCB_PRECREATE:
31+ {
32+ LPDLGTEMPLATE pResource = (LPDLGTEMPLATE)lParam;
33+ CDialogTemplate dlgTemplate(pResource);
34+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
35+ memmove((void*)lParam, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
36+ }
37+ break;
38+ }
39+ return 0;
40+}
41+
2642 IMPLEMENT_DYNAMIC(CSettings, CPropertySheet)
2743 CSettings::CSettings(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
2844 : CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
@@ -56,6 +72,8 @@
5672 // is closed, so the OK button is enough and the "apply" button only
5773 // confuses users.
5874 m_psh.dwFlags |= PSH_NOAPPLYNOW;
75+ m_psh.pfnCallback = PropSheetProc;
76+ m_psh.dwFlags |= PSH_USECALLBACK;
5977 }
6078
6179 void CSettings::RemovePropPages()
--- trunk/src/TortoiseMerge/Settings.h (revision 28283)
+++ trunk/src/TortoiseMerge/Settings.h (revision 28284)
@@ -1,6 +1,6 @@
1-// TortoiseMerge - a Diff/Patch program
1+// TortoiseMerge - a Diff/Patch program
22
3-// Copyright (C) 2006, 2009, 2015 - TortoiseSVN
3+// Copyright (C) 2006, 2009, 2015, 2018 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -18,6 +18,7 @@
1818 //
1919 #pragma once
2020 #include "AeroControls.h"
21+#include "DPIAware.h"
2122
2223 class CSetMainPage;
2324 class CSetColorPage;
@@ -45,6 +46,21 @@
4546 */
4647 void RemovePropPages();
4748
49+ void BuildPropPageArray() override
50+ {
51+ CPropertySheet::BuildPropPageArray();
52+
53+ LPCPROPSHEETPAGE ppsp = m_psh.ppsp;
54+ auto nSize = m_pages.GetSize();
55+ for (decltype(nSize) nPage = 0; nPage < nSize; nPage++)
56+ {
57+ const DLGTEMPLATE* pResource = ppsp->pResource;
58+ CDialogTemplate dlgTemplate(pResource);
59+ dlgTemplate.SetFont(L"MS Shell Dlg 2", 9);
60+ memmove((void*)pResource, dlgTemplate.m_hTemplate, dlgTemplate.m_dwTemplateSize);
61+ (BYTE*&)ppsp += ppsp->dwSize;
62+ }
63+ }
4864 private:
4965 CSetMainPage * m_pMainPage;
5066 CSetColorPage * m_pColorPage;
旧リポジトリブラウザで表示