⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 minedoc.cpp

📁 能进行画图 鼠标移动画圆 矩形 同时改变光标
💻 CPP
字号:
// mineDoc.cpp : implementation of the CMineDoc class
//

#include "stdafx.h"
#include "mine.h"

#include "mineDoc.h"
#include "mineView.h"
#include "robot.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMineDoc

IMPLEMENT_DYNCREATE(CMineDoc, CDocument)

BEGIN_MESSAGE_MAP(CMineDoc, CDocument)
	//{{AFX_MSG_MAP(CMineDoc)
	ON_COMMAND(ID_RUN, OnRun)
	ON_UPDATE_COMMAND_UI(ID_RUN, OnUpdateRun)
	ON_COMMAND(ID_STOP, OnStop)
	ON_UPDATE_COMMAND_UI(ID_STOP, OnUpdateStop)
	ON_COMMAND(ID_CREATEROBOT, OnCreaterobot)
	ON_UPDATE_COMMAND_UI(ID_CREATEROBOT, OnUpdateCreaterobot)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMineDoc construction/destruction

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

}

CMineDoc::~CMineDoc()
{
}

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

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

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CMineDoc serialization

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

/////////////////////////////////////////////////////////////////////////////
// CMineDoc diagnostics

#ifdef _DEBUG
void CMineDoc::AssertValid() const
{
	CDocument::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// CMineDoc commands

void CMineDoc::OnRun() 
{
	// TODO: Add your command handler code here
	m_updateThread->ResumeThread();
	m_isRunning = TRUE;
}

void CMineDoc::OnUpdateRun(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
if (m_isRunning)
		pCmdUI->SetCheck(1);
	else
		pCmdUI->SetCheck(0);
	
}

void CMineDoc::OnStop() 
{
	// TODO: Add your command handler code here
//	m_updateThread->SuspendThread();
	m_isRunning = FALSE;
}

void CMineDoc::OnUpdateStop(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
		if (m_isRunning)
		pCmdUI->SetCheck(0);
	else
		pCmdUI->SetCheck(1);
}

void CMineDoc::OnCreaterobot() 
{
	// TODO: Add your command handler code here
}

void CMineDoc::OnUpdateCreaterobot(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	
}

⌨️ 快捷键说明

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