** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: dialogs.cpp,v 1.10 2000/08/27 20:32:55 kevin Exp $
+** $Id: dialogs.cpp,v 1.11 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
}
-DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, const ImageFile& rIF)
+DialogAutoScaleParameters::DialogAutoScaleParameters (wxFrame *pParent, const ImageFile& rIF, double dDefaultScaleFactor)
: wxDialog (pParent, -1, "Auto Scale Parameters", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rImageFile(rIF)
{
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
wxGridSizer *pGridSizer = new wxGridSizer (2);
pGridSizer->Add (new wxStaticText (this, -1, "Standard Deviation Factor"), 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- m_pTextCtrlStdDevFactor = new wxTextCtrl (this, -1, "1.0", wxDefaultPosition, wxSize(100, 25), 0);
+ 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);
pTopSizer->Add (pGridSizer, 1, wxALL, 10);
*pMax = dCenter + dHalfWidth;
*theApp->getLog() << "Setting minimum to " << *pMin << " and maximum to " << *pMax << "\n";
}
+
+double
+DialogAutoScaleParameters::getAutoScaleFactor ()
+{
+ wxString sStddevFactor = m_pTextCtrlStdDevFactor->GetValue();
+ double dValue = 1.;
+ if (! sStddevFactor.ToDouble (&dValue)) {
+ *theApp->getLog() << "Error: Non-numeric Standard Deviation Factor of " << sStddevFactor << "\n";
+ }
+
+ return dValue;
+}