-
Notifications
You must be signed in to change notification settings - Fork 2
/
FormObjectDoc.cpp
105 lines (83 loc) · 1.95 KB
/
FormObjectDoc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//Àâòîðñêèå ïðàâà - VTOOLS.RU (info@vtools.ru)
// FormObjectDoc.cpp : implementation file
//
#include "stdafx.h"
#include "enterprise.h"
#include "FormObject.h"
#include "FormObjectDoc.h"
#include "MetadataTree.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFormObjectDoc
IMPLEMENT_DYNCREATE(CFormObjectDoc, CMetaDocument)
CFormObjectDoc::CFormObjectDoc()
{
SetObj(afxMetaObj);
SetTree(afxMetaTree);
}
BOOL CFormObjectDoc::OnNewDocument()
{
if (!CMetaDocument::OnNewDocument())
return FALSE;
return TRUE;
}
CFormObjectDoc::~CFormObjectDoc()
{
}
BEGIN_MESSAGE_MAP(CFormObjectDoc, CMetaDocument)
//{{AFX_MSG_MAP(CFormObjectDoc)
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFormObjectDoc diagnostics
#ifdef _DEBUG
void CFormObjectDoc::AssertValid() const
{
CMetaDocument::AssertValid();
}
void CFormObjectDoc::Dump(CDumpContext& dc) const
{
CMetaDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFormObjectDoc serialization
void CFormObjectDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CFormObjectDoc commands
BOOL CFormObjectDoc::SaveModified()
{
CFormObject* pView = (CFormObject*)GetView();
if(GetTree())
GetTree()->GetDocument()->SetModifiedFlag(1);
return TRUE;
}
void CFormObjectDoc::OnCloseDocument()
{
if(GetTree())
GetTree()->RemoveFromList(GetObj(),GetObjName());
CMetaDocument::OnCloseDocument();
}
void CFormObjectDoc::OnFileSaveAs()
{
// TODO: Add your command handler code here
}
void CFormObjectDoc::OnChangedViewList()
{
GetView()->OnUpdate();
}