Synchronize with trunk revision 59781.
[reactos.git] / dll / cpl / console / font.c
1 /*
2 * PROJECT: ReactOS Console Configuration DLL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/console/font.c
5 * PURPOSE: displays font dialog
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@student.tugraz.at)
7 */
8
9 #include "console.h"
10
11 #define NDEBUG
12 #include <debug.h>
13
14 INT_PTR
15 CALLBACK
16 FontProc(HWND hwndDlg,
17 UINT uMsg,
18 WPARAM wParam,
19 LPARAM lParam)
20 {
21 LPDRAWITEMSTRUCT drawItem;
22 PCONSOLE_PROPS pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER);
23
24 UNREFERENCED_PARAMETER(hwndDlg);
25 UNREFERENCED_PARAMETER(wParam);
26
27 switch (uMsg)
28 {
29 case WM_INITDIALOG:
30 {
31 pConInfo = (PCONSOLE_PROPS)((LPPROPSHEETPAGE)lParam)->lParam;
32 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo);
33 return TRUE;
34 }
35 case WM_DRAWITEM:
36 {
37 drawItem = (LPDRAWITEMSTRUCT)lParam;
38 if (drawItem->CtlID == IDC_STATIC_FONT_WINDOW_PREVIEW)
39 {
40 PaintConsole(drawItem, pConInfo);
41 }
42 else if (drawItem->CtlID == IDC_STATIC_SELECT_FONT_PREVIEW)
43 {
44 PaintText(drawItem, pConInfo);
45 }
46 return TRUE;
47 }
48 default:
49 {
50 break;
51 }
52 }
53
54 return FALSE;
55 }