?? filemodinotifydoc.cpp
字號:
// FileModiNotifyDoc.cpp : implementation of the CFileModiNotifyDoc class
//
#include "stdafx.h"
#include "FileModiNotify.h"
#include "FileModiNotifyDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFileModiNotifyDoc
IMPLEMENT_DYNCREATE(CFileModiNotifyDoc, CDocument)
BEGIN_MESSAGE_MAP(CFileModiNotifyDoc, CDocument)
//{{AFX_MSG_MAP(CFileModiNotifyDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CFileModiNotifyDoc construction/destruction
CFileModiNotifyDoc::CFileModiNotifyDoc()
{
// TODO: add one-time construction code here
}
CFileModiNotifyDoc::~CFileModiNotifyDoc()
{
}
BOOL CFileModiNotifyDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CFileModiNotifyDoc serialization
void CFileModiNotifyDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CFileModiNotifyDoc diagnostics
#ifdef _DEBUG
void CFileModiNotifyDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CFileModiNotifyDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFileModiNotifyDoc commands
BOOL CFileModiNotifyDoc::SaveModified()
{
// TODO: Add your specialized code here and/or call the base class
return CDocument::SaveModified();
}
void CFileModiNotifyDoc::SetModifiedFlag(BOOL bModified)
{
CString strTitle = GetTitle();
CString strDirtyFlag = " 文件(文檔)已被修改,注意保存喔!";
//注意引號內(nèi)前面的空格!
//如果不要引號內(nèi)前面的空格,save as保存文件對話框中的文件名后會帶*號!
//假如被修改了
if (!IsModified() && bModified)
{
//標題欄也修改
SetTitle(strTitle + strDirtyFlag);
}
else if ( IsModified() && !bModified )
{
int nTitleLength = strTitle.GetLength();
int nDirtyLength = strDirtyFlag.GetLength();
SetTitle( strTitle.Left(nTitleLength - nDirtyLength) );
}
UpdateFrameCounts();
CDocument::SetModifiedFlag(bModified);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -