Commit 5c01a1e8 authored by Jérémie Dudouet's avatar Jérémie Dudouet Committed by Jérémie Dudouet
Browse files

Add Cubix icon, add graph scale

parent 13cbbe65
......@@ -217,6 +217,9 @@ void CXMainWindow::Init()
// Set a name to the main frame
SetWindowName("Cubix Spectra Player");
SetIconPixmap("Cubix.png");
SetIconName("Cubix");
MapSubwindows();
Layout();
Resize(GetDefaultSize());
......@@ -834,6 +837,21 @@ void CXMainWindow::UpdateContextMenus()
for(int i=0 ; i<18 ; i++)
ml->RemoveAt(ml->GetEntries()-1);
/// TGraph ///
cl = gROOT->GetClass("TGraph");
cl->MakeCustomMenuList();
ml = cl->GetMenuList();
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","GraphScale",this,"Float_t,TObject*", 1);
ml->AddAt(n,3);
/// TGraphErrors ///
cl = gROOT->GetClass("TGraphErrors");
cl->MakeCustomMenuList();
ml = cl->GetMenuList();
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","GraphScale",this,"Float_t,TObject*", 1);
ml->AddAt(n,3);
// n = new TClassMenuItem(TClassMenuItem::kPopupSeparator,cl);ml->AddAt(n,ml->GetEntries()-4);
}
......@@ -895,6 +913,17 @@ void CXMainWindow::HistScale(Float_t scaleFact, TObject *c)
RefreshPad();
}
void CXMainWindow::GraphScale(Float_t scaleFact, TObject *c)
{
TGraph *graph = static_cast<TGraph*>(c);
for(int i=0 ; i<graph->GetN() ; i++){
graph->SetPoint(i,graph->GetX()[i],graph->GetY()[i]*scaleFact);
}
RefreshPad();
}
void CXMainWindow::PopUpShowBackground(TObject *c)
{
TH1 *hist = static_cast<TH1*>(c);
......@@ -922,6 +951,8 @@ void CXMainWindow::AddToStoredSpectra(TObject *c)
if(fHist2DPlayer){
if(IsHist2DPlayerEnabled==false)
ToggleTab(IsHist2DPlayerEnabled,M_Hist2DPlayer,fHist2DPlayerTab,fHist2DPlayer->GetName());
else
fMainTab->SetTab(fHist2DPlayer->GetName());
TObject *clone = o->Clone();
if(o->InheritsFrom(TH1::Class_Name()))
......
......@@ -156,6 +156,7 @@ public:
void AddToStoredSpectra(TObject *c);
void PopUpInitGG(TObject *c);
void HistScale(Float_t scaleFact=1, TObject *c=nullptr);
void GraphScale(Float_t scaleFact=1, TObject *c=nullptr);
void HistNorm(TObject *c);
void Rebin2D(Int_t RebinX=2, Int_t RebinY=2, TObject *c=nullptr);
void PopUpEval2DBackground(TObject *c);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment