📄 lbm_d2q9doc.cpp
字号:
// LBM_D2Q9Doc.cpp : implementation of the CLBM_D2Q9Doc class
//
#include "stdafx.h"
#include "LBM_D2Q9.h"
#include "LBM_D2Q9Doc.h"
#include <string.h>
#include "D2Q9.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLBM_D2Q9Doc
IMPLEMENT_DYNCREATE(CLBM_D2Q9Doc, CDocument)
BEGIN_MESSAGE_MAP(CLBM_D2Q9Doc, CDocument)
//{{AFX_MSG_MAP(CLBM_D2Q9Doc)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLBM_D2Q9Doc construction/destruction
CLBM_D2Q9Doc::CLBM_D2Q9Doc()
{
// TODO: add one-time construction code here
}
CLBM_D2Q9Doc::~CLBM_D2Q9Doc()
{
}
BOOL CLBM_D2Q9Doc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CLBM_D2Q9Doc serialization
void CLBM_D2Q9Doc::Serialize(CArchive& ar)
{
char str[80];
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
CString strPathName = ar.GetFile()->GetFileName();
strcpy(str, strPathName);
if(strcmp(filename, str)==0) return;
else strcpy(filename, str);
Init(filename);
}
}
void CLBM_D2Q9Doc::OnFileOpen()
{
static int nIndex = 1;
char szFilter[] = "LBM Files(*.lbm)|*.LBM|All Files(*.*)|*.*||";
char str[80];
CFileDialog DialogOpen(true, NULL, NULL, OFN_HIDEREADONLY, szFilter);
DialogOpen.m_ofn.nFilterIndex = (DWORD)nIndex;
if(DialogOpen.DoModal() == IDOK)
{
nIndex = (int)DialogOpen.m_ofn.nFilterIndex;
CString strPathName = DialogOpen.GetPathName();
strcpy(str, strPathName);
if(strcmp(str, filename)==0) return;
else strcpy(filename, str);
Init(filename);
}
}
/////////////////////////////////////////////////////////////////////////////
// CLBM_D2Q9Doc diagnostics
#ifdef _DEBUG
void CLBM_D2Q9Doc::AssertValid() const
{
CDocument::AssertValid();
}
void CLBM_D2Q9Doc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CLBM_D2Q9Doc commands
BOOL CLBM_D2Q9Doc::OnOpenDocument(LPCTSTR lpszPathName)
{
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 + -