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

📄 zscasmeditordoc.cpp

📁 袖珍型的pascal编译器
💻 CPP
字号:
// ZSCAsmEditorDoc.cpp : implementation file
//

#include "stdafx.h"


#include <Tlhelp32.h>
#include <winperf.h>
#include <shlguid.h>
#include <shlobj.h>
#include <tchar.h>

#include "zscpascal.h"
#include "ZSCAsmEditorDoc.h"
#include "ZSCAsmEditorView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CZSCAsmEditorDoc

IMPLEMENT_DYNCREATE(CZSCAsmEditorDoc, CDocument)

CZSCAsmEditorDoc::CZSCAsmEditorDoc()
{
	memset(&m_lf, 0, sizeof(m_lf));
	m_lf.lfWeight = FW_NORMAL;
	m_lf.lfCharSet = ANSI_CHARSET;
	m_lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
	m_lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
	m_lf.lfQuality = DEFAULT_QUALITY;
	m_lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
	strcpy(m_lf.lfFaceName, "Courier");
}

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

	((CCrystalEditView*)m_viewList.GetHead())->SetWindowText("");
	m_TextBuffer.InitNew();

	return TRUE;
}

CZSCAsmEditorDoc::~CZSCAsmEditorDoc()
{
}


BEGIN_MESSAGE_MAP(CZSCAsmEditorDoc, CDocument)
	//{{AFX_MSG_MAP(CZSCAsmEditorDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CZSCAsmEditorDoc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CZSCAsmEditorDoc serialization

void CZSCAsmEditorDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CZSCAsmEditorDoc commands

BOOL CZSCAsmEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	// TODO: Add your specialized creation code here
	return m_TextBuffer.LoadFromFile(lpszPathName);
}

BOOL CZSCAsmEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) 
{
	// TODO: Add your specialized code here and/or call the base class
	m_TextBuffer.SaveToFile(lpszPathName);
	return TRUE;	//	Note - we didn't call inherited member!
}

void CZSCAsmEditorDoc::DeleteContents() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	CDocument::DeleteContents();
	m_TextBuffer.FreeAll();
}

⌨️ 快捷键说明

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