📄 resdoc.cpp
字号:
// ResDoc.cpp : implementation file
//
#include "stdafx.h"
#include "resourceeditor.h"
#include "ResDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CResDoc
IMPLEMENT_DYNCREATE(CResDoc, CDocument)
CResDoc::CResDoc()
{
m_ResType = MMI_RT_MAX_NUM;
}
BOOL CResDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
return TRUE;
}
CResDoc::~CResDoc()
{
}
BEGIN_MESSAGE_MAP(CResDoc, CDocument)
//{{AFX_MSG_MAP(CResDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CResDoc diagnostics
#ifdef _DEBUG
void CResDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CResDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CResDoc serialization
void CResDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CResDoc commands
void CResDoc::SetTitle(LPCTSTR lpszTitle)
{
// TODO: Add your specialized code here and/or call the base class
// delete the last num
LPCTSTR pTailNum = lpszTitle + lstrlen(lpszTitle) - 1;
while( *pTailNum >= _T('0') && *pTailNum <= _T('9') )
{
pTailNum--;
}
pTailNum++;
CString strTitle = lpszTitle;
strTitle.TrimRight(pTailNum);
CDocument::SetTitle(strTitle);
}
void CResDoc::SetModifiedFlag(BOOL bModified /* = TRUE */)
{
g_theApp.SetModifiedFlag( m_ResType, bModified );
}
void CResDoc::OnFileSave()
{
g_theApp.OnFileSave();
}
void CResDoc::OnFileSaveAs()
{
g_theApp.OnFileSaveAs();
}
void CResDoc::OnCloseDocument()
{
// TODO: Add your specialized code here and/or call the base class
CDocument::OnCloseDocument();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -