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

📄 myextdatamodel.h

📁 在编写图形程序
💻 H
字号:
// MyExtDataModel.h: interface for the CMyExtDataModel class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MYEXTDATAMODEL_H__1D050F57_6EB3_11DF_A473_525400EA266C__INCLUDED_)
#define AFX_MYEXTDATAMODEL_H__1D050F57_6EB3_11DF_A473_525400EA266C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CMyExtDataModel : public CFODataModel
{
protected:
	DECLARE_SERIAL(CMyExtDataModel);

public:
	// Constructor.
	CMyExtDataModel();

	// Copy constructor. 
	CMyExtDataModel(const CMyExtDataModel& source);

	// Deconstructor.
	virtual ~CMyExtDataModel();

public:

	// Init model data.
	virtual void DoInitData();

	// Set modified flag.
	virtual void SetModifiedFlag(BOOL bModified = TRUE);

	// Is modified.
	virtual BOOL IsModified();

	// Notify observer wnd.
	virtual void NotifyObserver(LPARAM lHint, CObject*pHint = NULL);

	// Update Title
	virtual void UpdateTitle();

	// Do action change.
	virtual void DoActionChange(const CFOBaseAction* pAction);

	// Do create a new shape.
	// m_drawshape -- Shape Type id start from FO_COMP_CUSTOM
	// rcCreate -- init position of shape.
	// strFileName -- if being image shape,this is the image file name.
	// pCurItem -- if being drag and drop from toolbox,this is the pointer of current toolbox item.
	virtual CFODrawShape *DoCreateShapeByType(UINT m_drawshape,CRect &rcCreate,CString strFileName = _T(""),CFOToolBoxItem *pCurItem = NULL);

	// Do create a new shape shape.
	// m_drawshape -- Shape Type id start from FO_COMP_CUSTOM
	// rcCreate -- init position of shape.
	// strFileName -- if being image shape,this is the image file name.
	// pCurItem -- if being drag and drop from toolbox,this is the pointer of current toolbox item.
	virtual CFOCompositeShape *DoCreateCompositeShapeByType(UINT m_drawshape,CRect &rcCreate,
		CArray<FOPORTVALUE,FOPORTVALUE> *arInitPorts,
		CString strFileName = _T(""),
		UINT nResID = 0,
		CFOToolBoxItem *pCurItem = NULL);

	// Draw shape.
	virtual void OnDrawShape(CDC *pDC,const CRect &rcView);

	// Draw Back ground.
	virtual void OnDrawBack(CDC *pDC);

	// Get Unique Name
	virtual CString GetUniqueName(UINT nType);

	// Get Unique Caption
	virtual CString GetUniqueCaption(UINT nType);

public:

	// Serialize data to file.
	virtual void Serialize(CArchive &ar);

	// Save Document to a specify file.
	virtual BOOL SaveDocument(LPCTSTR lpszPathName);

	// Open Document from a specify file.
	virtual BOOL OpenDocument(LPCTSTR lpszPathName);

	// Get the pointer of File.
	CFile *		 GetFile(LPCTSTR lpszFileName, UINT nOpenFlags,CFileException* pError);

	// Release File from memory.
	virtual void ReleaseFile(CFile* pFile, BOOL bAbort);

// Implementation
public:

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

};


#endif // !defined(AFX_MYEXTDATAMODEL_H__1D050F57_6EB3_11DF_A473_525400EA266C__INCLUDED_)

⌨️ 快捷键说明

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