www.pudn.com > tapi3.zip > XSTATIC.CPP


// xstatic.cpp : implementation file for CXstatic class 
// (c) Dialogic corp 1995, 1996 
 
#include "stdafx.h" 
#include "xstatic.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char BASED_CODE THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CXstatic 
 
CXstatic::CXstatic() 
{ 
	m_Colorref = RGB(0, 0, 255); 
} 
 
CXstatic::~CXstatic() 
{ 
} 
 
BEGIN_MESSAGE_MAP(CXstatic, CStatic) 
	//{{AFX_MSG_MAP(CXstatic) 
	ON_WM_PAINT() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CXstatic message handlers 
 
void CXstatic::OnPaint()  
{ 
	CPaintDC dc(this); // device context for painting 
	 
	CRect rect; 
	//dc.SetBkColor(RGB(255, 0, 0)); 
	GetClientRect(&rect); 
	CBrush brush(m_Colorref); 
	//CPen pen(PS_SOLID, 2, RGB(0, 0, 255)); 
	//dc.SelectObject(&pen); 
	CBrush *pOldBrush = dc.SelectObject(&brush); 
	if(NULL == pOldBrush) return; 
	dc.Ellipse(rect); 
	dc.SelectObject(pOldBrush); 
	// Do not call CStatic::OnPaint() for painting messages 
}