📄 mdicoindoc.cpp
字号:
// MDICoinDoc.cpp : implementation of the CMDICoinDoc class
//
#include "stdafx.h"
#include "MDICoin.h"
#include "MDICoinDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMDICoinDoc
IMPLEMENT_DYNCREATE(CMDICoinDoc, CDocument)
BEGIN_MESSAGE_MAP(CMDICoinDoc, CDocument)
//{{AFX_MSG_MAP(CMDICoinDoc)
ON_COMMAND(ID_EDIT_ADD_COIN, OnEditAddCoin)
ON_COMMAND(ID_EDIT_REMOVE_COIN, OnEditRemoveCoin)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMDICoinDoc construction/destruction
CMDICoinDoc::CMDICoinDoc()
{
// TODO: add one-time construction code here
m_nCoins = 1;
}
CMDICoinDoc::~CMDICoinDoc()
{
}
BOOL CMDICoinDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMDICoinDoc serialization
void CMDICoinDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CMDICoinDoc diagnostics
#ifdef _DEBUG
void CMDICoinDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CMDICoinDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMDICoinDoc commands
int CMDICoinDoc::GetCoinCount()
{
return m_nCoins;
}
void CMDICoinDoc::OnEditAddCoin()
{
// TODO: Add your command handler code here
m_nCoins++;
UpdateAllViews(NULL );
}
void CMDICoinDoc::OnEditRemoveCoin()
{
// TODO: Add your command handler code here
if (m_nCoins > 0)
m_nCoins--;
UpdateAllViews( NULL);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -