home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 January / Pcwk0198.iso / Zadarmo / HEXVIEW / SRC / MAINFRM.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-01  |  3.3 KB  |  127 lines

  1. /* ---------------------------------------------------------------------------
  2.  
  3.    This code can be used as you wish but without warranties as to performance 
  4.    of merchantability or any other warranties whether expressed or implied.
  5.    
  6.      Written by Mike Funduc, Funduc Software Inc. 8/1/96
  7.  
  8.      To download the code and more useful utilities (including Search and
  9.      Replace for Windows 95/NT, 3.1x) go to:
  10.      http://home.sprynet.com/sprynet/funduc  or
  11.      http://ourworld.compuserve.com/homepages/funduc
  12.  
  13. ----------------------------------------------------------------------------*/
  14.  
  15. // MainFrm.cpp : implementation of the CMainFrame class
  16. //
  17.  
  18. #include "stdafx.h"
  19. #include "hexview.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.         // NOTE - the ClassWizard will add and remove mapping macros here.
  37.         //    DO NOT EDIT what you see in these blocks of generated code !
  38.     ON_WM_CREATE()
  39.     //}}AFX_MSG_MAP
  40.     // Global help commands
  41.     ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
  42.     ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
  43.     ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
  44.     ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
  45. END_MESSAGE_MAP()
  46.  
  47. static UINT 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.LoadToolBar(IDR_MAINFRAME))
  75.     {
  76.         TRACE0("Failed to create toolbar\n");
  77.         return -1;      // fail to create
  78.     }
  79.  
  80.     if (!m_wndStatusBar.Create(this) ||
  81.         !m_wndStatusBar.SetIndicators(indicators,
  82.           sizeof(indicators)/sizeof(UINT)))
  83.     {
  84.         TRACE0("Failed to create status bar\n");
  85.         return -1;      // fail to create
  86.     }
  87.  
  88.     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
  89.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  90.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  91.  
  92.     // TODO: Delete these three lines if you don't want the toolbar to
  93.     //  be dockable
  94.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  95.     EnableDocking(CBRS_ALIGN_ANY);
  96.     DockControlBar(&m_wndToolBar);
  97.  
  98.     return 0;
  99. }
  100.  
  101. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  102. {
  103.     // TODO: Modify the Window class or styles here by modifying
  104.     //  the CREATESTRUCT cs
  105.  
  106.     return CMDIFrameWnd::PreCreateWindow(cs);
  107. }
  108.  
  109. /////////////////////////////////////////////////////////////////////////////
  110. // CMainFrame diagnostics
  111.  
  112. #ifdef _DEBUG
  113. void CMainFrame::AssertValid() const
  114. {
  115.     CMDIFrameWnd::AssertValid();
  116. }
  117.  
  118. void CMainFrame::Dump(CDumpContext& dc) const
  119. {
  120.     CMDIFrameWnd::Dump(dc);
  121. }
  122.  
  123. #endif //_DEBUG
  124.  
  125. /////////////////////////////////////////////////////////////////////////////
  126. // CMainFrame message handlers
  127.