home *** CD-ROM | disk | FTP | other *** search
/ 3D Games - Real-time Rend…ng & Software Technology / 3D Games - Real-time Rendering & Software Technology.iso / flysdk / frontend / flyEditor / flyEditor.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-15  |  3.4 KB  |  146 lines

  1. // flyEditor.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "flyEditor.h"
  6.  
  7. #include "MainFrm.h"
  8. #include "flyEditorDoc.h"
  9. #include "LeftView.h"
  10.  
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CFlyEditorApp
  19.  
  20. BEGIN_MESSAGE_MAP(CFlyEditorApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CFlyEditorApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.     //}}AFX_MSG_MAP
  24.     // Standard file based document commands
  25.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  26.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  27. END_MESSAGE_MAP()
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CFlyEditorApp construction
  31.  
  32. CFlyEditorApp::CFlyEditorApp()
  33. {
  34. }
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // The one and only CFlyEditorApp object
  38.  
  39. CFlyEditorApp theApp;
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CFlyEditorApp initialization
  43.  
  44. BOOL CFlyEditorApp::InitInstance()
  45. {
  46.     // Standard initialization
  47.  
  48. #ifdef _AFXDLL
  49.     Enable3dControls();            // Call this when using MFC in a shared DLL
  50. #else
  51.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  52. #endif
  53.  
  54.     // Change the registry key under which our settings are stored.
  55.     SetRegistryKey(_T("Paralelo"));
  56.  
  57.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  58.  
  59.     // Register document templates
  60.  
  61.     CSingleDocTemplate* pDocTemplate;
  62.     pDocTemplate = new CSingleDocTemplate(
  63.         IDR_MAINFRAME,
  64.         RUNTIME_CLASS(CFlyEditorDoc),
  65.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  66.         RUNTIME_CLASS(CLeftView));
  67.     AddDocTemplate(pDocTemplate);
  68.  
  69.     // Enable DDE Execute open
  70.     EnableShellOpen();
  71.     RegisterShellFileTypes(TRUE);
  72.  
  73.     // Parse command line for standard shell commands, DDE, file open
  74.     CCommandLineInfo cmdInfo;
  75.     ParseCommandLine(cmdInfo);
  76.  
  77.     // Dispatch commands specified on the command line
  78.     if (!ProcessShellCommand(cmdInfo))
  79.         return FALSE;
  80.     m_pMainWnd->ShowWindow(SW_SHOW);
  81.     m_pMainWnd->UpdateWindow();
  82.  
  83.     // Enable drag/drop open
  84.     m_pMainWnd->DragAcceptFiles();
  85.  
  86.     return TRUE;
  87. }
  88.  
  89.  
  90. /////////////////////////////////////////////////////////////////////////////
  91. // CAboutDlg dialog used for App About
  92.  
  93. class CAboutDlg : public CDialog
  94. {
  95. public:
  96.     CAboutDlg();
  97.  
  98. // Dialog Data
  99.     //{{AFX_DATA(CAboutDlg)
  100.     enum { IDD = IDD_ABOUTBOX };
  101.     //}}AFX_DATA
  102.  
  103.     // ClassWizard generated virtual function overrides
  104.     //{{AFX_VIRTUAL(CAboutDlg)
  105.     protected:
  106.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  107.     //}}AFX_VIRTUAL
  108.  
  109. // Implementation
  110. protected:
  111.     //{{AFX_MSG(CAboutDlg)
  112.         // No message handlers
  113.     //}}AFX_MSG
  114.     DECLARE_MESSAGE_MAP()
  115. };
  116.  
  117. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  118. {
  119.     //{{AFX_DATA_INIT(CAboutDlg)
  120.     //}}AFX_DATA_INIT
  121. }
  122.  
  123. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  124. {
  125.     CDialog::DoDataExchange(pDX);
  126.     //{{AFX_DATA_MAP(CAboutDlg)
  127.     //}}AFX_DATA_MAP
  128. }
  129.  
  130. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  131.     //{{AFX_MSG_MAP(CAboutDlg)
  132.         // No message handlers
  133.     //}}AFX_MSG_MAP
  134. END_MESSAGE_MAP()
  135.  
  136. // App command to run the dialog
  137. void CFlyEditorApp::OnAppAbout()
  138. {
  139.     CAboutDlg aboutDlg;
  140.     aboutDlg.DoModal();
  141. }
  142.  
  143. /////////////////////////////////////////////////////////////////////////////
  144. // CFlyEditorApp message handlers
  145.  
  146.