home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n04 / olecont.exe / MAINFRM.CPP < prev    next >
Text File  |  1995-04-01  |  3KB  |  121 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "contain.h"
  6.  
  7. #include "mainfrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMainFrame
  16.  
  17. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  20.     //{{AFX_MSG_MAP(CMainFrame)
  21.         // NOTE - the ClassWizard will add and remove mapping macros here.
  22.         //    DO NOT EDIT what you see in these blocks of generated code !
  23.     ON_WM_CREATE()
  24.     //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26.  
  27. /////////////////////////////////////////////////////////////////////////////
  28. // arrays of IDs used to initialize control bars
  29.     
  30. // toolbar buttons - IDs are command buttons
  31. static UINT BASED_CODE buttons[] =
  32. {
  33.     // same order as in the bitmap 'toolbar.bmp'
  34.     ID_FILE_NEW,
  35.     ID_FILE_OPEN,
  36.     ID_FILE_SAVE,
  37.         ID_SEPARATOR,
  38.     ID_EDIT_CUT,
  39.     ID_EDIT_COPY,
  40.     ID_EDIT_PASTE,
  41.         ID_SEPARATOR,
  42.     ID_FILE_PRINT,
  43.     ID_APP_ABOUT,
  44.     ID_CONTEXT_HELP,
  45. };
  46.  
  47. static UINT BASED_CODE indicators[] =
  48. {
  49.     ID_SEPARATOR,           // status line indicator
  50.     ID_INDICATOR_CAPS,
  51.     ID_INDICATOR_NUM,
  52.     ID_INDICATOR_SCRL,
  53. };
  54.  
  55. /////////////////////////////////////////////////////////////////////////////
  56. // CMainFrame construction/destruction
  57.  
  58. CMainFrame::CMainFrame()
  59. {
  60.     // TODO: add member initialization code here
  61.     
  62. }
  63.  
  64. CMainFrame::~CMainFrame()
  65. {
  66. }
  67.  
  68. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  69. {
  70.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  71.         return -1;
  72.     
  73.     if (!m_wndToolBar.Create(this) ||
  74.         !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  75.         !m_wndToolBar.SetButtons(buttons,
  76.           sizeof(buttons)/sizeof(UINT)))
  77.     {
  78.         TRACE0("Failed to create toolbar\n");
  79.         return -1;      // fail to create
  80.     }
  81.  
  82.     if (!m_wndStatusBar.Create(this) ||
  83.         !m_wndStatusBar.SetIndicators(indicators,
  84.           sizeof(indicators)/sizeof(UINT)))
  85.     {
  86.         TRACE0("Failed to create status bar\n");
  87.         return -1;      // fail to create
  88.     }
  89.  
  90.     // TODO: Delete these three lines if you don't want the toolbar to
  91.     //  be dockable
  92.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  93.     EnableDocking(CBRS_ALIGN_ANY);
  94.     DockControlBar(&m_wndToolBar);
  95.  
  96.     // TODO: Remove this if you don't want tool tips
  97.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  98.         CBRS_TOOLTIPS | CBRS_FLYBY);
  99.  
  100.     return 0;
  101. }
  102.  
  103. /////////////////////////////////////////////////////////////////////////////
  104. // CMainFrame diagnostics
  105.  
  106. #ifdef _DEBUG
  107. void CMainFrame::AssertValid() const
  108. {
  109.     CMDIFrameWnd::AssertValid();
  110. }
  111.  
  112. void CMainFrame::Dump(CDumpContext& dc) const
  113. {
  114.     CMDIFrameWnd::Dump(dc);
  115. }
  116.  
  117. #endif //_DEBUG
  118.  
  119. /////////////////////////////////////////////////////////////////////////////
  120. // CMainFrame message handlers
  121.