** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.34 2000/12/20 20:08:48 kevin Exp $
+** $Id: views.cpp,v 1.35 2000/12/21 03:40: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
EVT_MENU(IFMENU_FILE_PROPERTIES, ImageFileView::OnProperties)
EVT_MENU(IFMENU_VIEW_SCALE_MINMAX, ImageFileView::OnScaleMinMax)
EVT_MENU(IFMENU_VIEW_SCALE_AUTO, ImageFileView::OnScaleAuto)\r
-EVT_MENU(IFMENU_PLOT_ROW, ImageFileView::OnPlotRow)
+EVT_MENU(IFMENU_COMPARE_IMAGES, ImageFileView::OnCompare)\r
+EVT_MENU(IFMENU_PLOT_ROW, ImageFileView::OnPlotRow)\r
EVT_MENU(IFMENU_PLOT_COL, ImageFileView::OnPlotCol)\r
END_EVENT_TABLE()
OnUpdate (this, NULL);
}
}
-
+\r
+void\r
+ImageFileView::OnCompare (wxCommandEvent& event)\r
+{\r
+ wxList& rListDocs = theApp->getDocManager()->GetDocuments();\r
+ std::vector<ImageFileDocument*> vecIF;\r
+ std::vector<std::string> vecFilename;\r
+ int nCompares = 0;\r
+ for (wxNode* pNode = rListDocs.GetFirst(); pNode != NULL; pNode = pNode->GetNext()) {\r
+ wxDocument* pDoc = reinterpret_cast<wxDocument*>(pNode->GetData());\r
+ ImageFileDocument* pIFDoc = dynamic_cast<ImageFileDocument*>(pDoc);\r
+ if (pIFDoc) {\r
+ if (pIFDoc->GetFirstView() != this) {\r
+ std::string strFilename = pDoc->GetFilename();\r
+ vecIF.push_back (pIFDoc);\r
+ vecFilename.push_back (strFilename);\r
+ nCompares++;\r
+ }\r
+ }\r
+ }\r
+ for (int i = 0; i < nCompares; i++) {\r
+ const std::string& s = vecFilename[i];\r
+ *theApp->getLog() << s.c_str() << "\n";\r
+ }\r
+}
ImageFileCanvas*
ImageFileView::CreateCanvas (wxView *view, wxFrame *parent)
plot_menu->Append (IFMENU_PLOT_ROW, "Plot &Row");\r
plot_menu->Append (IFMENU_PLOT_COL, "Plot &Column");\r
+ wxMenu *compare_menu = new wxMenu;\r
+ compare_menu->Append (IFMENU_COMPARE_IMAGES, "&Compare Images");\r
+\r
wxMenu *help_menu = new wxMenu;
help_menu->Append(MAINMENU_HELP_ABOUT, "&About");
menu_bar->Append(file_menu, "&File");
menu_bar->Append(view_menu, "&View");\r
- menu_bar->Append(plot_menu, "&Plot");
+ menu_bar->Append(plot_menu, "&Plot");\r
+ menu_bar->Append(compare_menu, "&Compare");
menu_bar->Append(help_menu, "&Help");
subframe->SetMenuBar(menu_bar);
END_EVENT_TABLE()
PlotFileView::PlotFileView(void)
-: wxView(), m_canvas(NULL), m_frame(NULL), m_bMinSpecified(false), m_bMaxSpecified(false)
+: wxView(), m_canvas(NULL), m_frame(NULL)
{
}
m_frame = CreateChildFrame(doc, this);
SetFrame(m_frame);
+ m_bMinSpecified = false;\r
+ m_bMaxSpecified = false;\r
+ m_dAutoScaleFactor = 1.;\r
+\r
int width, height;
m_frame->GetClientSize(&width, &height);
m_frame->SetTitle ("Plot File");