📄 pdfviewdoc.cpp
字号:
// PdfViewDoc.cpp : implementation of the CPdfViewDoc class
//
#include "stdafx.h"
#include "Resource.h"
#include "PdfView.h"
#include "PdfViewDoc.h"
#include "MainFrm.h"
#include "StructureView.h"
#include "TextView.h"
#include "BPdf.h"
#include ".\pdfviewdoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CPdfViewDoc
IMPLEMENT_DYNCREATE(CPdfViewDoc, CDocument)
BEGIN_MESSAGE_MAP(CPdfViewDoc, CDocument)
ON_COMMAND(ID_FILE_SAVE_AS_DOT, OnFileSaveAsDot)
ON_UPDATE_COMMAND_UI(ID_FILE_SAVE_AS_DOT, OnUpdateFileSaveAsDot)
END_MESSAGE_MAP()
// CPdfViewDoc construction/destruction
CPdfViewDoc::CPdfViewDoc()
{
// TODO: add one-time construction code here
}
CPdfViewDoc::~CPdfViewDoc()
{
}
CBPdf& CPdfViewDoc::GetPdf()
{
return m_pdf;
}
// CPdfViewDoc serialization
void CPdfViewDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
// CPdfViewDoc diagnostics
#ifdef _DEBUG
void CPdfViewDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CPdfViewDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
// CPdfViewDoc commands
BOOL CPdfViewDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// TODO: Add your specialized creation code here
if (m_pdf.IsOpen())
m_pdf.Close();
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
return m_pdf.Open(lpszPathName);
}
void CPdfViewDoc::OnCloseDocument()
{
// TODO: Add your specialized code here and/or call the base class
if (m_pdf.IsOpen())
m_pdf.Close();
CDocument::OnCloseDocument();
}
void CPdfViewDoc::OnFileSaveAsDot()
{
// TODO: Add your command handler code here
if (m_pdf.IsOpen() == FALSE)
return;
m_pdf.SaveAsDot();
}
void CPdfViewDoc::OnUpdateFileSaveAsDot(CCmdUI *pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable(m_pdf.IsOpen());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -