]> icculus.org git repositories - taylor/freespace2.git/blob - src/helped/mainfrm.cpp
Initial revision
[taylor/freespace2.git] / src / helped / mainfrm.cpp
1 // MainFrm.cpp : implementation of the CMainFrame class
2 //
3
4 #include "stdafx.h"
5 #include "helped.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_DYNCREATE(CMainFrame, CFrameWnd)
19
20 BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
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 /////////////////////////////////////////////////////////////////////////////
29 // CMainFrame construction/destruction
30
31 CMainFrame::CMainFrame()
32 {
33         // TODO: add member initialization code here
34         
35 }
36
37 CMainFrame::~CMainFrame()
38 {
39 }
40
41 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
42 {
43         if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
44                 return -1;
45         
46         if (!m_wndToolBar.CreateEx(this) ||
47                 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
48         {
49                 TRACE0("Failed to create toolbar\n");
50                 return -1;      // fail to create
51         }
52         if (!m_wndDlgBar.Create(this, IDR_MAINFRAME, 
53                 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
54         {
55                 TRACE0("Failed to create dialogbar\n");
56                 return -1;              // fail to create
57         }
58
59         if (!m_wndReBar.Create(this) ||
60                 !m_wndReBar.AddBar(&m_wndToolBar) ||
61                 !m_wndReBar.AddBar(&m_wndDlgBar))
62         {
63                 TRACE0("Failed to create rebar\n");
64                 return -1;      // fail to create
65         }
66
67         // TODO: Remove this if you don't want tool tips
68         m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
69                 CBRS_TOOLTIPS | CBRS_FLYBY);
70
71         return 0;
72 }
73
74 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
75 {
76         if( !CFrameWnd::PreCreateWindow(cs) )
77                 return FALSE;
78         // TODO: Modify the Window class or styles here by modifying
79         //  the CREATESTRUCT cs
80
81         cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
82                 | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
83
84         return TRUE;
85 }
86
87 /////////////////////////////////////////////////////////////////////////////
88 // CMainFrame diagnostics
89
90 #ifdef _DEBUG
91 void CMainFrame::AssertValid() const
92 {
93         CFrameWnd::AssertValid();
94 }
95
96 void CMainFrame::Dump(CDumpContext& dc) const
97 {
98         CFrameWnd::Dump(dc);
99 }
100
101 #endif //_DEBUG
102
103 /////////////////////////////////////////////////////////////////////////////
104 // CMainFrame message handlers
105