📄 singledrawdoc.cpp
字号:
// SingleDrawDoc.cpp : implementation of the CSingleDrawDoc class
//
#include "stdafx.h"
#include "SingleDraw.h"
#include "SingleDrawDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSingleDrawDoc
IMPLEMENT_DYNCREATE(CSingleDrawDoc, CDocument)
BEGIN_MESSAGE_MAP(CSingleDrawDoc, CDocument)
//{{AFX_MSG_MAP(CSingleDrawDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CSingleDrawDoc construction/destruction
CSingleDrawDoc::CSingleDrawDoc()
{
// TODO: add one-time construction code here
m_docSize = CSize(800, 900); // Default size
m_strokeList.RemoveAll();
}
CSingleDrawDoc::~CSingleDrawDoc()
{
m_strokeList.RemoveAll();
}
BOOL CSingleDrawDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
m_strokeList.RemoveAll();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CSingleDrawDoc serialization
void CSingleDrawDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
// Delete the preview stroke list at first.
if(! m_strokeList.IsEmpty()) m_strokeList.RemoveAll();
}
m_strokeList.Serialize(ar);
}
/////////////////////////////////////////////////////////////////////////////
// CSingleDrawDoc diagnostics
#ifdef _DEBUG
void CSingleDrawDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CSingleDrawDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CSingleDrawDoc commands
CSize & CSingleDrawDoc::GetDocSize()
{
return m_docSize;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -