Graphic.cpp
上传用户:lydc80129
上传日期:2013-01-15
资源大小:979k
文件大小:5k
源码类别:

界面编程

开发平台:

Visual C++

  1. // Graphic.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "Graphic.h"
  5. #include "FaderWnd.h"//窗口渐隐头文件
  6. #include "MainFrm.h"
  7. #include "GraphicDoc.h"
  8. #include "GraphicView.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CGraphicApp
  16. BEGIN_MESSAGE_MAP(CGraphicApp, CWinApp)
  17. //{{AFX_MSG_MAP(CGraphicApp)
  18. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  19. // NOTE - the ClassWizard will add and remove mapping macros here.
  20. //    DO NOT EDIT what you see in these blocks of generated code!
  21. //}}AFX_MSG_MAP
  22. // Standard file based document commands
  23. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  24. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  25. // Standard print setup command
  26. ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  27. END_MESSAGE_MAP()
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CGraphicApp construction
  30. CGraphicApp::CGraphicApp()
  31. {
  32. // TODO: add construction code here,
  33. // Place all significant initialization in InitInstance
  34. }
  35. /////////////////////////////////////////////////////////////////////////////
  36. // The one and only CGraphicApp object
  37. CGraphicApp theApp;
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CGraphicApp initialization
  40. BOOL CGraphicApp::InitInstance()
  41. {
  42. AfxEnableControlContainer(); 
  43. // Standard initialization
  44. // If you are not using these features and wish to reduce the size
  45. //  of your final executable, you should remove from the following
  46. //  the specific initialization routines you do not need.
  47. #ifdef _AFXDLL
  48. Enable3dControls(); // Call this when using MFC in a shared DLL
  49. #else
  50. Enable3dControlsStatic(); // Call this when linking to MFC statically
  51. #endif
  52. // Change the registry key under which our settings are stored.
  53. // TODO: You should modify this string to be something appropriate
  54. // such as the name of your company or organization.
  55. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  56. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  57. // Register the application's document templates.  Document templates
  58. //  serve as the connection between documents, frame windows and views.
  59. CSingleDocTemplate* pDocTemplate;
  60. pDocTemplate = new CSingleDocTemplate(
  61. IDR_MAINFRAME,
  62. RUNTIME_CLASS(CGraphicDoc),
  63. RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  64. RUNTIME_CLASS(CGraphicView));
  65. AddDocTemplate(pDocTemplate);
  66. // Parse command line for standard shell commands, DDE, file open
  67. CCommandLineInfo cmdInfo;
  68. ParseCommandLine(cmdInfo);
  69. // Dispatch commands specified on the command line
  70. if (!ProcessShellCommand(cmdInfo))
  71. return FALSE;
  72. // The one and only window has been initialized, so show and update it.
  73. m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
  74. m_pMainWnd->UpdateWindow();
  75. m_pMainWnd->SetWindowText("工业曲线处理显示完整版 V1.0     设计者:戚高");
  76. //===================加载皮肤并且设置皮肤窗口================*/
  77. VERIFY( 1 == InitSkinMagicLib( AfxGetInstanceHandle(), "画图软件" , 
  78.   NULL,
  79.   NULL ) );
  80. VERIFY( 1 == LoadSkinFromResource( AfxGetInstanceHandle()  , "SKINMAGIC" ,"SKINMAGIC") ); 
  81. VERIFY( 1 == SetWindowSkin( m_pMainWnd->m_hWnd , "MainFrame" ));
  82. VERIFY( 1 == SetDialogSkin( "Dialog" ) );
  83. /*==========================END==============================*/
  84. return TRUE;
  85. }
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CAboutDlg dialog used for App About
  88. class CAboutDlg : public CDialog
  89. {
  90. public:
  91. CAboutDlg();
  92. // Dialog Data
  93. //{{AFX_DATA(CAboutDlg)
  94. enum { IDD = IDD_ABOUTBOX };
  95. //}}AFX_DATA
  96. // ClassWizard generated virtual function overrides
  97. //{{AFX_VIRTUAL(CAboutDlg)
  98. protected:
  99. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  100. //}}AFX_VIRTUAL
  101. // Implementation
  102. protected:
  103. //{{AFX_MSG(CAboutDlg)
  104. // No message handlers
  105. //}}AFX_MSG
  106. DECLARE_MESSAGE_MAP()
  107. };
  108. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  109. {
  110. //{{AFX_DATA_INIT(CAboutDlg)
  111. //}}AFX_DATA_INIT
  112. }
  113. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  114. {
  115. CDialog::DoDataExchange(pDX);
  116. //{{AFX_DATA_MAP(CAboutDlg)
  117. //}}AFX_DATA_MAP
  118. }
  119. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  120. //{{AFX_MSG_MAP(CAboutDlg)
  121. // No message handlers
  122. //}}AFX_MSG_MAP
  123. END_MESSAGE_MAP()
  124. // App command to run the dialog
  125. void CGraphicApp::OnAppAbout()
  126. {
  127. CAboutDlg aboutDlg;
  128. aboutDlg.DoModal();
  129. }
  130. /////////////////////////////////////////////////////////////////////////////
  131. // CGraphicApp message handlers