⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tempview.cpp

📁 《AE库通用模块及典型系统开发实例导航》光盘内容分享!
💻 CPP
字号:
// TempView.cpp : implementation file
//

#include "stdafx.h"
#include "PrintDemo2.h"
#include "TempView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTempView

IMPLEMENT_DYNCREATE(CTempView, CView)

CTempView::CTempView()
{
}

CTempView::~CTempView()
{
}


BEGIN_MESSAGE_MAP(CTempView, CView)
	//{{AFX_MSG_MAP(CTempView)
	ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, OnFilePrintPreview)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTempView drawing

void CTempView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CTempView diagnostics

#ifdef _DEBUG
void CTempView::AssertValid() const
{
	CView::AssertValid();
}

void CTempView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CTempView message handlers

void CTempView::OnFilePrint()
{
	CView::OnFilePrint();
}

void CTempView::OnFilePrintPreview()
{
	CView::OnFilePrintPreview();
}

void CTempView::OnPrint(CDC* pDC, CPrintInfo* pInfo) 
{
	if(m_dlg)
	{
		CEdit * pTest = (CEdit *)(m_dlg->GetDlgItem(IDC_EDIT_TEST));
		CString strTest;
		pTest->GetWindowText(strTest);
		pDC->DrawText(strTest, &pInfo->m_rectDraw, DT_LEFT | DT_NOPREFIX);
	}
	CView::OnPrint(pDC, pInfo);
}

BOOL CTempView::OnPreparePrinting(CPrintInfo* pInfo) 
{
	return DoPreparePrinting(pInfo);
}

void CTempView::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView) 
{
	CView::OnEndPrintPreview(pDC, pInfo, point, pView);

	//显示原始窗口
	m_pFrameWnd->ShowWindow(SW_SHOW);
	
	//恢复原始主窗口
	AfxGetApp()->m_pMainWnd = m_pFrameWnd;
	
	//销毁父窗口和自身
	GetParentFrame()->DestroyWindow();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -