X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fctsim.cpp;h=385fbee15445f120343b24bf7830efb62d649474;hp=a7417fed387b43cacbd41db94961e760e36d5e81;hb=a05f3cb550877e94aa118cc04b361c0c8fdb3dc3;hpb=ab4a3ba2c1ba9672136b5022897f81fc55d03493;ds=sidebyside diff --git a/src/ctsim.cpp b/src/ctsim.cpp index a7417fe..385fbee 100644 --- a/src/ctsim.cpp +++ b/src/ctsim.cpp @@ -1,15 +1,15 @@ /***************************************************************************** ** FILE IDENTIFICATION ** -** Name: ctsim.h -** Purpose: Header file for top-level routines of CTSim program +** Name: ctsim.cpp +** Purpose: Top-level routines of CTSim program ** Programmer: Kevin Rosenberg ** Date Started: July 2000 ** ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsim.cpp,v 1.6 2000/07/19 04:33:27 kevin Exp $ +** $Id: ctsim.cpp,v 1.10 2000/08/31 08:38:58 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 @@ -53,12 +53,14 @@ #include #endif +static const char* rcsindent = "$Id: ctsim.cpp,v 1.10 2000/08/31 08:38:58 kevin Exp $"; class CTSimApp* theApp = NULL; struct option CTSimApp::ctsimOptions[] = { {"help", 0, 0, O_HELP}, + {"version", 0, 0, O_VERSION}, {0, 0, 0, 0} }; @@ -80,6 +82,9 @@ CTSimApp::OnInit(void) break; switch (c) { + case O_VERSION: + cout << rcsindent << endl; + exit(0); case O_HELP: case '?': usage (argv[0]); @@ -104,7 +109,7 @@ CTSimApp::OnInit(void) //// Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(MAINMENU_FILE_CREATE_PHANTOM, "&Create Phantom..."); + file_menu->Append(MAINMENU_FILE_CREATE_PHANTOM, "Cr&eate Phantom..."); file_menu->Append(wxID_OPEN, "&Open..."); file_menu->AppendSeparator(); @@ -144,6 +149,7 @@ CTSimApp::usage(const char* program) cout << "usage: " << fileBasename(program) << " [files-to-open...] [OPTIONS]\n"; cout << "Computed Tomography Simulator (Graphical Shell)\n"; cout << "\n"; + cout << " --version Display version\n"; cout << " --help Display this help message\n"; } @@ -151,6 +157,9 @@ int CTSimApp::OnExit(void) { delete m_docManager; +#ifdef HAVE_DMALLOC + dmalloc_shutdown(); +#endif return 0; } @@ -196,13 +205,12 @@ MainFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) void MainFrame::OnCreatePhantom(wxCommandEvent& WXUNUSED(event)) { - DialogGetPhantom dialogPhantom (this, Phantom::PHM_HERMAN_STR); + DialogGetPhantom dialogPhantom (this, Phantom::PHM_HERMAN); int dialogReturn = dialogPhantom.ShowModal(); if (dialogReturn == wxID_OK) { - string selection = dialogPhantom.getPhantom(); + wxString selection (dialogPhantom.getPhantom()); *theApp->getLog() << "Selected phantom " << selection.c_str() << "\n"; - wxString filename = selection.c_str(); - filename += ".phm"; + wxString filename = selection + ".phm"; theApp->getDocManager()->CreateDocument(filename, wxDOC_SILENT); }