📄 mfcexampleview.cpp
字号:
// MFCExampleView.cpp : CMFCExampleView 类的实现
//
#include "stdafx.h"
#include "MFCExample.h"
#include "MFCExampleDoc.h"
#include "MFCExampleView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMFCExampleView
IMPLEMENT_DYNCREATE(CMFCExampleView, CView)
BEGIN_MESSAGE_MAP(CMFCExampleView, 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()
// CMFCExampleView 构造/析构
CMFCExampleView::CMFCExampleView()
{
// TODO: 在此处添加构造代码
}
CMFCExampleView::~CMFCExampleView()
{
}
BOOL CMFCExampleView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: 在此处通过修改
// CREATESTRUCT cs 来修改窗口类或样式
return CView::PreCreateWindow(cs);
}
// CMFCExampleView 绘制
void CMFCExampleView::OnDraw(CDC* /*pDC*/)
{
CMFCExampleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// TODO: 在此处为本机数据添加绘制代码
}
// CMFCExampleView 打印
BOOL CMFCExampleView::OnPreparePrinting(CPrintInfo* pInfo)
{
// 默认准备
return DoPreparePrinting(pInfo);
}
void CMFCExampleView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 添加额外的打印前进行的初始化过程
}
void CMFCExampleView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: 添加打印后进行的清除过程
}
// CMFCExampleView 诊断
#ifdef _DEBUG
void CMFCExampleView::AssertValid() const
{
CView::AssertValid();
}
void CMFCExampleView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CMFCExampleDoc* CMFCExampleView::GetDocument() const // 非调试版本是内联的
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCExampleDoc)));
return (CMFCExampleDoc*)m_pDocument;
}
#endif //_DEBUG
// CMFCExampleView 消息处理程序
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -