-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathColorWnd.cpp
More file actions
52 lines (38 loc) · 841 Bytes
/
Copy pathColorWnd.cpp
File metadata and controls
52 lines (38 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ColorWnd.cpp : implementation file
//
#include "stdafx.h"
#include "KCOMChart.h"
#include "ColorWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CColorWnd
CColorWnd::CColorWnd()
{
m_clrDraw = RGB(255, 255, 255);
}
CColorWnd::~CColorWnd()
{
}
BEGIN_MESSAGE_MAP(CColorWnd, CWnd)
//{{AFX_MSG_MAP(CColorWnd)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColorWnd message handlers
void CColorWnd::SetColor(COLORREF clr)
{
m_clrDraw = clr;
Invalidate();
}
void CColorWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rt;
GetClientRect(&rt);
dc.FillSolidRect(rt, m_clrDraw);
}