| Hits/True | False | - | Line | Source |
|
| | 1 | // cube.cpp : Defines the class behaviors for the application. |
| | 2 | // |
| | 3 | // This is a part of the Microsoft Foundation Classes C++ library. |
| | 4 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 5 | // |
| | 6 | // This source code is only intended as a supplement to the |
| | 7 | // Microsoft Foundation Classes Reference and related |
| | 8 | // electronic documentation provided with the library. |
| | 9 | // See these sources for detailed information regarding the |
| | 10 | // Microsoft Foundation Classes product. |
| | 11 | |
| | 12 | #include "stdafx.h" |
| | 13 | #include "cube.h" |
| | 14 | |
| | 15 | #include "mainfrm.h" |
| | 16 | #include "cubedoc.h" |
| | 17 | #include "cubeview.h" |
| | 18 | |
| | 19 | #ifdef _DEBUG |
| | 20 | #undef THIS_FILE |
| | 21 | static char BASED_CODE THIS_FILE[] = __FILE__; |
| | 22 | #endif |
| | 23 | |
| | 24 | ///////////////////////////////////////////////////////////////////////////// |
| | 25 | // CCubeApp |
| | 26 | |
| Top |
| 12645 | | | 27 | BEGIN_MESSAGE_MAP(CCubeApp, CWinApp) |
| 12645 | | | 27 | return GetThisMessageMap ( ) |
| | | | 27 | } |
| Top |
| 12645 | | | 27 | FUNCTION CCubeApp::GetThisMessageMap() |
| | 28 | //{{AFX_MSG_MAP(CCubeApp) |
| | 29 | ON_COMMAND(ID_APP_ABOUT, OnAppAbout) |
| | 30 | // NOTE - the ClassWizard will add and remove mapping macros here. |
| | 31 | // DO NOT EDIT what you see in these blocks of generated code! |
| | 32 | //}}AFX_MSG_MAP |
| | 33 | // Standard file based document commands |
| | 34 | ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) |
| | 35 | ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) |
| 12645 | | | 36 | END_MESSAGE_MAP() |
| | | | 36 | } |
| | 37 | |
| | 38 | ///////////////////////////////////////////////////////////////////////////// |
| | 39 | // CCubeApp construction |
| | 40 | |
| Top |
| 2 | | | 41 | CCubeApp::CCubeApp() |
| | 42 | { |
| | 43 | // TODO: add construction code here, |
| | 44 | // Place all significant initialization in InitInstance |
| 2 | | | 45 | } |
| | 46 | |
| | 47 | ///////////////////////////////////////////////////////////////////////////// |
| | 48 | // The one and only CCubeApp object |
| | 49 | |
| | 50 | CCubeApp theApp; |
| | 51 | |
| | 52 | ///////////////////////////////////////////////////////////////////////////// |
| | 53 | // CCubeApp initialization |
| | 54 | |
| Top |
| 2 | | | 55 | BOOL CCubeApp::InitInstance() |
| | 56 | { |
| | 57 | // Standard initialization |
| | 58 | // If you are not using these features and wish to reduce the size |
| | 59 | // of your final executable, you should remove from the following |
| | 60 | // the specific initialization routines you do not need. |
| | 61 | |
| | 62 | LoadStdProfileSettings(); // Load standard INI file options (including MRU) |
| | 63 | |
| | 64 | // Register the application's document templates. Document templates |
| | 65 | // serve as the connection between documents, frame windows and views. |
| | 66 | |
| | 67 | CSingleDocTemplate* pDocTemplate; |
| | 68 | pDocTemplate = new CSingleDocTemplate( |
| | 69 | IDR_MAINFRAME, |
| | 70 | RUNTIME_CLASS(CCubeDoc), |
| | 71 | RUNTIME_CLASS(CMainFrame), // main SDI frame window |
| | 72 | RUNTIME_CLASS(CCubeView)); |
| | 73 | AddDocTemplate(pDocTemplate); |
| | 74 | |
| | 75 | // create a new (empty) document |
| | 76 | OnFileNew(); |
| | 77 | |
| 0 | 2 | - | 78 | if (m_lpCmdLine[0] != '\0') |
| | 79 | { |
| | 80 | // TODO: add command line processing here |
| | 81 | } |
| | 82 | |
| 2 | | | 83 | return TRUE; |
| | | | 84 | } |
| | 85 | |
| | 86 | ///////////////////////////////////////////////////////////////////////////// |
| | 87 | // CAboutDlg dialog used for App About |
| | 88 | |
| | 89 | class CAboutDlg : public CDialog |
| | 90 | { |
| | 91 | public: |
| | 92 | CAboutDlg(); |
| | 93 | |
| | 94 | // Dialog Data |
| | 95 | //{{AFX_DATA(CAboutDlg) |
| | 96 | enum { IDD = IDD_ABOUTBOX }; |
| | 97 | //}}AFX_DATA |
| | 98 | |
| | 99 | // Implementation |
| | 100 | protected: |
| | 101 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support |
| | 102 | //{{AFX_MSG(CAboutDlg) |
| | 103 | // No message handlers |
| | 104 | //}}AFX_MSG |
| | 105 | DECLARE_MESSAGE_MAP() |
| | 106 | }; |
| | 107 | |
| Top |
| 7 | | | 108 | CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) |
| | 109 | { |
| | 110 | //{{AFX_DATA_INIT(CAboutDlg) |
| | 111 | //}}AFX_DATA_INIT |
| 7 | | | 112 | } |
| | 113 | |
| Top |
| 11 | | | 114 | void CAboutDlg::DoDataExchange(CDataExchange* pDX) |
| | 115 | { |
| | 116 | CDialog::DoDataExchange(pDX); |
| | 117 | //{{AFX_DATA_MAP(CAboutDlg) |
| | 118 | //}}AFX_DATA_MAP |
| 11 | | | 119 | } |
| | 120 | |
| Top |
| 6494 | | | 121 | BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) |
| 6494 | | | 121 | return GetThisMessageMap ( ) |
| | | | 121 | } |
| Top |
| 6494 | | | 121 | FUNCTION CAboutDlg::GetThisMessageMap() |
| | 122 | //{{AFX_MSG_MAP(CAboutDlg) |
| | 123 | // No message handlers |
| | 124 | //}}AFX_MSG_MAP |
| 6494 | | | 125 | END_MESSAGE_MAP() |
| | | | 125 | } |
| | 126 | |
| | 127 | // App command to run the dialog |
| Top |
| 7 | | | 128 | void CCubeApp::OnAppAbout() |
| | 129 | { |
| | 130 | CAboutDlg aboutDlg; |
| | 131 | aboutDlg.DoModal(); |
| 7 | | | 132 | } |
| | 133 | |
| | 134 | ///////////////////////////////////////////////////////////////////////////// |
| | 135 | // CCubeApp commands |
| ***TER 95 | % (19/20) of SOURCE FILE cube.cpp |
| 96 | % (24/25) statement |