📄 textdoc.cpp
字号:
// TextDoc.cpp : implementation of the CTextDoc class
//
#include "stdafx.h"
#include "Text.h"
#include "TextDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTextDoc
IMPLEMENT_DYNCREATE(CTextDoc, CDocument)
BEGIN_MESSAGE_MAP(CTextDoc, CDocument)
//{{AFX_MSG_MAP(CTextDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CTextDoc construction/destruction
CTextDoc::CTextDoc()
{
// TODO: add one-time construction code here
}
CTextDoc::~CTextDoc()
{
}
BOOL CTextDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CTextDoc serialization
void CTextDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
int nCount = m_Text.GetSize ();
for (int n = 0; n < nCount; ++n)
ar << m_Text[n];
}
else
{
CLine Line;
BOOL bReading = TRUE;
while (bReading)
{
ar >> Line;
bReading = Line.m_bResult;
if (bReading)
m_Text.Add (Line);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CTextDoc diagnostics
#ifdef _DEBUG
void CTextDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CTextDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTextDoc commands
void CTextDoc::DeleteContents()
{
m_Text.RemoveAll ();
CDocument::DeleteContents();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -