1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 
// MFCApplication3View.cpp: CMFCApplication3View 类的实现
//
 
#include "pch.h"
#include "framework.h"
// SHARED_HANDLERS 可以在实现预览、缩略图和搜索筛选器句柄的
// ATL 项目中进行定义,并允许与该项目共享文档代码。
#ifndef SHARED_HANDLERS
#include "MFCApplication3.h"
#endif
 
#include "MFCApplication3Doc.h"
#include "MFCApplication3View.h"
 
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
 
 
// CMFCApplication3View
 
IMPLEMENT_DYNCREATE(CMFCApplication3View, CScrollView)
 
BEGIN_MESSAGE_MAP(CMFCApplication3View, CScrollView)
    // 标准打印命令
    ON_COMMAND(ID_FILE_PRINT, &CScrollView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_DIRECT, &CScrollView::OnFilePrint)
    ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()
 
// CMFCApplication3View 构造/析构
 
CMFCApplication3View::CMFCApplication3View() noexcept
{
    // TODO: 在此处添加构造代码
 
}
 
CMFCApplication3View::~CMFCApplication3View()
{
}
 
BOOL CMFCApplication3View::PreCreateWindow(CREATESTRUCT& cs)
{
    // TODO: 在此处通过修改
    //  CREATESTRUCT cs 来修改窗口类或样式
 
    return CScrollView::PreCreateWindow(cs);
}
 
// CMFCApplication3View 绘图
 
void CMFCApplication3View::OnDraw(CDC* /*pDC*/)
{
    CMFCApplication3Doc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    if (!pDoc)
        return;
 
    // TODO: 在此处为本机数据添加绘制代码
}
 
void CMFCApplication3View::OnInitialUpdate()
{
    CScrollView::OnInitialUpdate();
 
    CSize sizeTotal;
    // TODO: 计算此视图的合计大小
    sizeTotal.cx = sizeTotal.cy = 100;
    SetScrollSizes(MM_TEXT, sizeTotal);
}
 
 
// CMFCApplication3View 打印
 
BOOL CMFCApplication3View::OnPreparePrinting(CPrintInfo* pInfo)
{
    // 默认准备
    return DoPreparePrinting(pInfo);
}
 
void CMFCApplication3View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
    // TODO: 添加额外的打印前进行的初始化过程
}
 
void CMFCApplication3View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
    // TODO: 添加打印后进行的清理过程
}
 
 
// CMFCApplication3View 诊断
 
#ifdef _DEBUG
void CMFCApplication3View::AssertValid() const
{
    CScrollView::AssertValid();
}
 
void CMFCApplication3View::Dump(CDumpContext& dc) const
{
    CScrollView::Dump(dc);
}
 
CMFCApplication3Doc* CMFCApplication3View::GetDocument() const // 非调试版本是内联的
{
    ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMFCApplication3Doc)));
    return (CMFCApplication3Doc*)m_pDocument;
}
#endif //_DEBUG
 
 
// CMFCApplication3View 消息处理程序