** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.25 2001/01/02 16:02:13 kevin Exp $
+** $Id: ctsim.cpp,v 1.26 2001/01/06 15:33:15 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
#endif
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.25 2001/01/02 16:02:13 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.26 2001/01/06 15:33:15 kevin Exp $";
class CTSimApp* theApp = NULL;
//// Create the main frame window
m_pFrame = new MainFrame(m_docManager, (wxFrame *) NULL, -1, "CTSim", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
-
+
SetTopWindow (m_pFrame);
m_pFrame->Centre(wxBOTH);
// Top-level window for CTSim
+#if CTSIM_MDI
+IMPLEMENT_CLASS(MainFrame, wxMDIParentFrame)
+
+BEGIN_EVENT_TABLE(MainFrame, wxMDIParentFrame)
+#else
IMPLEMENT_CLASS(MainFrame, wxDocParentFrame)
BEGIN_EVENT_TABLE(MainFrame, wxDocParentFrame)
+#endif
+
EVT_MENU(MAINMENU_HELP_ABOUT, MainFrame::OnAbout)
EVT_MENU(MAINMENU_HELP_CONTENTS, MainFrame::OnHelpContents)
EVT_MENU(MAINMENU_FILE_CREATE_PHANTOM, MainFrame::OnCreatePhantom)
+#if CTSIM_MDI
+MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type)
+: wxMDIParentFrame(NULL, id, title, pos, size, type), m_pLog(NULL)
+#else
MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type)
: wxDocParentFrame(manager, frame, id, title, pos, size, type), m_pLog(NULL)
+#endif
{
m_pLog = new wxTextCtrl (this, -1, "Log Window\n", wxPoint(0, 250), wxSize(100,50), wxTE_MULTILINE | wxTE_READONLY);
wxLog::SetActiveTarget(new wxLogTextCtrl(m_pLog));
file_menu->Append(MAINMENU_FILE_EXIT, "E&xit");
// history of files visited
- m_docManager->FileHistoryUseMenu(file_menu);
+ theApp->getDocManager()->FileHistoryUseMenu(file_menu);
m_pWindowMenu = new wxMenu;
m_pWindowMenu->UpdateUI (this);
MainFrame::OnUpdateUI (wxUpdateUIEvent& rEvent)
{
int iPos = 0;
- wxList& rListDocs = m_docManager->GetDocuments();
+ wxList& rListDocs = theApp->getDocManager()->GetDocuments();
wxNode* pNode = rListDocs.GetFirst();
while (iPos < MAX_WINDOW_MENUITEMS && pNode != NULL) {
wxDocument* pDoc = static_cast<wxDocument*>(pNode->GetData());