[ros-diffs] [ekohl] 25931: Add code to support font size changes.

ekohl at svn.reactos.org ekohl at svn.reactos.org
Wed Feb 28 23:49:34 CET 2007


Author: ekohl
Date: Thu Mar  1 01:49:34 2007
New Revision: 25931

URL: http://svn.reactos.org/svn/reactos?rev=25931&view=rev
Log:
Add code to support font size changes.

Modified:
    trunk/reactos/dll/cpl/desk/advappdlg.c

Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?rev=25931&r1=25930&r2=25931&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/desk/advappdlg.c (original)
+++ trunk/reactos/dll/cpl/desk/advappdlg.c Thu Mar  1 01:49:34 2007
@@ -450,6 +450,24 @@
 }
 
 
+static INT
+GetSelectedComboInt(HWND hwnd, INT id)
+{
+    TCHAR szBuffer[80];
+    INT nCount;
+
+    nCount = SendDlgItemMessage(hwnd, id, CB_GETCURSEL, 0, 0);
+    if (nCount == CB_ERR)
+        return 0;
+
+    nCount = SendDlgItemMessage(hwnd, id, CB_GETLBTEXT, (WPARAM)nCount, (LPARAM)szBuffer);
+    if (nCount == CB_ERR)
+        return 0;
+
+    return _ttoi(szBuffer);
+}
+
+
 
 INT_PTR CALLBACK
 AdvAppearanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -556,8 +574,45 @@
 								SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETDIALOGFONT, 0,
 									(LPARAM)&g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font]);
 								break;
-
 						}
+					}
+					break;
+
+				case IDC_ADVAPPEARANCE_FONTSIZE_E:
+					if (g && HIWORD(wParam) == CBN_SELCHANGE)
+					{
+						HDC hdcDlg = GetDC(hwndDlg);
+						INT i;
+
+						switch (g->CurrentElement)
+						{
+							case IDX_INACTIVE_CAPTION:
+							case IDX_ACTIVE_CAPTION:
+								i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E);
+								g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight =
+									-MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
+								SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETCAPTIONFONT, 0,
+									(LPARAM)&g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font]);
+								break;
+
+							case IDX_MENU:
+								i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E);
+								g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight =
+									-MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
+								SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETMENUFONT, 0,
+									(LPARAM)&g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font]);
+								break;
+
+							case IDX_DIALOG:
+								i = GetSelectedComboInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E);
+								g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font].lfHeight =
+									-MulDiv(i , GetDeviceCaps(hdcDlg, LOGPIXELSY), 72);
+								SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETDIALOGFONT, 0,
+									(LPARAM)&g->ThemeAdv.lfFont[g_Assignment[g->CurrentElement].Font]);
+								break;
+						}
+
+						ReleaseDC(hwndDlg, hdcDlg);
 					}
 					break;
 




More information about the Ros-diffs mailing list