99 lines
2.1 KiB
C++
Executable File
99 lines
2.1 KiB
C++
Executable File
// FrontEndDoc.cpp : implementation of the CFrontEndDoc class
|
|
//
|
|
|
|
#include "StdAfx.h"
|
|
|
|
#include "FrontDoc.h"
|
|
#include "FrontVw.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFrontEndDoc
|
|
|
|
IMPLEMENT_DYNCREATE(CFrontEndDoc, CDocument)
|
|
|
|
BEGIN_MESSAGE_MAP(CFrontEndDoc, CDocument)
|
|
//{{AFX_MSG_MAP(CFrontEndDoc)
|
|
// 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()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFrontEndDoc construction/destruction
|
|
|
|
CFrontEndDoc::CFrontEndDoc()
|
|
{
|
|
// TODO: add one-time construction code here
|
|
|
|
}
|
|
|
|
CFrontEndDoc::~CFrontEndDoc()
|
|
{
|
|
}
|
|
|
|
BOOL CFrontEndDoc::OnNewDocument()
|
|
{
|
|
if (!CDocument::OnNewDocument())
|
|
return FALSE;
|
|
|
|
SetTitle("PRASSI");
|
|
return TRUE;
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFrontEndDoc serialization
|
|
|
|
BOOL CFrontEndDoc::DoSave(LPCTSTR lpszPathName, BOOL bReplace)
|
|
{
|
|
BOOL ok = CDocument::DoSave(lpszPathName, bReplace);
|
|
SetTitle("PRASSI");
|
|
return ok;
|
|
}
|
|
|
|
void CFrontEndDoc::Serialize(CArchive& ar)
|
|
{
|
|
if (ar.IsStoring())
|
|
{
|
|
POSITION pos = GetFirstViewPosition();
|
|
CFrontEndView* pView = (CFrontEndView*)GetNextView(pos);
|
|
CTreeCtrl& pTreeCtrl = pView->GetTreeCtrl();
|
|
CString strText;
|
|
for (HTREEITEM hItem = pTreeCtrl.GetRootItem();
|
|
hItem != NULL;
|
|
hItem = pTreeCtrl.GetNextItem(hItem, TVGN_NEXT))
|
|
{
|
|
strText = pTreeCtrl.GetItemText(hItem);
|
|
ar.Write((LPCSTR)strText, strText.GetLength());
|
|
ar << char(0x0A);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// TODO: add loading code here
|
|
}
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFrontEndDoc diagnostics
|
|
|
|
#ifdef _DEBUG
|
|
void CFrontEndDoc::AssertValid() const
|
|
{
|
|
CDocument::AssertValid();
|
|
}
|
|
|
|
void CFrontEndDoc::Dump(CDumpContext& dc) const
|
|
{
|
|
CDocument::Dump(dc);
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CFrontEndDoc commands
|