cffdoc.cpp

来自「与vc++界面十分类似的词法分析器」· C++ 代码 · 共 95 行

CPP
95
字号
// CFFDoc.cpp : implementation of the CCFFDoc class
//

#include "stdafx.h"
#include "CFF.h"

#include "CFFDoc.h"
#include "CFFView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCFFDoc

IMPLEMENT_DYNCREATE(CCFFDoc, CDocument)

BEGIN_MESSAGE_MAP(CCFFDoc, CDocument)
	//{{AFX_MSG_MAP(CCFFDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCFFDoc construction/destruction

CCFFDoc::CCFFDoc()
{
	// TODO: add one-time construction code here

}

CCFFDoc::~CCFFDoc()
{
}

BOOL CCFFDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)
	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CCFFDoc serialization

void CCFFDoc::Serialize(CArchive& ar)
{
	// CEditView contains an edit control which handles all serialization
	((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
}

/////////////////////////////////////////////////////////////////////////////
// CCFFDoc diagnostics

#ifdef _DEBUG
void CCFFDoc::AssertValid() const
{
	CDocument::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// CCFFDoc commands

BOOL CCFFDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	POSITION pos=GetFirstViewPosition();
	CCFFView *pView=(CCFFView*)GetNextView(pos);
	pView->ShowWindow(SW_SHOW);
	pView->m_text.Format(lpszPathName);
	CString m_text;
	m_text.Format(lpszPathName);
	pView->DrawText(m_text);
	// TODO: Add your specialized creation code here
	//MessageBox(NULL,lpszPathName,"Find",MB_OK);
	return TRUE;
}

⌨️ 快捷键说明

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