ReactOS 0.4.15-dev-8241-g63935f8
CCell Class Reference

#include <Cell.h>

Collaboration diagram for CCell:

Public Member Functions

 CCell (_In_ HWND hParent)
 
 CCell (_In_ HWND hParent, _In_ RECT &CellLocation)
 
 ~CCell ()
 
LPRECT GetCellCoordinates ()
 
void SetFocus (_In_ bool HasFocus)
 
WCHAR GetChar ()
 
void SetChar (_In_ WCHAR ch)
 
bool OnPaint (_In_ PAINTSTRUCT &PaintStruct)
 
void SetCellCoordinates (_In_ RECT &Coordinates)
 

Private Attributes

HWND m_hParent
 
RECT m_CellCoordinates
 
bool m_bHasFocus
 
bool m_bIsLarge
 
WCHAR m_Char
 

Detailed Description

Definition at line 2 of file Cell.h.

Constructor & Destructor Documentation

◆ CCell() [1/2]

CCell::CCell ( _In_ HWND  hParent)

Definition at line 19 of file Cell.cpp.

21 :
22 CCell(hParent, RECT{0})
23{
24}
Definition: Cell.h:3

◆ CCell() [2/2]

CCell::CCell ( _In_ HWND  hParent,
_In_ RECT CellLocation 
)

Definition at line 26 of file Cell.cpp.

29 :
30 m_hParent(hParent),
31 m_CellCoordinates(CellCoordinates),
32 m_Char(L'*'),
33 m_bHasFocus(false),
34 m_bIsLarge(false)
35{
36}
bool m_bIsLarge
Definition: Cell.h:9
WCHAR m_Char
Definition: Cell.h:10
HWND m_hParent
Definition: Cell.h:5
bool m_bHasFocus
Definition: Cell.h:8
RECT m_CellCoordinates
Definition: Cell.h:6
#define L(x)
Definition: ntvdm.h:50

◆ ~CCell()

CCell::~CCell ( )

Definition at line 38 of file Cell.cpp.

39{
40}

Member Function Documentation

◆ GetCellCoordinates()

LPRECT CCell::GetCellCoordinates ( )
inline

Definition at line 24 of file Cell.h.

24{ return &m_CellCoordinates; }

Referenced by CGridView::SetCellFocus().

◆ GetChar()

WCHAR CCell::GetChar ( )
inline

Definition at line 26 of file Cell.h.

26{ return m_Char; }

◆ OnPaint()

bool CCell::OnPaint ( _In_ PAINTSTRUCT PaintStruct)

Definition at line 43 of file Cell.cpp.

44{
45 // Check if this cell is in our paint region
46 BOOL NeedsPaint; RECT rect;
47 NeedsPaint = IntersectRect(&rect,
48 &PaintStruct.rcPaint,
50 if (NeedsPaint == FALSE)
51 return false;
52
53
54
55 // Draw the cell border
56 BOOL b = Rectangle(PaintStruct.hdc,
61
62 // Calculate an internal drawing canvas for the cell
65 InflateRect(&Internal, -1, -1);
66
67 // Check if this cell has focus
68 if (m_bHasFocus)
69 {
70 // Draw the smaller cell to make it look selected
71 Rectangle(PaintStruct.hdc,
72 Internal.left,
73 Internal.top,
74 Internal.right,
75 Internal.bottom);
76 }
77
78 int Success;
79 Success = DrawTextW(PaintStruct.hdc,
80 &m_Char,
81 1,
82 &Internal,
84
85 return (Success != 0);
86}
#define FALSE
Definition: types.h:117
@ Success
Definition: eventcreate.c:712
unsigned int BOOL
Definition: ntddk_ex.h:94
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
@ Internal
Definition: hwresource.cpp:137
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
& rect
Definition: startmenu.cpp:1413
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define DT_CENTER
Definition: winuser.h:527
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define DT_VCENTER
Definition: winuser.h:543
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

Referenced by CGridView::DrawGrid().

◆ SetCellCoordinates()

void CCell::SetCellCoordinates ( _In_ RECT Coordinates)

Definition at line 89 of file Cell.cpp.

92{
93 m_CellCoordinates = Coordinates;
94}

Referenced by CGridView::UpdateCellCoordinates().

◆ SetChar()

void CCell::SetChar ( _In_ WCHAR  ch)
inline

Definition at line 27 of file Cell.h.

27{ m_Char = ch; }

Referenced by CGridView::DrawGrid().

◆ SetFocus()

void CCell::SetFocus ( _In_ bool  HasFocus)
inline

Definition at line 25 of file Cell.h.

25{ m_bHasFocus = HasFocus; }

Referenced by CGridView::SetCellFocus().

Member Data Documentation

◆ m_bHasFocus

bool CCell::m_bHasFocus
private

Definition at line 8 of file Cell.h.

Referenced by OnPaint(), and SetFocus().

◆ m_bIsLarge

bool CCell::m_bIsLarge
private

Definition at line 9 of file Cell.h.

◆ m_CellCoordinates

RECT CCell::m_CellCoordinates
private

Definition at line 6 of file Cell.h.

Referenced by GetCellCoordinates(), OnPaint(), and SetCellCoordinates().

◆ m_Char

WCHAR CCell::m_Char
private

Definition at line 10 of file Cell.h.

Referenced by GetChar(), OnPaint(), and SetChar().

◆ m_hParent

HWND CCell::m_hParent
private

Definition at line 5 of file Cell.h.


The documentation for this class was generated from the following files: