?? zhanglu15doc.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 + -