?? drawstatic.cpp
字號:
// DrawStatic.cpp : implementation file
//
#include "stdafx.h"
#include "RADIO.h"
#include "DrawStatic.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawStatic
CDrawStatic::CDrawStatic()
{m_paintProc=NULL;
m_strPaintInfo="";
}
CDrawStatic::~CDrawStatic()
{
}
BEGIN_MESSAGE_MAP(CDrawStatic, CStatic)
//{{AFX_MSG_MAP(CDrawStatic)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDrawStatic message handlers
void CDrawStatic::OnPaint()
{
CPaintDC dc(this); // device context for painting
Paint();
//CStatic::OnPaint();
}
void CDrawStatic::SetPaintProc(PAINTPROCSTATIC paintProc){
m_paintProc=paintProc;
}
void CDrawStatic::SetPaintInfo(CString strPaintInfo)
{
m_strPaintInfo=strPaintInfo;
}
void CDrawStatic::Paint()
{
CDC *pDC=GetDC();
m_paintProc(pDC,m_strPaintInfo);
ReleaseDC(pDC);//不調用會死的很慘!
}
BOOL CDrawStatic::IsReadyToPaint()
{
return (m_paintProc!=NULL);
}
BOOL CDrawStatic::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
return CStatic::PreCreateWindow(cs);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -