/* * AnalysisMainFrame.cpp * * Created on: Apr 21, 2015 * Author: Hovanes Egiyan */ #include "AnalysisMainFrame.hh" ClassImp(AnalysisMainFrame) AnalysisMainFrame::AnalysisMainFrame(const TGWindow *pWindow, const char* name, UInt_t width, UInt_t height, const ScanPlot* plot ) : LogableMainFrame(pWindow,width,height), amfAnaFrame(0), amfPlotFrame(0), amfButtonFrame(0), amfPlot(plot) { this->MakeMenuBar(); cout << "Will set AnalysisMainFrame name to " << name << endl; // Sets window name and shows the main frame SetWindowName( name ); SetName(name); amfPlotFrame = new TGHorizontalFrame( this, width, height ); amfAnaFrame = new AnalysisFrame( amfPlot, "Analysis", amfPlotFrame, width, height ); amfPlotFrame->AddFrame( amfAnaFrame, new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 1) ); this->AddFrame( amfPlotFrame, new TGLayoutHints( kLHintsExpandX | kLHintsExpandY, 2, 2, 2, 1) ); amfButtonFrame = new TGHorizontalFrame( this, width/2.0, height/10.0 ); amfButtonFrame->SetBackgroundColor(0xAA7A52); amfLogButton = new TGTextButton(amfButtonFrame, "Make &Log Entry"); amfLogButton->Connect("Clicked()", "AnalysisMainFrame", this, "MakeLogEntry()"); amfLogButton->SetWidth(700); amfLogButton->SetMinWidth(700); amfButtonFrame->AddFrame( amfLogButton, new TGLayoutHints( kLHintsCenterX, 5, 5, 3, 4) ); amfCloseButton = new TGTextButton(amfButtonFrame, "&Close Window"); amfCloseButton->Connect("Clicked()", "AnalysisMainFrame", this, "CloseWindow()"); amfCloseButton->SetWidth(700); amfButtonFrame->AddFrame( amfCloseButton, new TGLayoutHints( kLHintsCenterX, 5, 5, 3, 4) ); this->AddFrame( amfButtonFrame, new TGLayoutHints( kLHintsCenterX | kLHintsExpandX, 2, 2, 2, 2) ); MapSubwindows(); Resize( GetDefaultSize()); MapWindow(); return; } AnalysisMainFrame::~AnalysisMainFrame() { this->Cleanup(); return; } void AnalysisMainFrame::DrawFrame() { cout << "Drawing plot " << amfPlot->getName() << endl; amfAnaFrame->DrawFrame(); return; }