|
#include "StdAfx.h"
#include "appdoc.h"
namespace GE_{ namespace App{
IMPLEMENT_DYNCREATE(CAppDoc, CDocument)
CAppDoc::CAppDoc(void)
{
}
CAppDoc::~CAppDoc(void)
{
}
BOOL CAppDoc::OnNewDocument()
{
if(!CDocument::OnNewDocument()) return false;
_pRoot = new Data::CAssembled; //will relese the old root
_pRoot->_pDocument = this;
_list.push_back(_pRoot); //can be drawn
return !!_pRoot;
}
void CAppDoc::Serialize(CArchive& ar)
{
//instantiate the archive associated maps
Safe::SArchiveMaps maps(ar);
//save and load the pointers
if (ar.IsStoring())
{
ar << _pRoot;
ar << _list;
}
else
{
ar >> _pRoot;
ar >> _list;
}
}
CRect CAppDoc::GetDocBounds() const
{
TList::const_iterator i;
CRect rcDoc(0,0,1,1);
for(i=_list.begin(); i!=_list.end(); i++)
{
if(! *i) continue;
rcDoc |= (**i).GetBounds();
}
return rcDoc;
}
}}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Born and living in Milan (Italy), I'm an engineer in electronics actually working in the ICT department of an important oil/gas & energy company as responsible for planning and engineering of ICT infrastructures.
Interested in programming since the '70s, today I still define architectures for the ICT, deploying dedicated specific client application for engineering purposes, working with C++, MFC, STL, and recently also C# and D.