#include "TMDisplayingFastorAll.h"
#include "TMHistogrammingFastorAll.h"
#include "TMMainFrame.h"
#include "TMControlSPD.h"
#include "SPDMood.h"
#include <TSystem.h>
#include <TCanvas.h>
#include <TGStatusBar.h>

ClassImp(TMDisplayingFastorAll)

//_____________________________________________________________________
TMDisplayingFastorAll::TMDisplayingFastorAll(const Char_t *frameName, const TGWindow *p, UInt_t width, UInt_t height, TMHistogramming *hist, UInt_t id, UInt_t plotNr, UInt_t cloneId) :
  TMDisplaying(frameName,p,width,height,hist,id,plotNr,cloneId,kTRUE)
{
  gClient->GetColorByName("green", green);
  gClient->GetColorByName("gray", gray);

  CreateTopFrame();
  CreateStatusFrame();
  CreateBottomFrame();

  MapSubwindows();
  Resize();
  MapWindow();

  TCanvas *canv = fTheCanvas->GetCanvas();
  fHist->Draw(canv);
  Update();
}
//_____________________________________________________________________
TMDisplayingFastorAll::~TMDisplayingFastorAll() {}
//_____________________________________________________________________
void TMDisplayingFastorAll::CreateStatusFrame() {
  fTotalStatus = new TGStatusBar(this, fWidth, 27, kHorizontalFrame | kFixedSize);
  fTotalStatus->Draw3DCorner(kFALSE);
  AddFrame(fTotalStatus, new TGLayoutHints(kLHintsExpandX, 0,0,0,0));
}
//_____________________________________________________________________
void TMDisplayingFastorAll::Update() {
  ULong_t nrsignals = ((TMHistogrammingFastorAll*)fHist)->GetTotalNumberOfSignals();
  TString totalmsg;
  totalmsg = Form("FastOR Signals For Full Detector: %ld",nrsignals);
  fTotalStatus->SetText(totalmsg.Data(),0);
  TMDisplaying::Update();
}
