📄 multiprintdoc.cpp
字号:
// MultiPrintDoc.cpp : implementation of the CMultiPrintDoc class
//
#include "stdafx.h"
#include "MultiPrint.h"
#include "MultiPrintDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMultiPrintDoc
IMPLEMENT_DYNCREATE(CMultiPrintDoc, CDocument)
BEGIN_MESSAGE_MAP(CMultiPrintDoc, CDocument)
//{{AFX_MSG_MAP(CMultiPrintDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMultiPrintDoc construction/destruction
CMultiPrintDoc::CMultiPrintDoc()
{
// TODO: add one-time construction code here
}
CMultiPrintDoc::~CMultiPrintDoc()
{
}
BOOL CMultiPrintDoc::OnNewDocument()
{
//if (!CDocument::OnNewDocument())
//return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
//return TRUE;
if (!CDocument::OnNewDocument())
return FALSE;
int n1, n2, n3;
// Make 50 random circles
srand((unsigned) time(NULL));
m_retangleArr.SetSize(nMax);
for (int i = 0; i < nMax; i++) {
n1 = rand() * 600 / RAND_MAX;
n2 = rand() * 600 / RAND_MAX;
n3 = rand() * 50 / RAND_MAX;
m_retangleArr[i] = CRect(n1, -n2, n1 + n3, -(n2 + n3));
}
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMultiPrintDoc serialization
void CMultiPrintDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CMultiPrintDoc diagnostics
#ifdef _DEBUG
void CMultiPrintDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMultiPrintDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMultiPrintDoc commands
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -