home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / ANNOTATE.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-17  |  4.4 KB  |  169 lines

  1. // annotate.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "annotate.h"
  6.  
  7. #include "MainFrm.h"
  8. #include "annotDoc.h"
  9. #include "annotVw.h"
  10.  
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CAnnotateApp
  19.  
  20. BEGIN_MESSAGE_MAP(CAnnotateApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CAnnotateApp)
  22.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     //}}AFX_MSG_MAP
  26.     // Standard file based document commands
  27.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  28.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  29.     // Standard print setup command
  30.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CAnnotateApp construction
  35.  
  36. CAnnotateApp::CAnnotateApp()
  37. {
  38.     // TODO: add construction code here,
  39.     // Place all significant initialization in InitInstance
  40. }
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // The one and only CAnnotateApp object
  44.  
  45. CAnnotateApp theApp;
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CAnnotateApp initialization
  49.  
  50. BOOL CAnnotateApp::InitInstance()
  51. {
  52.     AfxEnableControlContainer();
  53.  
  54.     // Standard initialization
  55.     // If you are not using these features and wish to reduce the size
  56.     //  of your final executable, you should remove from the following
  57.     //  the specific initialization routines you do not need.
  58.  
  59. #ifdef _AFXDLL
  60.     Enable3dControls();            // Call this when using MFC in a shared DLL
  61. #else
  62.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  63. #endif
  64.  
  65.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  66.  
  67.     // Register the application's document templates.  Document templates
  68.     //  serve as the connection between documents, frame windows and views.
  69.  
  70.     CSingleDocTemplate* pDocTemplate;
  71.     pDocTemplate = new CSingleDocTemplate(
  72.         IDR_MAINFRAME,
  73.         RUNTIME_CLASS(CAnnotateDoc),
  74.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  75.         RUNTIME_CLASS(CAnnotateView));
  76.     AddDocTemplate(pDocTemplate);
  77.  
  78.     // Parse command line for standard shell commands, DDE, file open
  79.     CCommandLineInfo cmdInfo;
  80.     ParseCommandLine(cmdInfo);
  81.  
  82.     // Dispatch commands specified on the command line
  83.     if (!ProcessShellCommand(cmdInfo))
  84.         return FALSE;
  85.  
  86.     return TRUE;
  87. }
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CAboutDlg dialog used for App About
  91.  
  92. class CAboutDlg : public CDialog
  93. {
  94. public:
  95.     CAboutDlg();
  96.  
  97. // Dialog Data
  98.     //{{AFX_DATA(CAboutDlg)
  99.     enum { IDD = IDD_ABOUTBOX };
  100.     //}}AFX_DATA
  101.  
  102.     // ClassWizard generated virtual function overrides
  103.     //{{AFX_VIRTUAL(CAboutDlg)
  104.     protected:
  105.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  106.     //}}AFX_VIRTUAL
  107.  
  108. // Implementation
  109. protected:
  110.     //{{AFX_MSG(CAboutDlg)
  111.     afx_msg void OnEditLockannotations();
  112.     afx_msg void OnUpdateEditLockannotations(CCmdUI* pCmdUI);
  113.     //}}AFX_MSG
  114.     DECLARE_MESSAGE_MAP()
  115. };
  116.  
  117. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  118. {
  119.     //{{AFX_DATA_INIT(CAboutDlg)
  120.     //}}AFX_DATA_INIT
  121. }
  122.  
  123. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  124. {
  125.     CDialog::DoDataExchange(pDX);
  126.     //{{AFX_DATA_MAP(CAboutDlg)
  127.     //}}AFX_DATA_MAP
  128. }
  129.  
  130. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  131.     //{{AFX_MSG_MAP(CAboutDlg)
  132.     ON_COMMAND(ID_EDIT_LOCKANNOTATIONS, OnEditLockannotations)
  133.     ON_UPDATE_COMMAND_UI(ID_EDIT_LOCKANNOTATIONS, OnUpdateEditLockannotations)
  134.     //}}AFX_MSG_MAP
  135. END_MESSAGE_MAP()
  136.  
  137. // App command to run the dialog
  138. void CAnnotateApp::OnAppAbout()
  139. {
  140.     CAboutDlg aboutDlg;
  141.     aboutDlg.DoModal();
  142. }
  143.  
  144. /////////////////////////////////////////////////////////////////////////////
  145. // CAnnotateApp commands
  146. int CAnnotateApp::DisplayLEADError(int nCode)
  147. {
  148.     CString str;
  149.  
  150.     if(nCode)
  151.     {
  152.         str.Format("A LEADTOOLS error has occured.\nCODE = %d", nCode);
  153.         m_pMainWnd->MessageBox(str);
  154.     }
  155.     return(nCode);
  156. }
  157.  
  158. void CAboutDlg::OnEditLockannotations() 
  159. {
  160.     // TODO: Add your command handler code here
  161.     
  162. }
  163.  
  164. void CAboutDlg::OnUpdateEditLockannotations(CCmdUI* pCmdUI) 
  165. {
  166.     // TODO: Add your command update UI handler code here
  167.     
  168. }
  169.