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

📄 drawchipdoc.cpp

📁 本人买的<<VC++项目开发实例>>源代码配套光盘.
💻 CPP
字号:
// DrawChipDoc.cpp : implementation of the CDrawChipDoc class
//

#include "stdafx.h"
#include "DrawChip.h"
#include "resistor.h"

#include "DrawChipDoc.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDrawChipDoc

IMPLEMENT_DYNCREATE(CDrawChipDoc, CDocument)
//IMPLEMENT_SERIAL(CDrawChipDoc, CDocument,0)

BEGIN_MESSAGE_MAP(CDrawChipDoc, CDocument)
	//{{AFX_MSG_MAP(CDrawChipDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDrawChipDoc construction/destruction

//##ModelId=3E18E0E40097
CDrawChipDoc::CDrawChipDoc()
{
	// TODO: add one-time construction code here	

}

//##ModelId=3E18E0E40104
CDrawChipDoc::~CDrawChipDoc()
{
}

//##ModelId=3E18E0E40098
BOOL CDrawChipDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)
	
	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CDrawChipDoc serialization

//##ModelId=3E18E0E4009A
void CDrawChipDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
	m_ChipObList.Serialize(ar);
}

/////////////////////////////////////////////////////////////////////////////
// CDrawChipDoc diagnostics

#ifdef _DEBUG
//##ModelId=3E18E0E40106
void CDrawChipDoc::AssertValid() const
{
	CDocument::AssertValid();
}

//##ModelId=3E18E0E40108
void CDrawChipDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDrawChipDoc commands

//##ModelId=3E18E0E4009D
void CDrawChipDoc::DeleteContents() 
{
	// TODO: Add your specialized code here and/or call the base class
	while(m_ChipObList.GetHeadPosition())
	{
		delete m_ChipObList.RemoveHead();
	}
	CDocument::DeleteContents();
}

//##ModelId=3E18E0E400C8
BOOL CDrawChipDoc::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	// TODO: Add your specialized creation code here
	/*POSITION pos = GetFirstViewPosition();   
    CView * pView = GetNextView(pos);
	CClientDC dc(pView);	
	pView->OnPrepareDC(&dc);

	CObject *p = m_ChipObList.GetHead();
	CResistor *pRe = (CResistor *)p;
	pRe->m_RectTracker.m_rect = pRe->m_Rect;
	dc.LPtoDP(pRe->m_RectTracker.m_rect);*/

	return TRUE;
}

⌨️ 快捷键说明

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