home *** CD-ROM | disk | FTP | other *** search
/ Looney Tunes Photo Fun / LooneyTunesPhotoFun.iso / Daosdk / DISK4 / DAOSDK.1 / mainfrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-06  |  2.9 KB  |  120 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "DAOEMP.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_DYNCREATE(CMainFrame, CFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  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.     // Global help commands
  26.     ON_COMMAND(ID_HELP_INDEX, CFrameWnd::OnHelpIndex)
  27.     ON_COMMAND(ID_HELP_USING, CFrameWnd::OnHelpUsing)
  28.     ON_COMMAND(ID_HELP, CFrameWnd::OnHelp)
  29.     ON_COMMAND(ID_CONTEXT_HELP, CFrameWnd::OnContextHelp)
  30.     ON_COMMAND(ID_DEFAULT_HELP, CFrameWnd::OnHelpIndex)
  31. END_MESSAGE_MAP()
  32.  
  33. /////////////////////////////////////////////////////////////////////////////
  34. // arrays of IDs used to initialize control bars
  35.     
  36. // toolbar buttons - IDs are command buttons
  37. static UINT BASED_CODE buttons[] =
  38. {
  39.     // same order as in the bitmap 'toolbar.bmp'
  40.     ID_EDIT_ADD,
  41.     ID_EDIT_DELETE,
  42.         ID_SEPARATOR,
  43.     ID_EDIT_PREVIOUS,
  44.     ID_EDIT_NEXT
  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.  
  61. }
  62.  
  63. CMainFrame::~CMainFrame()
  64. {
  65. }
  66.  
  67. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  68. {
  69.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  70.         return -1;
  71.     
  72.     if (!m_wndToolBar.Create(this) ||
  73.         !m_wndToolBar.LoadBitmap(IDR_MAINFRAME) ||
  74.         !m_wndToolBar.SetButtons(buttons,
  75.           sizeof(buttons)/sizeof(UINT)))
  76.     {
  77.         TRACE0("Failed to create toolbar\n");
  78.         return -1;      // fail to create
  79.     }
  80.  
  81.     if (!m_wndStatusBar.Create(this) ||
  82.         !m_wndStatusBar.SetIndicators(indicators,
  83.           sizeof(indicators)/sizeof(UINT)))
  84.     {
  85.         TRACE0("Failed to create status bar\n");
  86.         return -1;      // fail to create
  87.     }
  88.  
  89.     // TODO: Delete these three lines if you don't want the toolbar to
  90.     //  be dockable
  91.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  92.     EnableDocking(CBRS_ALIGN_ANY);
  93.     DockControlBar(&m_wndToolBar);
  94.  
  95.     // TODO: Remove this if you don't want tool tips
  96.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  97.         CBRS_TOOLTIPS | CBRS_FLYBY);
  98.  
  99.     return 0;
  100. }
  101.  
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CMainFrame diagnostics
  104.  
  105. #ifdef _DEBUG
  106. void CMainFrame::AssertValid() const
  107. {
  108.     CFrameWnd::AssertValid();
  109. }
  110.  
  111. void CMainFrame::Dump(CDumpContext& dc) const
  112. {
  113.     CFrameWnd::Dump(dc);
  114. }
  115.  
  116. #endif //_DEBUG
  117.  
  118. /////////////////////////////////////////////////////////////////////////////
  119. // CMainFrame message handlers
  120.