home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / sprmgr20 / sprite / demo16 / sprites.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-04  |  3.3 KB  |  133 lines

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