+#else
+#include <sstream_subst>
+#endif
+
+
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// StringValueAndTitleListBox
+///////////////////////////////////////////////////////////////////////
+
+StringValueAndTitleListBox::StringValueAndTitleListBox (wxDialog* pParent, int nChoices, const char* const aszTitle[], const char* const aszValue[])
+: wxListBox ()
+{
+ wxString* psTitle = new wxString [nChoices];
+ for (int i = 0; i < nChoices; i++)
+ psTitle[i] = aszTitle[i];
+
+ Create (pParent, -1, wxDefaultPosition, wxSize(-1,-1), nChoices, psTitle, wxLB_SINGLE | wxLB_NEEDED_SB);
+
+ m_ppszValues = aszValue;
+ delete [] psTitle;
+};
+
+const char*
+StringValueAndTitleListBox::getSelectionStringValue () const
+{
+ return m_ppszValues[GetSelection()];
+}
+
+StringValueAndTitleRadioBox::StringValueAndTitleRadioBox (wxDialog* pParent, const wxString& strTitle, int nChoices, const char* const aszTitle[], const char* const aszValue[])
+: wxRadioBox ()
+{
+ wxString* psTitle = new wxString [nChoices];
+ for (int i = 0; i < nChoices; i++)
+ psTitle[i] = aszTitle[i];
+
+ Create (pParent, -1, strTitle, wxDefaultPosition, wxDefaultSize, nChoices, psTitle, 1, wxRA_SPECIFY_COLS);
+
+ m_ppszValues = aszValue;
+ delete [] psTitle;
+};
+
+const char*
+StringValueAndTitleRadioBox::getSelectionStringValue () const
+{
+ return m_ppszValues[GetSelection()];
+}
+
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// DialogGetPhantom
+///////////////////////////////////////////////////////////////////////
+
+DialogGetPhantom::DialogGetPhantom (wxWindow* pParent, int iDefaultPhantom)
+: wxDialog (pParent, -1, "Select Phantom", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, "Select Phantom"), 0, wxCENTER | wxALL, 5);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ m_pRadioBoxPhantom = new StringValueAndTitleRadioBox (this, _T("Phantom"), Phantom::getPhantomCount(), Phantom::getPhantomTitleArray(), Phantom::getPhantomNameArray());
+ m_pRadioBoxPhantom->SetSelection (iDefaultPhantom);
+ pTopSizer->Add (m_pRadioBoxPhantom, 0, wxALL | wxALIGN_CENTER);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
+ wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_PHANTOM);
+ pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
+
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+ pButtonOk->SetDefault();
+
+ SetAutoLayout (true);
+ SetSizer (pTopSizer);
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+const char*
+DialogGetPhantom::getPhantom()
+{
+ return m_pRadioBoxPhantom->getSelectionStringValue();
+}
+
+
+///////////////////////////////////////////////////////////////////////
+// CLASS IMPLEMENTATION
+// DialogGetComparisonImage
+///////////////////////////////////////////////////////////////////////
+
+DialogGetComparisonImage::DialogGetComparisonImage (wxWindow* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)
+{
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
+
+ pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);
+
+ int iNImages = m_rVecIF.size();
+ wxString* pstrImages = new wxString [iNImages];
+ for (int i = 0; i < iNImages; i++) {
+ ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());
+ if (pView)
+ pstrImages[i] = pView->getFrame()->GetTitle();
+ }
+
+ m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);
+ delete [] pstrImages;
+
+ m_pListBoxImageChoices->SetSelection (0);
+ pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+
+ if (bShowMakeDifference) {
+ m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");
+ m_pMakeDifferenceImage->SetValue (FALSE);
+ pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);
+ } else
+ m_pMakeDifferenceImage = NULL;
+
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);
+
+ wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
+ wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ CTSimHelpButton* pButtonHelp = new CTSimHelpButton (this, IDH_DLG_COMPARISON);
+ pButtonSizer->Add (pButtonHelp, 0, wxEXPAND | wxALL, 10);
+
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
+ pButtonOk->SetDefault();
+
+ SetAutoLayout (true);
+ SetSizer (pTopSizer);
+ pTopSizer->Fit (this);
+ pTopSizer->SetSizeHints (this);
+}
+
+ImageFileDocument*
+DialogGetComparisonImage::getImageFileDocument()
+{
+ return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];
+}
+
+bool
+DialogGetComparisonImage::getMakeDifferenceImage()
+{
+ if (m_pMakeDifferenceImage)
+ return m_pMakeDifferenceImage->GetValue();
+ else
+ return false;
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// CLASS DiaglogPreferences Implementation
+/////////////////////////////////////////////////////////////////////