1 /* -*- c++ -*-
2 FILE: MainFrm.cpp
3 RCS REVISION: $Revision: 1.10 $
4 
5 COPYRIGHT: (c) 1999 -- 2003 Melinda Green, Don Hatch, and Jay Berkenbilt - Superliminal Software
6 
7 LICENSE: Free to use and modify for non-commercial purposes as long as the
8     following conditions are adhered to:
9     1) Obvious credit for the source of this code and the designs it embodies
10        are clearly made, and
11     2) Ports and derived versions of 4D Magic Cube programs are not distributed
12        without the express written permission of the authors.
13 
14 DESCRIPTION:
15     MainFrm.cpp : implementation of the CMainFrame class
16 */
17 
18 #include "Stdafx.h"
19 #include "MagicCube4d.h"
20 
21 #include "MainFrm.h"
22 
23 #ifdef _DEBUG
24 #define new DEBUG_NEW
25 #undef THIS_FILE
26 static char THIS_FILE[] = __FILE__;
27 #endif
28 
29 /////////////////////////////////////////////////////////////////////////////
30 // CMainFrame
31 
32 IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
33     BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
34     //{{AFX_MSG_MAP(CMainFrame)
35     // NOTE - the ClassWizard will add and remove mapping macros here.
36     //    DO NOT EDIT what you see in these blocks of generated code !
37     ON_WM_CREATE()
38     //}}AFX_MSG_MAP
39     END_MESSAGE_MAP()
40 
41     static UINT indicators[] =
42 {
43     ID_SEPARATOR,           // status line indicator
44     ID_INDICATOR_CAPS,
45     ID_INDICATOR_NUM,
46     ID_INDICATOR_SCRL,
47 };
48 
49 /////////////////////////////////////////////////////////////////////////////
50 // CMainFrame construction/destruction
51 
CMainFrame()52 CMainFrame::CMainFrame()
53 {
54     // TODO: add member initialization code here
55 
56 }
57 
~CMainFrame()58 CMainFrame::~CMainFrame()
59 {
60 }
61 
62 int
OnCreate(LPCREATESTRUCT lpCreateStruct)63 CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
64 {
65     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
66         return -1;
67 
68     if (!m_wndToolBar.Create(this) ||
69         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
70     {
71         TRACE0("Failed to create toolbar\n");
72         return -1;              // fail to create
73     }
74 
75     if (!m_wndStatusBar.Create(this) ||
76         !m_wndStatusBar.SetIndicators(indicators,
77                                       sizeof(indicators) / sizeof(UINT)))
78     {
79         TRACE0("Failed to create status bar\n");
80         return -1;              // fail to create
81     }
82 
83     // TODO: Remove this if you don't want tool tips or a resizeable toolbar
84     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
85                              CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
86 
87     // TODO: Delete these three lines if you don't want the toolbar to
88     // be dockable
89     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
90     EnableDocking(CBRS_ALIGN_ANY);
91     DockControlBar(&m_wndToolBar);
92 
93     return 0;
94 }
95 
96 BOOL
PreCreateWindow(CREATESTRUCT & cs)97 CMainFrame::PreCreateWindow(CREATESTRUCT & cs)
98 {
99     // TODO: Modify the Window class or styles here by modifying
100     // the CREATESTRUCT cs
101 
102     return CFrameWnd::PreCreateWindow(cs);
103 }
104 
105 /////////////////////////////////////////////////////////////////////////////
106 // CMainFrame diagnostics
107 
108 #ifdef _DEBUG
109 void
AssertValid() const110 CMainFrame::AssertValid() const
111 {
112     CFrameWnd::AssertValid();
113 }
114 
115 void
Dump(CDumpContext & dc) const116 CMainFrame::Dump(CDumpContext & dc) const
117 {
118     CFrameWnd::Dump(dc);
119 }
120 
121 #endif // _DEBUG
122 
123 /////////////////////////////////////////////////////////////////////////////
124 // CMainFrame message handlers
125 
126 // Local Variables:
127 // c-basic-offset: 4
128 // c-comment-only-line-offset: 0
129 // c-file-offsets: ((defun-block-intro . +) (block-open . 0) (substatement-open . 0) (statement-cont . +) (statement-case-open . +4) (arglist-intro . +) (arglist-close . +) (inline-open . 0))
130 // indent-tabs-mode: nil
131 // End:
132