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

📄 zhanglu15doc.cpp

📁 简单文本编辑器
💻 CPP
字号:
// zhanglu15Doc.cpp : implementation of the CZhanglu15Doc class
//

#include "stdafx.h"
#include "zhanglu15.h"

#include "zhanglu15Doc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CZhanglu15Doc

IMPLEMENT_DYNCREATE(CZhanglu15Doc, CDocument)

BEGIN_MESSAGE_MAP(CZhanglu15Doc, CDocument)
	//{{AFX_MSG_MAP(CZhanglu15Doc)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CZhanglu15Doc construction/destruction

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

}

CZhanglu15Doc::~CZhanglu15Doc()
{
}

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

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CZhanglu15Doc serialization

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

/////////////////////////////////////////////////////////////////////////////
// CZhanglu15Doc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CZhanglu15Doc commands

CLine* CZhanglu15Doc::GetLine(int nIndex)
{
if(nIndex<0||nIndex>m_LineArray.GetUpperBound())  
					// 判断是否越界
		return  NULL;
	return m_LineArray.GetAt(nIndex);  
				// 返回给定序号线段对象的指针
}

void CZhanglu15Doc::AddLine(CPoint pt1, CPoint pt2)
{
CLine*  pLine=new CLine(pt1, pt2);  
					// 新建一条线段对象
	m_LineArray.Add(pLine);  // 将该线段加到动态数组

}

int CZhanglu15Doc::GetNumLines()
{
return m_LineArray.GetSize();  
					// 返回线段的数量

}

//DEL void CZhanglu15Doc::OnUpdateIdcColor(CCmdUI* pCmdUI) 
//DEL {
//DEL 	// TODO: Add your command update UI handler code here
//DEL 
//DEL }

//DEL void CZhanglu15Doc::DeleteContents() 
//DEL {
//DEL 	// TODO: Add your specialized code here and/or call the base class
//DEL 	
//DEL 	CDocument::DeleteContents();
//DEL }

⌨️ 快捷键说明

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