]> icculus.org git repositories - taylor/freespace2.git/blob - src/helped/mainfrm.cpp
modify gameseq such that we can process an event with an unset state
[taylor/freespace2.git] / src / helped / 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 "helped.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_DYNCREATE(CMainFrame, CFrameWnd)
27
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 !
32         ON_WM_CREATE()
33         //}}AFX_MSG_MAP
34 END_MESSAGE_MAP()
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 (CFrameWnd::OnCreate(lpCreateStruct) == -1)
52                 return -1;
53         
54         if (!m_wndToolBar.CreateEx(this) ||
55                 !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
56         {
57                 TRACE0("Failed to create toolbar\n");
58                 return -1;      // fail to create
59         }
60         if (!m_wndDlgBar.Create(this, IDR_MAINFRAME, 
61                 CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
62         {
63                 TRACE0("Failed to create dialogbar\n");
64                 return -1;              // fail to create
65         }
66
67         if (!m_wndReBar.Create(this) ||
68                 !m_wndReBar.AddBar(&m_wndToolBar) ||
69                 !m_wndReBar.AddBar(&m_wndDlgBar))
70         {
71                 TRACE0("Failed to create rebar\n");
72                 return -1;      // fail to create
73         }
74
75         // TODO: Remove this if you don't want tool tips
76         m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
77                 CBRS_TOOLTIPS | CBRS_FLYBY);
78
79         return 0;
80 }
81
82 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
83 {
84         if( !CFrameWnd::PreCreateWindow(cs) )
85                 return FALSE;
86         // TODO: Modify the Window class or styles here by modifying
87         //  the CREATESTRUCT cs
88
89         cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE
90                 | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
91
92         return TRUE;
93 }
94
95 /////////////////////////////////////////////////////////////////////////////
96 // CMainFrame diagnostics
97
98 #ifdef _DEBUG
99 void CMainFrame::AssertValid() const
100 {
101         CFrameWnd::AssertValid();
102 }
103
104 void CMainFrame::Dump(CDumpContext& dc) const
105 {
106         CFrameWnd::Dump(dc);
107 }
108
109 #endif //_DEBUG
110
111 /////////////////////////////////////////////////////////////////////////////
112 // CMainFrame message handlers
113