// 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 消息处理程序