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

📄 textview.cpp

📁 这是一个PDF文件查看的程序
💻 CPP
字号:
// TextView.cpp : implementation of the CTextView class
//

#include "stdafx.h"
#include "PdfView.h"

#include "PdfViewDoc.h"
#include "TextView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CTextView

IMPLEMENT_DYNCREATE(CTextView, CRichEditView)

BEGIN_MESSAGE_MAP(CTextView, CRichEditView)
	ON_WM_STYLECHANGED()
END_MESSAGE_MAP()

// CTextView construction/destruction

CTextView::CTextView()
{
	// TODO: add construction code here

}

CTextView::~CTextView()
{
}

BOOL CTextView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CRichEditView::PreCreateWindow(cs);
}

void CTextView::OnInitialUpdate()
{
	CRichEditView::OnInitialUpdate();

	// TODO: You may populate your ListView with items by directly accessing
	//  its list control through a call to GetListCtrl().
	CRichEditCtrl& text = GetRichEditCtrl();
	text.SetReadOnly(1);

	CPdfViewDoc* pdoc = GetDocument();
	CBPdf& pdf = pdoc->GetPdf();
	if (!pdf.IsOpen())
		return;

	pdf.Draw(&text);
}

// CTextView diagnostics

#ifdef _DEBUG
void CTextView::AssertValid() const
{
	CRichEditView::AssertValid();
}

void CTextView::Dump(CDumpContext& dc) const
{
	CRichEditView::Dump(dc);
}

CPdfViewDoc* CTextView::GetDocument() const // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPdfViewDoc)));
	return (CPdfViewDoc*)m_pDocument;
}
#endif //_DEBUG


// CTextView message handlers
void CTextView::OnStyleChanged(int /*nStyleType*/, LPSTYLESTRUCT /*lpStyleStruct*/)
{
	//TODO: add code to react to the user changing the view style of your window
	
	Default();
}

⌨️ 快捷键说明

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