ex19doc.cpp
来自「一些VC++的经典实例」· C++ 代码 · 共 101 行
CPP
101 行
// ex19Doc.cpp : implementation of the CEx19Doc class
//
#include "stdafx.h"
#include "ex19.h"
#include "ex19Doc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEx19Doc
IMPLEMENT_DYNCREATE(CEx19Doc, CDocument)
BEGIN_MESSAGE_MAP(CEx19Doc, CDocument)
//{{AFX_MSG_MAP(CEx19Doc)
ON_COMMAND(ID_MENUITEM_CLEAR, OnMenuitemClear)
ON_COMMAND(ID_MENUITEM_PAINT, OnMenuitemPaint)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEx19Doc construction/destruction
CEx19Doc::CEx19Doc()
{
// TODO: add one-time construction code here
m_OperateType=FALSE;
}
CEx19Doc::~CEx19Doc()
{
}
BOOL CEx19Doc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CEx19Doc serialization
void CEx19Doc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CEx19Doc diagnostics
#ifdef _DEBUG
void CEx19Doc::AssertValid() const
{
CDocument::AssertValid();
}
void CEx19Doc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEx19Doc commands
void CEx19Doc::OnMenuitemClear()
{
// TODO: Add your command handler code here
//通知视图清楚图案
m_OperateType=FALSE;
UpdateAllViews(NULL);
}
void CEx19Doc::OnMenuitemPaint()
{
// TODO: Add your command handler code here
//通知视图绘制图案
m_OperateType=TRUE;
UpdateAllViews(NULL);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?