[CONSOLE.DLL-KERNEL32-CONSRV]
[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 INT_PTR
12 CALLBACK
13 FontProc(HWND hwndDlg,
14 UINT uMsg,
15 WPARAM wParam,
16 LPARAM lParam)
17 {
18 LPDRAWITEMSTRUCT drawItem;
19 PCONSOLE_PROPS pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER);
20
21 UNREFERENCED_PARAMETER(hwndDlg);
22 UNREFERENCED_PARAMETER(wParam);
23
24 switch (uMsg)
25 {
26 case WM_INITDIALOG:
27 {
28 pConInfo = (PCONSOLE_PROPS)((LPPROPSHEETPAGE)lParam)->lParam;
29 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo);
30 return TRUE;
31 }
32 case WM_DRAWITEM:
33 {
34 drawItem = (LPDRAWITEMSTRUCT)lParam;
35 if (drawItem->CtlID == IDC_STATIC_FONT_WINDOW_PREVIEW)
36 {
37 PaintConsole(drawItem, pConInfo);
38 }
39 else if (drawItem->CtlID == IDC_STATIC_SELECT_FONT_PREVIEW)
40 {
41 PaintText(drawItem, pConInfo);
42 }
43 return TRUE;
44 }
45 default:
46 {
47 break;
48 }
49 }
50
51 return FALSE;
52 }