XSTATIC.CPP
资源名称:tapi3.zip [点击查看]
上传用户:chinamans
上传日期:2013-03-17
资源大小:202k
文件大小:1k
源码类别:
TAPI编程
开发平台:
Visual C++
- // 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
- }