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

📄 huatudoc.cpp

📁 主要包含vc++下MFC环境下的对话框等编集的学生查询系统及相关的画图计算程序
💻 CPP
字号:
// huatuDoc.cpp : implementation of the CHuatuDoc class
//

#include "stdafx.h"
#include "huatu.h"

#include "huatuDoc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CHuatuDoc

IMPLEMENT_DYNCREATE(CHuatuDoc, CDocument)

BEGIN_MESSAGE_MAP(CHuatuDoc, CDocument)
	//{{AFX_MSG_MAP(CHuatuDoc)
	ON_COMMAND(ID_DRAW, OnDraw)
	ON_COMMAND(ID_DRAW_LINE, OnDrawLine)
	ON_COMMAND(ID_DRAW_CIRCLE, OnDrawCircle)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CHuatuDoc construction/destruction

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

}

CHuatuDoc::~CHuatuDoc()
{
}

BOOL CHuatuDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;
	m_nrectindex=-1;
	m_udrawtype=0;
	m_blbuttondown=false;

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

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CHuatuDoc serialization

void CHuatuDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
		ar<<m_nrectindex;
		for(int i=0;i<=m_nrectindex;i++)
			ar<<m_srectangles[i].pointfrom<<m_srectangles[i].pointto<<m_srectangles[i].udrawtype;
	}
	else
	{
		// TODO: add loading code here
			ar>>m_nrectindex;
		for(int i=0;i<=m_nrectindex;i++)
			ar>>m_srectangles[i].pointfrom>>m_srectangles[i].pointto>>m_srectangles[i].udrawtype;
	}
}

/////////////////////////////////////////////////////////////////////////////
// CHuatuDoc diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// CHuatuDoc commands



void CHuatuDoc::OnDraw() 
{
	// TODO: Add your command handler code here
	//if(m_udrawtype==0)
		m_udrawtype=1;
//	else
	//	m_udrawtype=0;
	
}

void CHuatuDoc::OnDrawLine() 
{
	// TODO: Add your command handler code here
		m_udrawtype=2;

	
}

void CHuatuDoc::OnDrawCircle() 
{
	// TODO: Add your command handler code here
		m_udrawtype=3;
	
}

⌨️ 快捷键说明

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