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?r…
==============================================================================
--- 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;