⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex07b.cpp

📁 ISO9000质量管理小程序
💻 CPP
字号:
// Ex07b.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "Ex07b.h"

#include "SplitterFrame.h"

#include "ZhifangTuxing.h"

#include "ZftSplitter.h"
#include "Zflist.h"
#include "ZftInput1.h"

#include "teacher.h"
#include "_PLT2.h"
#include "SANBUTU2.H"
#include "KONGZHITU3.H"
#include "gcnlfx2.h"

#include "MainFrm.h"
#include "ChildFrm.h"
#include "Ex07bDoc.h"
#include "Ex07bView.h"
#include  "ScrollView.h"
#include "Tuxing.h"

#include "SbtInput.h"
#include "SbtDoc.h"

#include "Sbtsplitter.h"
#include "SbtTuxing.h"
#include "GcnlfxInput.h"

#include "GcnlfxInput.h"
#include "Gcsplitter.h"
#include "Kzt.h"

#include "Kztsplitter.h"
#include "Splash.h"
#include "ZftInput1.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEx07bApp

BEGIN_MESSAGE_MAP(CEx07bApp, CWinApp)
	//{{AFX_MSG_MAP(CEx07bApp)
	ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
	ON_COMMAND(ID_PAILIETU, OnPailietu)
	ON_COMMAND(ID_ZHIFANGTU, OnZhifangtu)
	ON_COMMAND(ID_SANBUTU, OnSanbutu)
	ON_COMMAND(ID_GCNLFX, OnGcnlfx)
	ON_COMMAND(ID_KZT, OnKzt)
	ON_COMMAND(ID_ZFT2, OnZft2)
	ON_COMMAND(ID_PLTU2, OnPltu2)
	ON_COMMAND(ID_SBTU2, OnSbtu2)
	ON_COMMAND(ID_KZTU2, OnKztu2)
	ON_COMMAND(ID_GCNLFX2, OnGcnlfx2)
	//}}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()

/////////////////////////////////////////////////////////////////////////////
// CEx07bApp construction

CEx07bApp::CEx07bApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CEx07bApp object

BOOL m_pmenu=false;  //控制排列图菜单的允许与禁止
BOOL m_smenu=false;
BOOL m_zmenu=false;

CEx07bApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CEx07bApp initialization

BOOL CEx07bApp::InitInstance()
{
	{	// BLOCK: doc template registration		// Register the document template.  Document templates serve		// as the connection between documents, frame windows and views.		// Attach this form to another document or frame window by changing		// the document or frame class in the constructor below.//		CMultiDocTemplate* pNewDocTemplate = new CMultiDocTemplate(//			IDR_ZFTINPUT1_TMPL,//			RUNTIME_CLASS(CEx07bDoc),		// document class//			RUNTIME_CLASS(CMDIChildWnd),		// frame class//			RUNTIME_CLASS(CZftInput1));		// view class//		AddDocTemplate(pNewDocTemplate);	}
	// CG: The following block was added by the Splash Screen component.\	{\		CCommandLineInfo cmdInfo;\		ParseCommandLine(cmdInfo);\\		CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);\	}

	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"));
	SetRegistryKey(COMPANY_KEY);
	SetDialogBkColor(RGB(0,128,128),RGB(255,255,0));
	LoadStdProfileSettings();  // Load standard INI file options (including MRU)
//HICON LoadIcon(IDB_ISO); const;
	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.




	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.




	m_pFormDocTemplate = new CMultiDocTemplate(
		IDR_EX07BTYPE,
		RUNTIME_CLASS(CEx07bDoc),
		RUNTIME_CLASS(CSplitterFrame),//CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CEx07bView));
	AddDocTemplate(m_pFormDocTemplate);



	m_pTuxingDocTemplate = new CMultiDocTemplate(
		IDR_EX07BTYPE,
		RUNTIME_CLASS(CEx07bDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(Tuxing));
	AddDocTemplate(m_pTuxingDocTemplate);

	m_zInputDocTemplate = new CMultiDocTemplate(
		IDR_ZFT,
		RUNTIME_CLASS(CEx07bDoc),
		RUNTIME_CLASS(CZftSplitter), // custom MDI child frame
		RUNTIME_CLASS(CZftInput1));
	AddDocTemplate(m_zInputDocTemplate);



	m_zTuxingDocTemplate = new CMultiDocTemplate(
		IDR_ZFT,
		RUNTIME_CLASS(CEx07bDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CZhifangTuxing));
	AddDocTemplate(m_zTuxingDocTemplate);

	m_sInputDocTemplate = new CMultiDocTemplate(
		IDR_SBT,
		RUNTIME_CLASS(CSbtDoc),
		RUNTIME_CLASS(CSbtsplitter), // custom MDI child frame
		RUNTIME_CLASS(CSbtInput));
	AddDocTemplate(m_sInputDocTemplate);


	
	m_sTuxingDocTemplate = new CMultiDocTemplate(
		IDR_SBT,
		RUNTIME_CLASS(CSbtDoc),
		RUNTIME_CLASS(CChildFrame), // custom MDI child frame
		RUNTIME_CLASS(CSbtTuxing));
	AddDocTemplate(m_sTuxingDocTemplate);


	m_gInputDocTemplate = new CMultiDocTemplate(
		IDR_GCNLFX,
		RUNTIME_CLASS(CSbtDoc),
		RUNTIME_CLASS(CGcsplitter), // custom MDI child frame
		RUNTIME_CLASS(CGcnlfxInput));
	AddDocTemplate(m_gInputDocTemplate);

	m_kInputDocTemplate = new CMultiDocTemplate(
		IDR_KZT,
		RUNTIME_CLASS(CSbtDoc),
		RUNTIME_CLASS(CKztsplitter), // custom MDI child frame
		RUNTIME_CLASS(CKzt));
	AddDocTemplate(m_kInputDocTemplate);	


	
	// create main MDI Frame window
	CMainFrame* pMainFrame = new CMainFrame;
	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
		return FALSE;
	m_pMainWnd = pMainFrame;//视图窗口的父窗口

//*********************************
//使资源管理器可以识别ISO9000.exe生成的各个文档类。如:可显示图标
//,双击时可自动打开等。

	m_pMainWnd->DragAcceptFiles();

	// Enable DDE Execute open
	EnableShellOpen();
	RegisterShellFileTypes(TRUE);

//***********************************


	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);
//	ParseCommandLine(cmdInfo);
	cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;


	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	// The main window has been initialized, so show and update it.
	pMainFrame->ShowWindow(m_nCmdShow);
//	pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
	UINT err;
	HKEY key;
	DWORD size, type;
	WINDOWPLACEMENT wp;
	if((err=RegOpenKeyEx( HKEY_CURRENT_USER,SETTING_KEY,0,KEY_READ,&key)) == ERROR_SUCCESS )
	{
		type = REG_BINARY;
		size = sizeof(WINDOWPLACEMENT);
		err=RegQueryValueEx( key,WINDOWPLACEMENT_KEY,0,&type,(LPBYTE)&wp,&size );
		RegCloseKey( key );
	}
	if (err==ERROR_SUCCESS)
	{
		m_pMainWnd->SetWindowPlacement(&wp);
	}
	else
	{
		m_pMainWnd->ShowWindow(SW_SHOW);
	}

	m_pMainWnd->UpdateWindow();

//	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 CEx07bApp::OnAppAbout()
{
	CAboutDlg aboutDlg;
	aboutDlg.DoModal();
}

/////////////////////////////////////////////////////////////////////////////
// CEx07bApp message handlers


void CEx07bApp::OnPailietu() 
{
	// TODO: Add your command handler code here

     this->m_pFormDocTemplate->OpenDocumentFile(NULL);
	
}

void CEx07bApp::OnZhifangtu() 
{
	// TODO: Add your command handler code here

  this->m_zInputDocTemplate->OpenDocumentFile(NULL);
	
}

void CEx07bApp::OnSanbutu() 
{
	// TODO: Add your command handler code here
	this->m_sInputDocTemplate->OpenDocumentFile(NULL);
}

void CEx07bApp::OnGcnlfx() 
{
	// TODO: Add your command handler code here

	this->m_gInputDocTemplate->OpenDocumentFile(NULL);

	
}

void CEx07bApp::OnKzt() 
{
	// TODO: Add your command handler code here
this->m_kInputDocTemplate->OpenDocumentFile(NULL);


	
}

void CEx07bApp::OnZft2() 
{
	// TODO: Add your command handler code here
	Cteacher zhifangtu;
    zhifangtu.DoModal();
	
}

void CEx07bApp::OnPltu2() 
{
	// TODO: Add your command handler code here
	C_PLT2 pailietu;
	pailietu.DoModal();
	
}

void CEx07bApp::OnSbtu2() 
{
	// TODO: Add your command handler code here
	CSANBUTU2 SANBUTU;
	SANBUTU.DoModal();

	
}

void CEx07bApp::OnKztu2() 
{
	// TODO: Add your command handler code here
	CKONGZHITU3 KONGZHITU3;
	KONGZHITU3.DoModal();

	
}

void CEx07bApp::OnGcnlfx2() 
{
	// TODO: Add your command handler code here
	 CGCNLFX2 GCNLFX2;
	 GCNLFX2.DoModal();
	
}

BOOL CEx07bApp::PreTranslateMessage(MSG* pMsg)
{
	// CG: The following lines were added by the Splash Screen component.	if (CSplashWnd::PreTranslateAppMessage(pMsg))		return TRUE;	return CWinApp::PreTranslateMessage(pMsg);
}

/*void CEx07bApp::OnOpenplt() 
{
	// TODO: Add your command handler code here
CString Filter,str;
Filter="所有文件(*.*)|*.*||";
CFileDialog FileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY,Filter);
if (FileDlg.DoModal()==IDOK)
{
	str=FileDlg.GetPathName();
     this->m_pFormDocTemplate->OpenDocumentFile(str);
}
	
}
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -