home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / SOUND.ZIP / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-21  |  2.3 KB  |  107 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "snd.h"
  6.  
  7. #include "MainFrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMainFrame
  17.  
  18. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  19.  
  20. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  21.     //{{AFX_MSG_MAP(CMainFrame)
  22.     ON_WM_CREATE()
  23.     //}}AFX_MSG_MAP
  24. END_MESSAGE_MAP()
  25.  
  26. static UINT indicators[] =
  27. {
  28.     ID_SEPARATOR,           // status line indicator
  29.     ID_INDICATOR_CAPS,
  30.     ID_INDICATOR_NUM,
  31.     ID_INDICATOR_SCRL,
  32. };
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // CMainFrame construction/destruction
  36.  
  37. CMainFrame::CMainFrame()
  38. {
  39.     // TODO: add member initialization code here
  40.     
  41. }
  42.  
  43. CMainFrame::~CMainFrame()
  44. {
  45. }
  46.  
  47. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  48. {
  49.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  50.         return -1;
  51.     
  52.     if (!m_wndToolBar.Create(this) ||
  53.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  54.     {
  55.         TRACE0("Failed to create toolbar\n");
  56.         return -1;      // fail to create
  57.     }
  58.  
  59.     if (!m_wndStatusBar.Create(this) ||
  60.         !m_wndStatusBar.SetIndicators(indicators,
  61.           sizeof(indicators)/sizeof(UINT)))
  62.     {
  63.         TRACE0("Failed to create status bar\n");
  64.         return -1;      // fail to create
  65.     }
  66.  
  67.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  68.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  69.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  70.  
  71.     // TODO: Delete these three lines if you don't want the toolbar to
  72.     //  be dockable
  73.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  74.     EnableDocking(CBRS_ALIGN_ANY);
  75.     DockControlBar(&m_wndToolBar);
  76.  
  77.     return 0;
  78. }
  79.  
  80. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  81. {
  82.     // TODO: Modify the Window class or styles here by modifying
  83.     //  the CREATESTRUCT cs
  84.  
  85.     return CFrameWnd::PreCreateWindow(cs);
  86. }
  87.  
  88. /////////////////////////////////////////////////////////////////////////////
  89. // CMainFrame diagnostics
  90.  
  91. #ifdef _DEBUG
  92. void CMainFrame::AssertValid() const
  93. {
  94.     CFrameWnd::AssertValid();
  95. }
  96.  
  97. void CMainFrame::Dump(CDumpContext& dc) const
  98. {
  99.     CFrameWnd::Dump(dc);
  100. }
  101.  
  102. #endif //_DEBUG
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CMainFrame message handlers
  106.  
  107.