+///////////////////////////////////////////////////////////////////////\r
+// CLASS IMPLEMENTATION\r
+// DialogGetComparisonImage\r
+///////////////////////////////////////////////////////////////////////\r
+\r
+DialogGetComparisonImage::DialogGetComparisonImage (wxFrame* pParent, const char* const pszTitle, const std::vector<ImageFileDocument*>& rVecIF, bool bShowMakeDifference)\r
+: wxDialog (pParent, -1, pszTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxCAPTION), m_rVecIF(rVecIF)\r
+{\r
+ wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);\r
+ \r
+ pTopSizer->Add (new wxStaticText (this, -1, pszTitle), 0, wxALIGN_CENTER | wxALL, 5);\r
+ \r
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxALL, 5);\r
+ \r
+ int iNImages = m_rVecIF.size();\r
+ wxString* pstrImages = new wxString [iNImages];\r
+ for (int i = 0; i < iNImages; i++) {\r
+ ImageFileView* pView = dynamic_cast<ImageFileView*>(m_rVecIF[i]->GetFirstView());\r
+ if (pView)\r
+ pstrImages[i] = pView->getFrame()->GetTitle();\r
+ }\r
+\r
+ m_pListBoxImageChoices = new wxListBox (this, -1, wxDefaultPosition, wxDefaultSize, iNImages, pstrImages, wxLB_SINGLE);\r
+ delete [] pstrImages;\r
+\r
+ m_pListBoxImageChoices->SetSelection (0);\r
+ pTopSizer->Add (m_pListBoxImageChoices, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
+ \r
+ if (bShowMakeDifference) {\r
+ m_pMakeDifferenceImage = new wxCheckBox (this, -1, "Make Difference Image");\r
+ m_pMakeDifferenceImage->SetValue (FALSE);\r
+ pTopSizer->Add (m_pMakeDifferenceImage, 0, wxALL | wxALIGN_CENTER | wxEXPAND);\r
+ } else\r
+ m_pMakeDifferenceImage = NULL;\r
+\r
+ pTopSizer->Add (new wxStaticLine (this, -1, wxDefaultPosition, wxSize(3,3), wxHORIZONTAL), 0, wxEXPAND | wxALL, 5);\r
+ \r
+ wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);\r
+ wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");\r
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");\r
+ pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);\r
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);\r
+ \r
+ pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);\r
+ \r
+ SetAutoLayout (true);\r
+ SetSizer (pTopSizer);\r
+ pTopSizer->Fit (this);\r
+ pTopSizer->SetSizeHints (this);\r
+}\r
+\r
+ImageFileDocument*\r
+DialogGetComparisonImage::getImageFileDocument(void)\r
+{\r
+ return m_rVecIF[ m_pListBoxImageChoices->GetSelection() ];\r
+}\r
+\r
+bool\r
+DialogGetComparisonImage::getMakeDifferenceImage()\r
+{\r
+ if (m_pMakeDifferenceImage)\r
+ return m_pMakeDifferenceImage->GetValue();\r
+ else\r
+ return false;\r
+}\r
+\r
+\r