home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003 July / EnterCD 7_2003.iso / Ekstra / GL Force 2001 3.0 / 3DFont.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-06  |  4.2 KB  |  157 lines

  1. /*
  2. Authors: David Nishimoto
  3. Website: http://www.listensoftware.com
  4. Email: davepamn@relia.net
  5. Program: Force
  6. */
  7.  
  8. #include "stdafx.h"
  9. #include "3DFont.h"
  10.  
  11. #include "MainFrm.h"
  12. #include "3DFontDoc.h"
  13. #include "3DFontView.h"
  14.  
  15. #ifdef _DEBUG
  16. #define new DEBUG_NEW
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CMy3DFontApp
  23.  
  24. BEGIN_MESSAGE_MAP(CMy3DFontApp, CWinApp)
  25.     //{{AFX_MSG_MAP(CMy3DFontApp)
  26.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  27.         // NOTE - the ClassWizard will add and remove mapping macros here.
  28.         //    DO NOT EDIT what you see in these blocks of generated code!
  29.     //}}AFX_MSG_MAP
  30.     // Standard file based document commands
  31.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  32.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  33.     // Standard print setup command
  34.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  35. END_MESSAGE_MAP()
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMy3DFontApp construction
  39.  
  40. CMy3DFontApp::CMy3DFontApp()
  41. {
  42.     // TODO: add construction code here,
  43.     // Place all significant initialization in InitInstance
  44. }
  45.  
  46. /////////////////////////////////////////////////////////////////////////////
  47. // The one and only CMy3DFontApp object
  48.  
  49. CMy3DFontApp theApp;
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CMy3DFontApp initialization
  53.  
  54. BOOL CMy3DFontApp::InitInstance()
  55. {
  56.     AfxEnableControlContainer();
  57.  
  58.     // Standard initialization
  59.     // If you are not using these features and wish to reduce the size
  60.     //  of your final executable, you should remove from the following
  61.     //  the specific initialization routines you do not need.
  62.  
  63. #ifdef _AFXDLL
  64.     Enable3dControls();            // Call this when using MFC in a shared DLL
  65. #else
  66.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  67. #endif
  68.  
  69.     // Change the registry key under which our settings are stored.
  70.     // You should modify this string to be something appropriate
  71.     // such as the name of your company or organization.
  72.     SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  73.  
  74.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  75.  
  76.     // Register the application's document templates.  Document templates
  77.     //  serve as the connection between documents, frame windows and views.
  78.  
  79.     CSingleDocTemplate* pDocTemplate;
  80.     pDocTemplate = new CSingleDocTemplate(
  81.         IDR_MAINFRAME,
  82.         RUNTIME_CLASS(CMy3DFontDoc),
  83.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  84.         RUNTIME_CLASS(CMy3DFontView));
  85.     AddDocTemplate(pDocTemplate);
  86.  
  87.     // Parse command line for standard shell commands, DDE, file open
  88.     CCommandLineInfo cmdInfo;
  89.     ParseCommandLine(cmdInfo);
  90.  
  91.     // Dispatch commands specified on the command line
  92.     if (!ProcessShellCommand(cmdInfo))
  93.         return FALSE;
  94.  
  95.     // The one and only window has been initialized, so show and update it.
  96.     m_pMainWnd->ShowWindow(SW_SHOW);
  97.     m_pMainWnd->UpdateWindow();
  98.  
  99.     return TRUE;
  100. }
  101.  
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CAboutDlg dialog used for App About
  104.  
  105. class CAboutDlg : public CDialog
  106. {
  107. public:
  108.     CAboutDlg();
  109.  
  110. // Dialog Data
  111.     //{{AFX_DATA(CAboutDlg)
  112.     enum { IDD = IDD_ABOUTBOX };
  113.     //}}AFX_DATA
  114.  
  115.     // ClassWizard generated virtual function overrides
  116.     //{{AFX_VIRTUAL(CAboutDlg)
  117.     protected:
  118.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  119.     //}}AFX_VIRTUAL
  120.  
  121. // Implementation
  122. protected:
  123.     //{{AFX_MSG(CAboutDlg)
  124.         // No message handlers
  125.     //}}AFX_MSG
  126.     DECLARE_MESSAGE_MAP()
  127. };
  128.  
  129. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  130. {
  131.     //{{AFX_DATA_INIT(CAboutDlg)
  132.     //}}AFX_DATA_INIT
  133. }
  134.  
  135. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  136. {
  137.     CDialog::DoDataExchange(pDX);
  138.     //{{AFX_DATA_MAP(CAboutDlg)
  139.     //}}AFX_DATA_MAP
  140. }
  141.  
  142. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  143.     //{{AFX_MSG_MAP(CAboutDlg)
  144.         // No message handlers
  145.     //}}AFX_MSG_MAP
  146. END_MESSAGE_MAP()
  147.  
  148. // App command to run the dialog
  149. void CMy3DFontApp::OnAppAbout()
  150. {
  151.     CAboutDlg aboutDlg;
  152.     aboutDlg.DoModal();
  153. }
  154.  
  155. /////////////////////////////////////////////////////////////////////////////
  156. // CMy3DFontApp commands
  157.