📄 explorerdoc.cpp
字号:
// ExplorerDoc.cpp : implementation of the CExplorerDoc class
//
#include "stdafx.h"
#include "Explorer.h"
#include "MainFrm.h"
#include "ExplorerDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExplorerDoc
IMPLEMENT_DYNCREATE(CExplorerDoc, CDocument)
BEGIN_MESSAGE_MAP(CExplorerDoc, CDocument)
//{{AFX_MSG_MAP(CExplorerDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CExplorerDoc construction/destruction
CExplorerDoc::CExplorerDoc()
{
// TODO: add one-time construction code here
}
CExplorerDoc::~CExplorerDoc()
{
}
BOOL CExplorerDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
CMainFrame *frame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetApp()->GetMainWnd());
if (frame == NULL)
((CEditView*)m_viewList.GetHead())->SetWindowText(NULL);
else
{
frame->SetActiveView ((CView *)frame->m_pEditView);
((CEditView*)frame->m_pEditView)->SetWindowText(NULL);
}
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CExplorerDoc serialization
void CExplorerDoc::Serialize(CArchive& ar)
{
// CEditView contains an edit control which handles all serialization
CMainFrame *frame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetApp()->GetMainWnd());
if (frame == NULL)
((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
else
((CEditView*)frame->m_pEditView)->SerializeRaw(ar);
}
/////////////////////////////////////////////////////////////////////////////
// CExplorerDoc diagnostics
#ifdef _DEBUG
void CExplorerDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CExplorerDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CExplorerDoc commands
BOOL CExplorerDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
CMainFrame *frame = DYNAMIC_DOWNCAST(CMainFrame, AfxGetApp()->GetMainWnd());
if (frame != NULL)
{
frame->SetActiveView ((CView *)frame->m_pEditView);
}
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
// TODO: Add your specialized creation code here
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -