]> icculus.org git repositories - taylor/freespace2.git/blob - src/pofview/mainfrm.cpp
added copyright header
[taylor/freespace2.git] / src / pofview / mainfrm.cpp
1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
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
6  * the source.
7  */
8
9 // MainFrm.cpp : implementation of the CMainFrame class
10 //
11
12 #include "stdafx.h"
13 #include "pofview.h"
14
15 #include "mainfrm.h"
16
17 #ifdef _DEBUG
18 #define new DEBUG_NEW
19 #undef THIS_FILE
20 static char THIS_FILE[] = __FILE__;
21 #endif
22
23 /////////////////////////////////////////////////////////////////////////////
24 // CMainFrame
25
26 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
27
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 !
32         ON_WM_CREATE()
33         //}}AFX_MSG_MAP
34 END_MESSAGE_MAP()
35
36 static UINT indicators[] =
37 {
38         ID_SEPARATOR,           // status line indicator
39         ID_INDICATOR_CAPS,
40         ID_INDICATOR_NUM,
41         ID_INDICATOR_SCRL,
42 };
43
44 /////////////////////////////////////////////////////////////////////////////
45 // CMainFrame construction/destruction
46
47 CMainFrame::CMainFrame()
48 {
49         // TODO: add member initialization code here
50         
51 }
52
53 CMainFrame::~CMainFrame()
54 {
55 }
56
57 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
58 {
59         if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
60                 return -1;
61         
62         if (!m_wndToolBar.Create(this) ||
63                 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
64         {
65                 TRACE0("Failed to create toolbar\n");
66                 return -1;      // fail to create
67         }
68
69         if (!m_wndStatusBar.Create(this) ||
70                 !m_wndStatusBar.SetIndicators(indicators,
71                   sizeof(indicators)/sizeof(UINT)))
72         {
73                 TRACE0("Failed to create status bar\n");
74                 return -1;      // fail to create
75         }
76
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);
80
81         // TODO: Delete these three lines if you don't want the toolbar to
82         //  be dockable
83         m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
84         EnableDocking(CBRS_ALIGN_ANY);
85         DockControlBar(&m_wndToolBar);
86
87         return 0;
88 }
89
90 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
91 {
92         // TODO: Modify the Window class or styles here by modifying
93         //  the CREATESTRUCT cs
94
95         return CMDIFrameWnd::PreCreateWindow(cs);
96 }
97
98 /////////////////////////////////////////////////////////////////////////////
99 // CMainFrame diagnostics
100
101 #ifdef _DEBUG
102 void CMainFrame::AssertValid() const
103 {
104         CMDIFrameWnd::AssertValid();
105 }
106
107 void CMainFrame::Dump(CDumpContext& dc) const
108 {
109         CMDIFrameWnd::Dump(dc);
110 }
111
112 #endif //_DEBUG
113
114 /////////////////////////////////////////////////////////////////////////////
115 // CMainFrame message handlers
116