📄 vc07doc.cpp
字号:
// VC07Doc.cpp : implementation of the CVC07Doc class
//
#include "stdafx.h"
#include "VC07.h"
#include "VC07Doc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVC07Doc
IMPLEMENT_DYNCREATE(CVC07Doc, CDocument)
BEGIN_MESSAGE_MAP(CVC07Doc, CDocument)
//{{AFX_MSG_MAP(CVC07Doc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CVC07Doc construction/destruction
CVC07Doc::CVC07Doc()
{
// TODO: add one-time construction code here
}
CVC07Doc::~CVC07Doc()
{
}
BOOL CVC07Doc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CVC07Doc serialization
void CVC07Doc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CVC07Doc diagnostics
#ifdef _DEBUG
void CVC07Doc::AssertValid() const
{
CDocument::AssertValid();
}
void CVC07Doc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVC07Doc commands
///////////////////////////////////////////////////////////////////////
// CEllipseRec construction
CEllipseRec::CEllipseRec(int wnx,int wny,int esx,int esy)
{
m_WNX=wnx;
m_WNY=wny;
m_ESX=esx;
m_ESY=esy;
};
///////////////////////////////////////////////////////////////////////
// CEllipseRec DrawEllipse
void CEllipseRec::DrawEllipse(CDC *pDC)
{
pDC->SetROP2(R2_NOT);
pDC->Ellipse(m_WNX,m_WNY,m_ESX,m_ESY);
};
///////////////////////////////////////////////////////////////////////
// CVc07Doc 向记录集中增加一条椭圆记录
void CVC07Doc::AddEllipseRec(int wnx,int wny,int esx,int esy)
{
CEllipseRec *pNewRec=new CEllipseRec(wnx,wny,esx,esy);
m_EllipseArray.Add(pNewRec);
};
///////////////////////////////////////////////////////////////////////
// CVc07Doc 从记录集中获取一条椭圆记录
CEllipseRec *CVC07Doc::GetEllipseRec(int index)
{
if(index<0||index>m_EllipseArray.GetUpperBound())
return 0;
return(CEllipseRec *)m_EllipseArray.GetAt(index);
};
///////////////////////////////////////////////////////////////////////
// CVc07Doc 获取记录集中椭圆记录总数
int CVC07Doc::GetTotalEllipseRec()
{
return m_EllipseArray.GetSize();
};
///////////////////////////////////////////////////////////////////////
// CVc07Doc 删除记录集中椭圆记录
void CVC07Doc::DeleteContents()
{
int index;
index=m_EllipseArray.GetSize();
while(index--)
delete m_EllipseArray.GetAt(index);
m_EllipseArray.RemoveAll();
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -