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_DYNCREATE(CMainFrame, CFrameWnd)
28 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
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 /////////////////////////////////////////////////////////////////////////////
37 // CMainFrame construction/destruction
39 CMainFrame::CMainFrame()
41 // TODO: add member initialization code here
45 CMainFrame::~CMainFrame()
49 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
51 if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
54 if (!m_wndToolBar.CreateEx(this) ||
55 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
57 TRACE0("Failed to create toolbar\n");
58 return -1; // fail to create
60 if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
61 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
63 TRACE0("Failed to create dialogbar\n");
64 return -1; // fail to create
67 if (!m_wndReBar.Create(this) ||
68 !m_wndReBar.AddBar(&m_wndToolBar) ||
69 !m_wndReBar.AddBar(&m_wndDlgBar))
71 TRACE0("Failed to create rebar\n");
72 return -1; // fail to create
75 // TODO: Remove this if you don't want tool tips
76 m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
77 CBRS_TOOLTIPS | CBRS_FLYBY);
82 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
84 if( !CFrameWnd::PreCreateWindow(cs) )
86 // TODO: Modify the Window class or styles here by modifying
87 // the CREATESTRUCT cs
89 cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
90 | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
95 /////////////////////////////////////////////////////////////////////////////
96 // CMainFrame diagnostics
99 void CMainFrame::AssertValid() const
101 CFrameWnd::AssertValid();
104 void CMainFrame::Dump(CDumpContext& dc) const
111 /////////////////////////////////////////////////////////////////////////////
112 // CMainFrame message handlers