2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
9 // MainFrm.cpp : implementation of the CMainFrame class
20 static char THIS_FILE[] = __FILE__;
23 /////////////////////////////////////////////////////////////////////////////
26 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
28 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
29 //{{AFX_MSG_MAP(CMainFrame)
30 // NOTE - the ClassWizard will add and remove mapping macros here.
31 // DO NOT EDIT what you see in these blocks of generated code !
36 static UINT indicators[] =
38 ID_SEPARATOR, // status line indicator
44 /////////////////////////////////////////////////////////////////////////////
45 // CMainFrame construction/destruction
47 CMainFrame::CMainFrame()
49 // TODO: add member initialization code here
53 CMainFrame::~CMainFrame()
57 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
59 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
62 if (!m_wndToolBar.Create(this) ||
63 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
65 TRACE0("Failed to create toolbar\n");
66 return -1; // fail to create
69 if (!m_wndStatusBar.Create(this) ||
70 !m_wndStatusBar.SetIndicators(indicators,
71 sizeof(indicators)/sizeof(UINT)))
73 TRACE0("Failed to create status bar\n");
74 return -1; // fail to create
77 // TODO: Remove this if you don't want tool tips or a resizeable toolbar
78 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
79 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
81 // TODO: Delete these three lines if you don't want the toolbar to
83 m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
84 EnableDocking(CBRS_ALIGN_ANY);
85 DockControlBar(&m_wndToolBar);
90 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
92 // TODO: Modify the Window class or styles here by modifying
93 // the CREATESTRUCT cs
95 return CMDIFrameWnd::PreCreateWindow(cs);
98 /////////////////////////////////////////////////////////////////////////////
99 // CMainFrame diagnostics
102 void CMainFrame::AssertValid() const
104 CMDIFrameWnd::AssertValid();
107 void CMainFrame::Dump(CDumpContext& dc) const
109 CMDIFrameWnd::Dump(dc);
114 /////////////////////////////////////////////////////////////////////////////
115 // CMainFrame message handlers