1 // MainFrm.cpp : implementation of the CMainFrame class
5 #include "logic_editor.h"
9 #include "logic_editorDoc.h"
14 static char THIS_FILE
[] = __FILE__
;
17 /////////////////////////////////////////////////////////////////////////////
20 IMPLEMENT_DYNAMIC(CMainFrame
, CMDIFrameWnd
)
22 BEGIN_MESSAGE_MAP(CMainFrame
, CMDIFrameWnd
)
23 //{{AFX_MSG_MAP(CMainFrame)
24 // NOTE - the ClassWizard will add and remove mapping macros here.
25 // DO NOT EDIT what you see in these blocks of generated code !
31 static UINT indicators
[] =
33 ID_SEPARATOR
, // status line indicator
39 /////////////////////////////////////////////////////////////////////////////
40 // CMainFrame construction/destruction
42 CMainFrame::CMainFrame()
44 // TODO: add member initialization code here
52 CMainFrame::~CMainFrame()
56 /////////////////////////////////////////////////////////////////////////////
57 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct
)
59 if (CMDIFrameWnd::OnCreate(lpCreateStruct
) == -1)
62 if (!m_wndToolBar
.CreateEx(this, TBSTYLE_FLAT
, WS_CHILD
| WS_VISIBLE
| CBRS_TOP
63 | CBRS_GRIPPER
| CBRS_TOOLTIPS
| CBRS_FLYBY
| CBRS_SIZE_DYNAMIC
) ||
64 !m_wndToolBar
.LoadToolBar(IDR_MAINFRAME
))
66 TRACE0("Failed to create toolbar\n");
67 return -1; // fail to create
70 if (!m_wndStatusBar
.Create(this) ||
71 !m_wndStatusBar
.SetIndicators(indicators
,
72 sizeof(indicators
)/sizeof(UINT
)))
74 TRACE0("Failed to create status bar\n");
75 return -1; // fail to create
78 // TODO: Delete these three lines if you don't want the toolbar to
80 m_wndToolBar
.EnableDocking(CBRS_ALIGN_ANY
);
81 EnableDocking(CBRS_ALIGN_ANY
);
82 DockControlBar(&m_wndToolBar
);
87 /////////////////////////////////////////////////////////////////////////////
88 BOOL
CMainFrame::PreCreateWindow(CREATESTRUCT
& cs
)
90 if ((CreateCX
!= 0)&&(CreateCY
!= 0))
98 if( !CMDIFrameWnd::PreCreateWindow(cs
) )
100 // TODO: Modify the Window class or styles here by modifying
101 // the CREATESTRUCT cs
106 /////////////////////////////////////////////////////////////////////////////
107 void CMainFrame::OnClose()
113 //-----------------------------------------------
116 //-----------------------------------------------
117 void CMainFrame::load( const TCHAR
* fileName
)
120 CChildFrame
*pChild
= (CChildFrame
*) GetActiveFrame();
121 ASSERT_VALID(pChild
);
124 CLogic_editorDoc
*pDoc
= static_cast<CLogic_editorDoc
*> (pChild
->GetActiveDocument());
126 pDoc
->load( fileName
);
133 /////////////////////////////////////////////////////////////////////////////
134 // CMainFrame diagnostics
137 void CMainFrame::AssertValid() const
139 CMDIFrameWnd::AssertValid();
142 void CMainFrame::Dump(CDumpContext
& dc
) const
144 CMDIFrameWnd::Dump(dc
);
151 /////////////////////////////////////////////////////////////////////////////
152 // CMainFrame message handlers