home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / VfbEx / MainFrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-10  |  2.6 KB  |  112 lines

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