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

📄 preview.cpp

📁 Visual C++ 的学习资料一
💻 CPP
字号:
// PreView.cpp: implementation of the CPreView class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Examle1.h"
#include "PreView.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNCREATE(CPreView, CPreviewView)

BEGIN_MESSAGE_MAP(CPreView, CPreviewView)
	//{{AFX_MSG_MAP(CPreView)
	ON_WM_CREATE()
	ON_COMMAND(IDC_ABOUT, OnAppAbout)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

CPreView::CPreView()
{

}

int CPreView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	int retVal = CPreviewView::OnCreate(lpCreateStruct);

	CCreateContext* pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;

	m_print.LoadButtonResource(AFX_ID_PREVIEW_PRINT,m_pToolBar,IDB_BTN1);
	m_next.LoadButtonResource(AFX_ID_PREVIEW_NEXT,m_pToolBar,IDB_BTN3);
	m_prior.LoadButtonResource(AFX_ID_PREVIEW_PREV,m_pToolBar,IDB_BTN2);
	m_about.LoadButtonResource(IDC_ABOUT,m_pToolBar,IDB_BTN5);
	m_close.LoadButtonResource(AFX_ID_PREVIEW_CLOSE,m_pToolBar,IDB_BTN4);

	m_pOrigView = (CExamle1View*)pContext->m_pLastView;
	ASSERT(m_pOrigView != NULL);
	ASSERT_KINDOF(CExamle1View, m_pOrigView);

	return 0;
}

CPreView::~CPreView()
{
	delete m_pToolBar;
}


void CPreView::OnPreviewClose()
{
	m_pToolBar->DestroyWindow();
	m_pToolBar = NULL;

	m_pPreviewInfo->m_nCurPage = m_nCurrentPage;
	m_pOrigView->OnEndPrintPreview(m_pPreviewDC, m_pPreviewInfo,CPoint(0, 0), this);

}

void CPreView::OnAppAbout() 
{
	MessageBox("自定义工具栏","提示");	
}

⌨️ 快捷键说明

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