home *** CD-ROM | disk | FTP | other *** search
/ ftp.funduc.com / 2014.08.ftp.funduc.com.tar / ftp.funduc.com / fshedcode-072212.zip / MainFrm.cpp < prev    next >
C/C++ Source or Header  |  2010-09-13  |  3KB  |  123 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. //    License (GPLv2+):
  3. //    This program is free software; you can redistribute it and/or modify
  4. //    it under the terms of the GNU General Public License as published by
  5. //    the Free Software Foundation; either version 2 of the License, or
  6. //    (at your option) any later version.
  7. //
  8. //    This program is distributed in the hope that it will be useful, but
  9. //    WITHOUT ANY WARRANTY; without even the implied warranty of
  10. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11. //    General Public License for more details.
  12. //
  13. //    You should have received a copy of the GNU General Public License
  14. //    along with this program; if not, write to the Free Software
  15. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. /////////////////////////////////////////////////////////////////////////////
  17.  
  18. #include "stdafx.h"
  19. #include "fshed.h"
  20.  
  21. #include "MainFrm.h"
  22.  
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CMainFrame
  31.  
  32. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  33.  
  34. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  35.     //{{AFX_MSG_MAP(CMainFrame)
  36.     ON_WM_CREATE()
  37.     //}}AFX_MSG_MAP
  38.     ON_COMMAND(ID_HELP_FINDER, CFrameWnd::OnHelpFinder)
  39.     ON_COMMAND(ID_HELP, CFrameWnd::OnHelp)
  40.     ON_COMMAND(ID_CONTEXT_HELP, CFrameWnd::OnContextHelp)
  41.     ON_COMMAND(ID_DEFAULT_HELP, CFrameWnd::OnHelpFinder)
  42. END_MESSAGE_MAP()
  43.  
  44. static UINT indicators[] =
  45. {
  46.     ID_SEPARATOR,           // status line indicator
  47.     ID_INDICATOR_CAPS,
  48.     ID_INDICATOR_NUM,
  49.     ID_INDICATOR_SCRL,
  50. };
  51.  
  52. /////////////////////////////////////////////////////////////////////////////
  53. // CMainFrame construction/destruction
  54.  
  55. CMainFrame::CMainFrame()
  56. {
  57.     // TODO: add member initialization code here
  58.     
  59. }
  60.  
  61. CMainFrame::~CMainFrame()
  62. {
  63. }
  64.  
  65. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  66. {
  67.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  68.         return -1;
  69.     
  70.     if (!m_wndToolBar.Create(this) ||
  71.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  72.     {
  73.         TRACE0("Failed to create toolbar\n");
  74.         return -1;      // fail to create
  75.     }
  76.  
  77.     if (!m_wndStatusBar.Create(this) ||
  78.         !m_wndStatusBar.SetIndicators(indicators,
  79.           sizeof(indicators)/sizeof(UINT)))
  80.     {
  81.         TRACE0("Failed to create status bar\n");
  82.         return -1;      // fail to create
  83.     }
  84.  
  85.     // TODO: Delete these three lines if you don't want the toolbar to
  86.     //  be dockable
  87.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  88.     EnableDocking(CBRS_ALIGN_ANY);
  89.     DockControlBar(&m_wndToolBar);
  90.  
  91.     return 0;
  92. }
  93.  
  94. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  95. {
  96.     if( !CMDIFrameWnd::PreCreateWindow(cs) )
  97.         return FALSE;
  98.     // TODO: Modify the Window class or styles here by modifying
  99.     //  the CREATESTRUCT cs
  100.  
  101.     return TRUE;
  102. }
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CMainFrame diagnostics
  106.  
  107. #ifdef _DEBUG
  108. void CMainFrame::AssertValid() const
  109. {
  110.     CMDIFrameWnd::AssertValid();
  111. }
  112.  
  113. void CMainFrame::Dump(CDumpContext& dc) const
  114. {
  115.     CMDIFrameWnd::Dump(dc);
  116. }
  117.  
  118. #endif //_DEBUG
  119.  
  120. /////////////////////////////////////////////////////////////////////////////
  121. // CMainFrame message handlers
  122.  
  123.