📄 cdms.cpp
字号:
// CDMS.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "CDMS.h"
#include "MainFrm.h"
#include "Set1Frame.h"
#include "Set1Doc.h"
#include "Set1View.h"
#include "Set2Frame.h"
#include "Set2Doc.h"
#include "Set2View.h"
#include "Set3Frame.h"
#include "Set3Doc.h"
#include "Set3View.h"
#include "Set4Frame.h"
#include "Set4Doc.h"
#include "Set4View.h"
#include "Set5Frm.h"
#include "Set5Doc.h"
#include "Set5View.h"
#include "Set6Frame.h"
#include "Set6Doc.h"
#include "Set6View.h"
#include "Set7Frame.h"
#include "Set7Doc.h"
#include "Set7View.h"
#include "Set8Frame.h"
#include "Set8Doc.h"
#include "Set8View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCDMSApp
BEGIN_MESSAGE_MAP(CCDMSApp, CWinApp)
//{{AFX_MSG_MAP(CCDMSApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCDMSApp construction
CCDMSApp::CCDMSApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CCDMSApp object
CCDMSApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CCDMSApp initialization
BOOL CCDMSApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
/*----1#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET1,
RUNTIME_CLASS(CSet1Doc),
RUNTIME_CLASS(CSet1Frame), // custom MDI child frame
RUNTIME_CLASS(CSet1View));
AddDocTemplate(pDocTemplate);
/*----1#机组模板----*/
/*----2#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET2,
RUNTIME_CLASS(CSet2Doc),
RUNTIME_CLASS(CSet2Frame), // custom MDI child frame
RUNTIME_CLASS(CSet2View));
AddDocTemplate(pDocTemplate);
/*----2#机组模板----*/
/*----3#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET3,
RUNTIME_CLASS(CSet3Doc),
RUNTIME_CLASS(CSet3Frame), // custom MDI child frame
RUNTIME_CLASS(CSet3View));
AddDocTemplate(pDocTemplate);
/*----3#机组模板----*/
/*----4#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET4,
RUNTIME_CLASS(CSet4Doc),
RUNTIME_CLASS(CSet4Frame), // custom MDI child frame
RUNTIME_CLASS(CSet4View));
AddDocTemplate(pDocTemplate);
/*----4#机组模板----*/
/*----5#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET5,
RUNTIME_CLASS(CSet5Doc),
RUNTIME_CLASS(CSet5Frame), // custom MDI child frame
RUNTIME_CLASS(CSet5View));
AddDocTemplate(pDocTemplate);
/*----5#机组模板----*/
/*----6#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET6,
RUNTIME_CLASS(CSet6Doc),
RUNTIME_CLASS(CSet6Frame), // custom MDI child frame
RUNTIME_CLASS(CSet6View));
AddDocTemplate(pDocTemplate);
/*----6#机组模板----*/
/*----7#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET7,
RUNTIME_CLASS(CSet7Doc),
RUNTIME_CLASS(CSet7Frame), // custom MDI child frame
RUNTIME_CLASS(CSet7View));
AddDocTemplate(pDocTemplate);
/*----7#机组模板----*/
/*----8#机组模板----*/
pDocTemplate = new CMultiDocTemplate(
IDR_SET8,
RUNTIME_CLASS(CSet8Doc),
RUNTIME_CLASS(CSet8Frame), // custom MDI child frame
RUNTIME_CLASS(CSet8View));
AddDocTemplate(pDocTemplate);
/*----8#机组模板----*/
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
//不打开任何文件视图
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CCDMSApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CCDMSApp message handlers
BOOL CCDMSApp::InitApplication()
{
// TODO: Add your specialized code here and/or call the base class
//定义黑刷子
m_BlackBrush.CreateSolidBrush(RGB(0,0,0));
//定义白刷子
m_WhiteBrush.CreateSolidBrush(RGB(255,255,255));
//定义蓝色刷子
m_BlueBrush.CreateSolidBrush(RGB(0,0,255));
//定义绿色刷子
m_GreenBrush.CreateSolidBrush(RGB(0,255,0));
//定义黄色刷子
m_YellowBrush.CreateSolidBrush(RGB(255,255,0));
//定义红色刷子
m_RedBrush.CreateSolidBrush(RGB(255,0,0));
//定义红色笔
m_RedPen.CreatePen(PS_SOLID,1,RGB(255,0,0));
//定义绿色笔
m_GreenPen.CreatePen(PS_SOLID,1,RGB(0,255,0));
//定义黄色笔
m_YellowPen.CreatePen(PS_SOLID,1,RGB(255,255,0));
//定义灰色的笔
m_GrayPen.CreatePen(PS_SOLID,1,RGB(100,100,100));
//定义蓝色的笔
m_BluePen.CreatePen(PS_SOLID,1,RGB(0,0,255));
//黑色位图
m_BlackBitmap.LoadBitmap(IDB_BACKGROUND);
//白色位图
m_WhiteBitmap.LoadBitmap(IDB_WHITEGROUND);
return CWinApp::InitApplication();
}
BOOL CCDMSApp::FirstInstance()
{
// CWnd *pWndPrev, *pWndChild;
//根据主窗口类名和主窗口名判断是否已经有实例存在了
// if(pWndPrev = CWnd::FindWindow()
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -