// ScZmDoc.cpp : implementation of the CScZmDoc class // #include "stdafx.h" #include "ScZm.h" #include "ScZmDoc.h" #include "ScZmView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CScZmDoc IMPLEMENT_DYNCREATE(CScZmDoc, CDocument) BEGIN_MESSAGE_MAP(CScZmDoc, CDocument) //{{AFX_MSG_MAP(CScZmDoc) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CScZmDoc construction/destruction CScZmDoc::CScZmDoc() { // TODO: add one-time construction code here } CScZmDoc::~CScZmDoc() { } BOOL CScZmDoc::OnNewDocument() { if (!CDocument::OnNewDocument()) return FALSE; // TODO: add reinitialization code here // (SDI documents will reuse this document) return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CScZmDoc serialization void CScZmDoc::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here } else { // TODO: add loading code here } } ///////////////////////////////////////////////////////////////////////////// // CScZmDoc diagnostics #ifdef _DEBUG void CScZmDoc::AssertValid() const { CDocument::AssertValid(); } void CScZmDoc::Dump(CDumpContext& dc) const { CDocument::Dump(dc); } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CScZmDoc commands BOOL CScZmDoc::OnOpenDocument(LPCTSTR lpszPathName) { if (!CDocument::OnOpenDocument(lpszPathName)) return FALSE; CScZmView *pView = (CScZmView *) GetView(); if (!pView) return false; if (pView->m_LeadBWnd.Load((L_TCHAR L_FAR *)lpszPathName) != SUCCESS) return false; // This command is added so that when plus or minus pressed ... the zoom will be // equivalent to 2 (Zoom In) or 1/2 (Zoom Out) pView->m_LeadBWnd.SetZoomFactor (2); return TRUE; } CView * CScZmDoc::GetView() { POSITION pos = GetFirstViewPosition(); return GetNextView(pos); }