📄 mydrawdoc.cpp
字号:
// MyDrawDoc.cpp : implementation of the CMyDrawDoc class
//
#include "stdafx.h"
#include "MyDraw.h"
#include "MyDrawDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyDrawDoc
IMPLEMENT_DYNCREATE(CMyDrawDoc, CDocument)
BEGIN_MESSAGE_MAP(CMyDrawDoc, CDocument)
//{{AFX_MSG_MAP(CMyDrawDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMyDrawDoc construction/destruction
CMyDrawDoc::CMyDrawDoc()
{
// TODO: add one-time construction code here
m_Pointsta.SetSize(0,256);
m_Pointend.SetSize(0,256);
m_RectCircle.SetSize(0,256);
m_RectJuxing.SetSize(0,256);
m_RectQuere.SetSize(0,256);
m_Pointag.SetSize(0,256);
m_AllPoint.SetSize(0,256);
//m_Pointagend.SetSize(256,256);
//m_RectRcircle.SetSize(256,256);
}
CMyDrawDoc::~CMyDrawDoc()
{
}
BOOL CMyDrawDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
m_AllPoint.SetSize(0,256);
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMyDrawDoc serialization
void CMyDrawDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
int size=m_AllPoint.GetSize();
ar<<size;
for(int i=0;i<size;i++){
ar<<m_AllPoint[i].point;
ar<<m_AllPoint[i].color;
ar<<m_AllPoint[i].style;
ar<<m_AllPoint[i].width;
}
}
else
{
// TODO: add loading code here
int size;
ar>>size;
for(int i=0;i<size;i++){
AllPoint point;
ar>>point.point;
ar>>point.color;
ar>>point.style;
ar>>point.width;
m_AllPoint.Add(point);
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CMyDrawDoc diagnostics
#ifdef _DEBUG
void CMyDrawDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMyDrawDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMyDrawDoc commands
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -