www.pudn.com > CurveEditor.rar > CurveEditorDoc.cpp
// CurveEditorDoc.cpp : implementation of the CCurveEditorDoc class
//
#include "stdafx.h"
#include "CurveEditor.h"
#include "CurveEditorDoc.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorDoc
IMPLEMENT_DYNCREATE(CCurveEditorDoc, CDocument)
BEGIN_MESSAGE_MAP(CCurveEditorDoc, CDocument)
//{{AFX_MSG_MAP(CCurveEditorDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorDoc construction/destruction
CCurveEditorDoc::CCurveEditorDoc()
{
m_pObjectsTreeView = NULL;
m_hWndCurve = NULL;
m_nCurrentCurve = 0;
}
CCurveEditorDoc::~CCurveEditorDoc()
{
}
BOOL CCurveEditorDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
// m_pObjectsTreeView = (CObjectsTree*)((CMainFrame*)AfxGetMainWnd())->GetTreeView();
// AddView(m_pObjectsTreeView);
// m_hWndObjects = m_pObjectsTreeView->GetSafeHwnd();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorDoc serialization
void CCurveEditorDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorDoc diagnostics
#ifdef _DEBUG
void CCurveEditorDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CCurveEditorDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CCurveEditorDoc commands
void CCurveEditorDoc::SetObjectsTreeView(CObjectsTree *pObjectsTree)
{
m_pObjectsTreeView = pObjectsTree;
}
void CCurveEditorDoc::SetMainViewHwnd(HWND hWnd)
{
m_hWndCurve = hWnd;
}
HWND CCurveEditorDoc::GetMainViewHwnd()
{
return m_hWndCurve;
}