]> icculus.org git repositories - taylor/freespace2.git/blob - src/pofview/mainfrm.cpp
Initial revision
[taylor/freespace2.git] / src / pofview / mainfrm.cpp
1 // MainFrm.cpp : implementation of the CMainFrame class
2 //
3
4 #include "stdafx.h"
5 #include "pofview.h"
6
7 #include "mainfrm.h"
8
9 #ifdef _DEBUG
10 #define new DEBUG_NEW
11 #undef THIS_FILE
12 static char THIS_FILE[] = __FILE__;
13 #endif
14
15 /////////////////////////////////////////////////////////////////////////////
16 // CMainFrame
17
18 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
19
20 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
21         //{{AFX_MSG_MAP(CMainFrame)
22                 // NOTE - the ClassWizard will add and remove mapping macros here.
23                 //    DO NOT EDIT what you see in these blocks of generated code !
24         ON_WM_CREATE()
25         //}}AFX_MSG_MAP
26 END_MESSAGE_MAP()
27
28 static UINT indicators[] =
29 {
30         ID_SEPARATOR,           // status line indicator
31         ID_INDICATOR_CAPS,
32         ID_INDICATOR_NUM,
33         ID_INDICATOR_SCRL,
34 };
35
36 /////////////////////////////////////////////////////////////////////////////
37 // CMainFrame construction/destruction
38
39 CMainFrame::CMainFrame()
40 {
41         // TODO: add member initialization code here
42         
43 }
44
45 CMainFrame::~CMainFrame()
46 {
47 }
48
49 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
50 {
51         if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
52                 return -1;
53         
54         if (!m_wndToolBar.Create(this) ||
55                 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
56         {
57                 TRACE0("Failed to create toolbar\n");
58                 return -1;      // fail to create
59         }
60
61         if (!m_wndStatusBar.Create(this) ||
62                 !m_wndStatusBar.SetIndicators(indicators,
63                   sizeof(indicators)/sizeof(UINT)))
64         {
65                 TRACE0("Failed to create status bar\n");
66                 return -1;      // fail to create
67         }
68
69         // TODO: Remove this if you don't want tool tips or a resizeable toolbar
70         m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
71                 CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
72
73         // TODO: Delete these three lines if you don't want the toolbar to
74         //  be dockable
75         m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
76         EnableDocking(CBRS_ALIGN_ANY);
77         DockControlBar(&m_wndToolBar);
78
79         return 0;
80 }
81
82 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
83 {
84         // TODO: Modify the Window class or styles here by modifying
85         //  the CREATESTRUCT cs
86
87         return CMDIFrameWnd::PreCreateWindow(cs);
88 }
89
90 /////////////////////////////////////////////////////////////////////////////
91 // CMainFrame diagnostics
92
93 #ifdef _DEBUG
94 void CMainFrame::AssertValid() const
95 {
96         CMDIFrameWnd::AssertValid();
97 }
98
99 void CMainFrame::Dump(CDumpContext& dc) const
100 {
101         CMDIFrameWnd::Dump(dc);
102 }
103
104 #endif //_DEBUG
105
106 /////////////////////////////////////////////////////////////////////////////
107 // CMainFrame message handlers