xref: /reactos/dll/cpl/console/font.c (revision 65ce1461)
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 
10 #include "console.h"
11 
12 INT_PTR
13 CALLBACK
14 FontProc(
15   HWND hwndDlg,
16   UINT uMsg,
17   WPARAM wParam,
18   LPARAM lParam
19 )
20 {
21 	LPDRAWITEMSTRUCT drawItem;
22 	PConsoleInfo pConInfo = (PConsoleInfo)GetWindowLongPtr(hwndDlg, DWLP_USER);
23 
24 	UNREFERENCED_PARAMETER(hwndDlg);
25 	UNREFERENCED_PARAMETER(wParam);
26 
27 
28 	switch(uMsg)
29 	{
30 		case WM_INITDIALOG:
31 		{
32 			pConInfo = (PConsoleInfo) ((LPPROPSHEETPAGE)lParam)->lParam;
33 			SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo);
34 			return TRUE;
35 		}
36 		case WM_DRAWITEM:
37 		{
38 			drawItem = (LPDRAWITEMSTRUCT)lParam;
39 			if (drawItem->CtlID == IDC_STATIC_FONT_WINDOW_PREVIEW)
40 			{
41 				PaintConsole(drawItem, pConInfo);
42 			}
43 			else if (drawItem->CtlID == IDC_STATIC_SELECT_FONT_PREVIEW)
44 			{
45 				PaintText(drawItem, pConInfo);
46 			}
47 			return TRUE;
48 		}
49 		default:
50 		{
51 			break;
52 		}
53 	}
54 
55 	return FALSE;
56 }
57