2 * PROJECT: ReactOS Character Map
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/applications/charmap/cell.cpp
5 * PURPOSE: Class for each individual cell
6 * COPYRIGHT: Copyright 2015 Ged Murphy <gedmurphy@reactos.org>
14 /* DATA *****************************************************/
17 /* PUBLIC METHODS **********************************************/
22 CCell(hParent
, RECT
{0})
28 _In_ RECT
& CellCoordinates
31 m_CellCoordinates(CellCoordinates
),
43 CCell::OnPaint(_In_ PAINTSTRUCT
&PaintStruct
)
45 // Check if this cell is in our paint region
46 BOOL NeedsPaint
; RECT rect
;
47 NeedsPaint
= IntersectRect(&rect
,
50 if (NeedsPaint
== FALSE
)
55 // Draw the cell border
56 BOOL b
= Rectangle(PaintStruct
.hdc
,
57 m_CellCoordinates
.left
,
58 m_CellCoordinates
.top
,
59 m_CellCoordinates
.right
,
60 m_CellCoordinates
.bottom
);
62 // Calculate an internal drawing canvas for the cell
64 CopyRect(&Internal
, &m_CellCoordinates
);
65 InflateRect(&Internal
, -1, -1);
67 // Check if this cell has focus
70 // Draw the smaller cell to make it look selected
71 Rectangle(PaintStruct
.hdc
,
79 Success
= DrawTextW(PaintStruct
.hdc
,
83 DT_CENTER
| DT_VCENTER
| DT_SINGLELINE
);
85 return (Success
!= 0);
89 CCell::SetCellCoordinates(
90 _In_ RECT
& Coordinates
93 m_CellCoordinates
= Coordinates
;