X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=src%2Fviews.cpp;h=68b03759361524e097517c4725b87ba3d5c27741;hp=04adab9fba869a643254e697eae5e55609690544;hb=f7d2b7144f32a7bd157b7689022e62944b82fcc1;hpb=fd1d136a94a6d20013f38d6a997bdfefad0f5e98 diff --git a/src/views.cpp b/src/views.cpp index 04adab9..68b0375 100644 --- a/src/views.cpp +++ b/src/views.cpp @@ -9,7 +9,7 @@ ** 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 @@ -165,7 +165,8 @@ BEGIN_EVENT_TABLE(ImageFileView, wxView) EVT_MENU(IFMENU_FILE_PROPERTIES, ImageFileView::OnProperties) EVT_MENU(IFMENU_VIEW_SCALE_MINMAX, ImageFileView::OnScaleMinMax) EVT_MENU(IFMENU_VIEW_SCALE_AUTO, ImageFileView::OnScaleAuto) -EVT_MENU(IFMENU_PLOT_ROW, ImageFileView::OnPlotRow) +EVT_MENU(IFMENU_COMPARE_IMAGES, ImageFileView::OnCompare) +EVT_MENU(IFMENU_PLOT_ROW, ImageFileView::OnPlotRow) EVT_MENU(IFMENU_PLOT_COL, ImageFileView::OnPlotCol) END_EVENT_TABLE() @@ -240,7 +241,31 @@ ImageFileView::OnScaleMinMax (wxCommandEvent& event) OnUpdate (this, NULL); } } - + +void +ImageFileView::OnCompare (wxCommandEvent& event) +{ + wxList& rListDocs = theApp->getDocManager()->GetDocuments(); + std::vector vecIF; + std::vector vecFilename; + int nCompares = 0; + for (wxNode* pNode = rListDocs.GetFirst(); pNode != NULL; pNode = pNode->GetNext()) { + wxDocument* pDoc = reinterpret_cast(pNode->GetData()); + ImageFileDocument* pIFDoc = dynamic_cast(pDoc); + if (pIFDoc) { + if (pIFDoc->GetFirstView() != this) { + std::string strFilename = pDoc->GetFilename(); + vecIF.push_back (pIFDoc); + vecFilename.push_back (strFilename); + nCompares++; + } + } + } + for (int i = 0; i < nCompares; i++) { + const std::string& s = vecFilename[i]; + *theApp->getLog() << s.c_str() << "\n"; + } +} ImageFileCanvas* ImageFileView::CreateCanvas (wxView *view, wxFrame *parent) @@ -287,6 +312,9 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) plot_menu->Append (IFMENU_PLOT_ROW, "Plot &Row"); plot_menu->Append (IFMENU_PLOT_COL, "Plot &Column"); + wxMenu *compare_menu = new wxMenu; + compare_menu->Append (IFMENU_COMPARE_IMAGES, "&Compare Images"); + wxMenu *help_menu = new wxMenu; help_menu->Append(MAINMENU_HELP_ABOUT, "&About"); @@ -294,7 +322,8 @@ ImageFileView::CreateChildFrame(wxDocument *doc, wxView *view) menu_bar->Append(file_menu, "&File"); menu_bar->Append(view_menu, "&View"); - menu_bar->Append(plot_menu, "&Plot"); + menu_bar->Append(plot_menu, "&Plot"); + menu_bar->Append(compare_menu, "&Compare"); menu_bar->Append(help_menu, "&Help"); subframe->SetMenuBar(menu_bar); @@ -1168,7 +1197,7 @@ EVT_MENU(PLOTMENU_VIEW_SCALE_AUTO, PlotFileView::OnScaleAuto) 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) { } @@ -1304,6 +1333,10 @@ PlotFileView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) m_frame = CreateChildFrame(doc, this); SetFrame(m_frame); + m_bMinSpecified = false; + m_bMaxSpecified = false; + m_dAutoScaleFactor = 1.; + int width, height; m_frame->GetClientSize(&width, &height); m_frame->SetTitle ("Plot File");