home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / sprmgr20 / sprite / demo32 / sprites.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-03  |  3.3 KB  |  130 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.     AddDocTemplate(new CSingleDocTemplate(IDR_MAINFRAME,
  64.             RUNTIME_CLASS(CSpritesDoc),
  65.             RUNTIME_CLASS(CMainFrame),     // main SDI frame window
  66.             RUNTIME_CLASS(CSpritesView)));
  67.  
  68.  
  69.     // create a new (empty) document
  70.     OnFileNew();
  71.  
  72.     if (m_lpCmdLine[0] != '\0')
  73.     {
  74.         // TODO: add command line processing here
  75.     }
  76.  
  77.     return TRUE;
  78. }
  79.  
  80. /////////////////////////////////////////////////////////////////////////////
  81. // CAboutDlg dialog used for App About
  82.  
  83. class CAboutDlg : public CDialog
  84. {
  85. public:
  86.     CAboutDlg();
  87.  
  88. // Dialog Data
  89.     //{{AFX_DATA(CAboutDlg)
  90.     enum { IDD = IDD_ABOUTBOX };
  91.     //}}AFX_DATA
  92.  
  93. // Implementation
  94. protected:
  95.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  96.     //{{AFX_MSG(CAboutDlg)
  97.         // No message handlers
  98.     //}}AFX_MSG
  99.     DECLARE_MESSAGE_MAP()
  100. };
  101.  
  102. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  103. {
  104.     //{{AFX_DATA_INIT(CAboutDlg)
  105.     //}}AFX_DATA_INIT
  106. }
  107.  
  108. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  109. {
  110.     CDialog::DoDataExchange(pDX);
  111.     //{{AFX_DATA_MAP(CAboutDlg)
  112.     //}}AFX_DATA_MAP
  113. }
  114.  
  115. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  116.     //{{AFX_MSG_MAP(CAboutDlg)
  117.         // No message handlers
  118.     //}}AFX_MSG_MAP
  119. END_MESSAGE_MAP()
  120.  
  121. // App command to run the dialog
  122. void CSpritesApp::OnAppAbout()
  123. {
  124.     CAboutDlg aboutDlg;
  125.     aboutDlg.DoModal();
  126. }
  127.  
  128. /////////////////////////////////////////////////////////////////////////////
  129. // CSpritesApp commands
  130.