www.pudn.com > realtime.rar > ColorBtn.cpp, change:2003-12-30,size:895b


// ColorButtin.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "ColorBtn.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CColorButton 
 
CColorButton::CColorButton() 
{ 
	color = RGB(0, 0, 255); 
} 
 
CColorButton::~CColorButton() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CColorButton, CButton) 
	//{{AFX_MSG_MAP(CColorButton) 
	ON_WM_PAINT() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CColorButton message handlers 
 
void CColorButton::OnPaint()  
{ 
	CPaintDC dc(this); // device context for painting 
	 
	CRect rect; 
	GetClientRect(&rect); 
	CBrush brush; 
	brush.CreateSolidBrush(color); 
	dc.FillRect(rect, &brush); 
	dc.DrawEdge(rect, EDGE_SUNKEN, BF_RECT); 
}