rj030619doc.cpp

来自「VC++一些代码,自己制作,可以实现密码登录,有画圆等功能.」· C++ 代码 · 共 136 行

CPP
136
字号
// RJ030619Doc.cpp : implementation of the CRJ030619Doc class
//

#include "stdafx.h"
#include "RJ030619.h"

#include "RJ030619Doc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRJ030619Doc

IMPLEMENT_DYNCREATE(CRJ030619Doc, CDocument)

BEGIN_MESSAGE_MAP(CRJ030619Doc, CDocument)
	//{{AFX_MSG_MAP(CRJ030619Doc)
	ON_COMMAND(ID_COIN_ADD, OnCoinAdd)
	ON_COMMAND(ID_COIN_SUB, OnCoinSub)
	ON_UPDATE_COMMAND_UI(ID_COIN_SUB, OnUpdateCoinSub)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRJ030619Doc construction/destruction

CRJ030619Doc::CRJ030619Doc()
{
	// TODO: add one-time construction code here

}

CRJ030619Doc::~CRJ030619Doc()
{
}

BOOL CRJ030619Doc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CRJ030619Doc serialization

void CRJ030619Doc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CRJ030619Doc diagnostics

#ifdef _DEBUG
void CRJ030619Doc::AddLine(CPoint pt1,CPoint pt2)//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
{
	CLine *pLine=new CLine(pt1,pt2);//新建一条线段对象
	m_LineArray.Add(pLine);//将该线段对象加到动态数组
}
CLine * CRJ030619Doc::GetLine(int nIndex)//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
{
	if(nIndex<0||nIndex>m_LineArray.GetUpperBound())// 判断是否越界
		return NULL;
	return m_LineArray.GetAt(nIndex);//返回给定序号线段对象的指针
}
int CRJ030619Doc::GetNumLines()//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
{
	return m_LineArray.GetSize();//返回线段的数量
}
void CRJ030619Doc::AssertValid() const
{
	CDocument::AssertValid();
}

void CRJ030619Doc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CRJ030619Doc commands

void CRJ030619Doc::DeleteContents() 
{
	// TODO: Add your specialized code here and/or call the base class
	m_nCoins=1;
	CDocument::DeleteContents();
}

void CRJ030619Doc::OnCoinAdd() 
{
	// TODO: Add your command handler code here
	m_nCoins++;
	UpdateAllViews(NULL);
}

void CRJ030619Doc::OnCoinSub() 
{
	// TODO: Add your command handler code here
	m_nCoins--;
	UpdateAllViews(NULL);
}

void CRJ030619Doc::OnUpdateCoinSub(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	if(m_nCoins<1) pCmdUI->Enable(FALSE);
	else
		pCmdUI->Enable(TRUE);
}

//DEL void CRJ030619Doc::OnMENUIplay() 
//DEL {
//DEL 	// TODO: Add your command handler code here
//DEL 	
//DEL }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?