** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.5 2000/07/15 08:36:13 kevin Exp $
+** $Id: ctsim.cpp,v 1.6 2000/07/19 04:33:27 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
#include "wx/docview.h"
-#include "ct.h"
#include "ctsim.h"
#include "docs.h"
#include "views.h"
+#include "dialogs.h"
+#include "ctsupport.h"
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+#if defined(HAVE_GETOPT_H) || defined(HAVE_GETOPT_LONG)
+#include <getopt.h>
+#endif
+
class CTSimApp* theApp = NULL;
void
MainFrame::OnCreatePhantom(wxCommandEvent& WXUNUSED(event))
{
- wxString choiceStringList [5];
- choiceStringList[0] = Phantom::PHM_HERMAN_STR;
- choiceStringList[1] = Phantom::PHM_BHERMAN_STR;
- choiceStringList[2] = Phantom::PHM_ROWLAND_STR;;
- choiceStringList[3] = Phantom::PHM_BROWLAND_STR;
- choiceStringList[4] = Phantom::PHM_UNITPULSE_STR;
- wxString choiceTitleList [5];
- choiceTitleList[0] = "Herman Head";
- choiceTitleList[1] = "Herman Head Bordered";
- choiceTitleList[2] = "Rowland Head";
- choiceTitleList[3] = "Rowland Head Bordered";
- choiceTitleList[4] = "Unit Pulse";
- wxSingleChoiceDialog dialog (this, "Select phantom", "Phantom Selection", 5, choiceTitleList, NULL, wxOK|wxCANCEL|wxCENTRE);
-
- int dialogReturn = dialog.ShowModal();
+ DialogGetPhantom dialogPhantom (this, Phantom::PHM_HERMAN_STR);
+ int dialogReturn = dialogPhantom.ShowModal();
if (dialogReturn == wxID_OK) {
- int selection = dialog.GetSelection();
- *theApp->getLog() << "Selected phantom " << selection << "\n";
- wxString filename = choiceStringList[selection] + ".phm";
- theApp->getDocManager()->CreateDocument(filename, wxDOC_SILENT);
+ string selection = dialogPhantom.getPhantom();
+ *theApp->getLog() << "Selected phantom " << selection.c_str() << "\n";
+ wxString filename = selection.c_str();
+ filename += ".phm";
+ theApp->getDocManager()->CreateDocument(filename, wxDOC_SILENT);
}
}