Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DrawSysDoc.cpp
Package: DrawSys.zip [view]
Upload User: mosfetic
Upload Date: 2022-06-16
Package Size: 4612k
Code Size: 3k
Category:
GDI-Bitmap
Development Platform:
Visual C++
- // DrawSysDoc.cpp : implementation of the CDrawSysDoc class
- //
- #include "stdafx.h"
- #include "DrawSys.h"
- #include "DrawSysDoc.h"
- #include "DrawShape.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDrawSysDoc
- IMPLEMENT_DYNCREATE(CDrawSysDoc, CDocument)
- BEGIN_MESSAGE_MAP(CDrawSysDoc, CDocument)
- //{{AFX_MSG_MAP(CDrawSysDoc)
- // 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()
- /////////////////////////////////////////////////////////////////////////////
- // CDrawSysDoc construction/destruction
- CDrawSysDoc::CDrawSysDoc()
- {
- // TODO: add one-time construction code here
- }
- CDrawSysDoc::~CDrawSysDoc()
- {
- }
- BOOL CDrawSysDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDrawSysDoc serialization
- void CDrawSysDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- m_obArray.Serialize(ar);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CDrawSysDoc diagnostics
- #ifdef _DEBUG
- void CDrawSysDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CDrawSysDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CDrawSysDoc commands
- void CDrawSysDoc::AddShape(CDrawShape* pDrawShape)
- {
- if(pDrawShape)
- {
- m_obArray.Add((CObject*)pDrawShape);
- }
- }
- void CDrawSysDoc::DeleteContents()
- {
- // TODO: Add your specialized code here and/or call the base class
- while(m_obArray.GetSize() > 0)
- {
- delete m_obArray.GetAt(0);
- m_obArray.RemoveAt(0);
- }
- CDocument::DeleteContents();
- }
- BOOL CDrawSysDoc::OnOpenDocument(LPCTSTR lpszPathName)
- {
- if (!CDocument::OnOpenDocument(lpszPathName))
- return FALSE;
- // TODO: Add your specialized creation code here
- int iTotal = m_obArray.GetSize();
- CWnd* pWnd = AfxGetMainWnd();
- for(int i=0; i<iTotal; i++)
- {
- ((CMainFrame*)pWnd)->m_wndShapeTree.InsertShape((CDrawShape*)m_obArray.GetAt(i), i+1);
- }
- return TRUE;
- }