PageRenderTime 46ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/JSTUDIO3D_2_5_beta_1/source/Tools/ActorWorkbench/ActorWorkbench.cpp

#
C++ | 146 lines | 80 code | 31 blank | 35 comment | 4 complexity | e0206c71e91fed5a8f5b7579a4f62c82 MD5 | raw file
  1. // ActorWorkbench.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "ActorWorkbench.h"
  5. #include "MainFrm.h"
  6. #include "ActorWorkbenchDoc.h"
  7. #include "ActorWorkbenchView.h"
  8. #include "Jet3DView.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #endif
  12. // CActorWorkbenchApp
  13. BEGIN_MESSAGE_MAP(CActorWorkbenchApp, CWinApp)
  14. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  15. // Standard file based document commands
  16. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  17. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  18. END_MESSAGE_MAP()
  19. // CActorWorkbenchApp construction
  20. CActorWorkbenchApp::CActorWorkbenchApp()
  21. {
  22. // TODO: add construction code here,
  23. // Place all significant initialization in InitInstance
  24. EnableHtmlHelp( ); //Add by Ken Deel 1-4-06
  25. }
  26. // The one and only CActorWorkbenchApp object
  27. CActorWorkbenchApp theApp;
  28. // CActorWorkbenchApp initialization
  29. BOOL CActorWorkbenchApp::InitInstance()
  30. {
  31. // InitCommonControls() is required on Windows XP if an application
  32. // manifest specifies use of ComCtl32.dll version 6 or later to enable
  33. // visual styles. Otherwise, any window creation will fail.
  34. InitCommonControls();
  35. CWinApp::InitInstance();
  36. if (!AfxSocketInit())
  37. {
  38. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  39. return FALSE;
  40. }
  41. // Initialize OLE libraries
  42. if (!AfxOleInit())
  43. {
  44. AfxMessageBox(IDP_OLE_INIT_FAILED);
  45. return FALSE;
  46. }
  47. AfxEnableControlContainer();
  48. // Standard initialization
  49. // If you are not using these features and wish to reduce the size
  50. // of your final executable, you should remove from the following
  51. // the specific initialization routines you do not need
  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("Paradox Software"));
  56. LoadStdProfileSettings(4); // 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(CActorWorkbenchDoc),
  63. RUNTIME_CLASS(CMainFrame), // main SDI frame window
  64. RUNTIME_CLASS(CJet3DView));
  65. if (!pDocTemplate)
  66. return FALSE;
  67. AddDocTemplate(pDocTemplate);
  68. // Enable DDE Execute open
  69. EnableShellOpen();
  70. RegisterShellFileTypes(TRUE);
  71. // Parse command line for standard shell commands, DDE, file open
  72. CCommandLineInfo cmdInfo;
  73. ParseCommandLine(cmdInfo);
  74. // Dispatch commands specified on the command line. Will return FALSE if
  75. // app was launched with /RegServer, /Register, /Unregserver or /Unregister.
  76. if (!ProcessShellCommand(cmdInfo))
  77. return FALSE;
  78. // The one and only window has been initialized, so show and update it
  79. m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
  80. m_pMainWnd->UpdateWindow();
  81. // call DragAcceptFiles only if there's a suffix
  82. // In an SDI app, this should occur after ProcessShellCommand
  83. // Enable drag/drop open
  84. m_pMainWnd->DragAcceptFiles();
  85. return TRUE;
  86. }
  87. // CAboutDlg dialog used for App About
  88. class CAboutDlg : public CDialog
  89. {
  90. public:
  91. CAboutDlg();
  92. // Dialog Data
  93. enum { IDD = IDD_ABOUTBOX };
  94. protected:
  95. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  96. // Implementation
  97. protected:
  98. DECLARE_MESSAGE_MAP()
  99. };
  100. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  101. {
  102. }
  103. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  104. {
  105. CDialog::DoDataExchange(pDX);
  106. }
  107. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  108. END_MESSAGE_MAP()
  109. // App command to run the dialog
  110. void CActorWorkbenchApp::OnAppAbout()
  111. {
  112. CAboutDlg aboutDlg;
  113. aboutDlg.DoModal();
  114. }
  115. // CActorWorkbenchApp message handlers