📄 scoregatherview.cpp
字号:
// ScoreGatherView.cpp : CScoreGatherView 类的实现
//
#include "stdafx.h"
#include "ScoreGather.h"
#include "ScoreGatherDoc.h"
#include "ScoreGatherView.h"
#include ".\scoregatherview.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CScoreGatherView
IMPLEMENT_DYNCREATE(CScoreGatherView, CView)
BEGIN_MESSAGE_MAP(CScoreGatherView, CView)
// 标准打印命令
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
// CScoreGatherView 构造/析构
CScoreGatherView::CScoreGatherView()
{
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
m_brushBackground.CreatePatternBrush(&bmp);
}
CScoreGatherView::~CScoreGatherView()
{
}
BOOL CScoreGatherView::PreCreateWindow(CREATESTRUCT& cs)
{
return CView::PreCreateWindow(cs);
}
// CScoreGatherView 绘制
void CScoreGatherView::OnDraw(CDC* pDC)
{
CScoreGatherDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
CRect rect;
GetClientRect(rect);
pDC->FillRect(rect,&m_brushBackground);
pDC->SetTextColor(RGB(0,0,255));
CFont *curFont = pDC->GetCurrentFont();
LOGFONT curLogFont;
curFont->GetLogFont( &curLogFont );
pDC->SetBkMode(TRANSPARENT);
CString text=_T("基础数据未经处理,当前无结果数据显示……");
pDC->TextOut((rect.Width()-curLogFont.lfWidth*text.GetLength())/2,(rect.Height()-curLogFont.lfHeight)/2,text);
}
// CScoreGatherView 打印
BOOL CScoreGatherView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CScoreGatherView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印前添加额外的初始化
}
void CScoreGatherView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 打印后添加清除过程
}
// CScoreGatherView 诊断
#ifdef _DEBUG
void CScoreGatherView::AssertValid() const
{
CView::AssertValid();
}
void CScoreGatherView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CScoreGatherDoc* CScoreGatherView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CScoreGatherDoc)));
return (CScoreGatherDoc*)m_pDocument;
}
#endif //_DEBUG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -