home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / mslang / palette / pal.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-06  |  3.2 KB  |  129 lines

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