[CHARMAP]
[reactos.git] / reactos / base / applications / charmap_new / GridView.h
1 #pragma once
2 #include "Cell.h"
3
4 //typedef struct _CELL
5 //{
6 // RECT CellExt;
7 // RECT CellInt;
8 // BOOL bActive;
9 // BOOL bLarge;
10 // WCHAR ch;
11 //
12 //} CELL, *PCELL;
13
14 #define MAX_GLYPHS 0xFFFF
15
16
17 class CGridView
18 {
19 private:
20 CAtlStringW m_szMapWndClass;
21
22 HWND m_hwnd;
23 HWND m_hParent;
24
25 int m_xNumCells;
26 int m_yNumCells;
27
28 RECT m_ClientCoordinates;
29 //SIZE ClientSize;
30 SIZE m_CellSize;
31 CCell*** m_Cells; // m_Cells[][];
32 CCell *m_ActiveCell;
33
34 HFONT hFont;
35 LOGFONTW CurrentFont;
36 INT iYStart;
37
38 USHORT ValidGlyphs[MAX_GLYPHS];
39 USHORT NumValidGlyphs;
40
41 public:
42 CGridView();
43 ~CGridView();
44
45 bool Create(
46 _In_ HWND hParent
47 );
48
49 private:
50 static LRESULT
51 CALLBACK
52 MapWndProc(HWND hwnd,
53 UINT uMsg,
54 WPARAM wParam,
55 LPARAM lParam);
56
57 LRESULT OnCreate(
58 _In_ HWND hwnd,
59 _In_ HWND hParent
60 );
61
62
63 LRESULT OnSize(
64 _In_ INT Width,
65 _In_ INT Height
66 );
67
68 LRESULT OnPaint(
69 _In_opt_ HDC hdc
70 );
71
72 bool UpdateGridLayout(
73 );
74
75 void DrawGrid(
76 _In_ LPPAINTSTRUCT PaintStruct
77 );
78
79 void DeleteCells();
80
81 void SetCellFocus(
82 _In_ CCell* NewActiveCell
83 );
84 };
85