X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fdialogs.cpp;h=6f55dea0b324cc275549728745ac13202420491b;hp=ce808b4c92cb467f3a22e5b77a90fb79681b57a0;hb=dc034c9d0b7d9c3874a324a4c2c189a02945adc8;hpb=3147cd44cff6132e51eac1a179c1fc3d405faacc diff --git a/src/dialogs.cpp b/src/dialogs.cpp index ce808b4..6f55dea 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: dialogs.cpp,v 1.13 2000/09/04 09:06:46 kevin Exp $ +** $Id: dialogs.cpp,v 1.15 2000/12/16 06:12:47 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 @@ -59,13 +59,14 @@ StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* aszTitle[], const char* aszValue[]) : wxListBox () { - wxString asTitle[nChoices]; + wxString* psTitle = new wxString [nChoices]; for (int i = 0; i < nChoices; i++) - asTitle[i] = aszTitle[i]; + psTitle[i] = aszTitle[i]; - Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, asTitle, wxLB_SINGLE | wxLB_NEEDED_SB); + Create (pParent, -1, wxDefaultPosition, wxSize(200,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB); - m_ppszValues = aszValue; + m_ppszValues = aszValue; + delete [] psTitle; }; const char* @@ -76,7 +77,7 @@ StringValueAndTitleListBox::getSelectionStringValue (void) const -DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom = Phantom::PHM_HERMAN) +DialogGetPhantom::DialogGetPhantom (wxFrame* pParent, int iDefaultPhantom) : wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION) { wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); @@ -112,7 +113,7 @@ DialogGetPhantom::getPhantom(void) } -DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin = 0., double dDefaultMax = 0.) +DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& rImagefile, double dDefaultMin, double dDefaultMax) : wxDialog (pParent, -1, "Set Image Display Minimum & Maximum", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION) { wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); @@ -121,10 +122,10 @@ DialogGetImageMinMax::DialogGetImageMinMax (wxFrame* pParent, const ImageFile& r pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << dDefaultMin; m_pTextCtrlMin = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osMax; + std::ostringstream osMax; osMax << dDefaultMax; m_pTextCtrlMax = new wxTextCtrl (this, -1, osMax.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -188,7 +189,7 @@ DialogGetImageMinMax::getMaximum (void) // DialogGetRasterParameters ///////////////////////////////////////////////////////////////////// -DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize = 0, int iDefaultYSize = 0, int iDefaultNSamples = 1) +DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDefaultXSize, int iDefaultYSize, int iDefaultNSamples) : wxDialog (pParent, -1, "Set Rasterization Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION) { wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL); @@ -197,13 +198,13 @@ DialogGetRasterParameters::DialogGetRasterParameters (wxFrame* pParent, int iDef pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultXSize; m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osYSize; + std::ostringstream osYSize; osYSize << iDefaultYSize; m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNSamples; + std::ostringstream osNSamples; osNSamples << iDefaultNSamples; m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -298,22 +299,22 @@ DialogGetProjectionParameters::DialogGetProjectionParameters (wxFrame* pParent, pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultNDet; m_pTextCtrlNDet = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNView; + std::ostringstream osNView; osNView << iDefaultNView; m_pTextCtrlNView = new wxTextCtrl (this, -1, osNView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osNSamples; + std::ostringstream osNSamples; osNSamples << iDefaultNSamples; m_pTextCtrlNSamples = new wxTextCtrl (this, -1, osNSamples.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osRotAngle; + std::ostringstream osRotAngle; osRotAngle << dDefaultRotAngle; m_pTextCtrlRotAngle = new wxTextCtrl (this, -1, osRotAngle.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFocalLength; + std::ostringstream osFocalLength; osFocalLength << dDefaultFocalLength; m_pTextCtrlFocalLength = new wxTextCtrl (this, -1, osFocalLength.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFieldOfView; + std::ostringstream osFieldOfView; osFieldOfView << dDefaultFieldOfView; m_pTextCtrlFieldOfView = new wxTextCtrl (this, -1, osFieldOfView.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -462,19 +463,19 @@ DialogGetReconstructionParameters::DialogGetReconstructionParameters (wxFrame* p pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5); - ostringstream os; + std::ostringstream os; os << iDefaultXSize; m_pTextCtrlXSize = new wxTextCtrl (this, -1, os.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osYSize; + std::ostringstream osYSize; osYSize << iDefaultYSize; m_pTextCtrlYSize = new wxTextCtrl (this, -1, osYSize.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osFilterParam; + std::ostringstream osFilterParam; osFilterParam << dDefaultFilterParam; m_pTextCtrlFilterParam = new wxTextCtrl (this, -1, osFilterParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osZeropad; + std::ostringstream osZeropad; osZeropad << iDefaultZeropad; m_pTextCtrlZeropad = new wxTextCtrl (this, -1, osZeropad.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); - ostringstream osInterpParam; + std::ostringstream osInterpParam; osInterpParam << iDefaultInterpParam; m_pTextCtrlInterpParam = new wxTextCtrl (this, -1, osInterpParam.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); @@ -664,7 +665,7 @@ DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, const Im wxGridSizer *pGridSizer = new wxGridSizer (2); pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - ostringstream osDefaultFactor; + std::ostringstream osDefaultFactor; osDefaultFactor << dDefaultScaleFactor; m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, osDefaultFactor.str().c_str(), wxDefaultPosition, wxSize(100, 25), 0); pGridSizer->Add (m_pTextCtrlStdDevFactor, 0, wxALIGN_CENTER_VERTICAL);