X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fctsim.cpp;h=d0cc8c686c28072b085a780b62a4c5d216163ef0;hb=dd8faeb9c2a1633c96ca31bce81e338a591fab71;hp=ee7b4a8ab62285de8560f3d6e53e6322d73ee2f9;hpb=a5d437cb4228b07f8c005eaca497c317b8c19d14;p=ctsim.git diff --git a/src/ctsim.cpp b/src/ctsim.cpp index ee7b4a8..d0cc8c6 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.40 2001/01/20 17:43:41 kevin Exp $ +** $Id: ctsim.cpp,v 1.41 2001/01/26 00:45:24 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 @@ -70,7 +70,7 @@ #endif #endif -static const char* rcsindent = "$Id: ctsim.cpp,v 1.40 2001/01/20 17:43:41 kevin Exp $"; +static const char* rcsindent = "$Id: ctsim.cpp,v 1.41 2001/01/26 00:45:24 kevin Exp $"; struct option CTSimApp::ctsimOptions[] = { @@ -207,6 +207,11 @@ CTSimApp::usage(const char* program) int CTSimApp::OnExit() { + if (theApp->getConfig()) + theApp->getDocManager()->FileHistorySave (*theApp->getConfig()); + delete theApp->getDocManager(); + m_docManager = NULL; + #ifdef HAVE_DMALLOC dmalloc_shutdown(); #endif @@ -293,6 +298,7 @@ MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const file_menu->Append(MAINMENU_FILE_EXIT, "E&xit"); // history of files visited + theApp->getDocManager()->FileHistoryAddFilesToMenu(file_menu); theApp->getDocManager()->FileHistoryUseMenu(file_menu); #ifndef CTSIM_MDI @@ -355,9 +361,6 @@ MainFrame::MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const MainFrame::~MainFrame() { - if (theApp->getConfig()) - theApp->getDocManager()->FileHistorySave (*theApp->getConfig()); - delete theApp->getDocManager(); } void @@ -546,7 +549,7 @@ MainFrame::OnUpdateUI (wxUpdateUIEvent& rEvent) void MainFrame::OnMRUFile (wxCommandEvent& event) { - wxString fileName (theApp->getDocManager()->GetHistoryFile(event.GetSelection())); + wxString fileName (theApp->getDocManager()->GetHistoryFile(event.GetId() - wxID_FILE1)); if (fileName != "") theApp->getDocManager()->CreateDocument(fileName, wxDOC_SILENT); }