Commit ea53e003 authored by Jérémie Dudouet's avatar Jérémie Dudouet
Browse files

Update Menu list when right clicking on histograms

parent c38c7d25
Pipeline #53978 passed with stage
in 5 minutes and 23 seconds
......@@ -926,6 +926,9 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Copy","CopyObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Cut","CutObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Undraw","UndrawObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupSeparator,cl); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Add to Stored spectra","AddToStoredSpectra",this,"TObject *",0); ml->AddFirst(n);
......@@ -934,13 +937,11 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Show Background","PopUpShowBackground",this,"TObject *",0); ml->AddFirst(n);
for(int i=0 ; i<6 ; i++) ml->RemoveAt(ml->GetEntries()-1);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-9);
ml->RemoveAt(ml->GetEntries()-13);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-14);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddAt(n,5);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddAt(n,5);
ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-4);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-10);
ml->RemoveAt(ml->GetEntries()-15);
for(int i=0 ; i<3 ; i++) ml->RemoveAt(ml->GetEntries()-16);
/// TH1D///
cl = gROOT->GetClass("TH1D");
......@@ -950,6 +951,8 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Copy","CopyObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Cut","CutObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Undraw","UndrawObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupSeparator,cl); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Add to Stored spectra","AddToStoredSpectra",this,"TObject *",0); ml->AddFirst(n);
......@@ -958,13 +961,11 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Show Background","PopUpShowBackground",this,"TObject *",0); ml->AddFirst(n);
for(int i=0 ; i<6 ; i++) ml->RemoveAt(ml->GetEntries()-1);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-9);
ml->RemoveAt(ml->GetEntries()-13);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-14);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddAt(n,5);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddAt(n,5);
ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-4);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-10);
ml->RemoveAt(ml->GetEntries()-15);
for(int i=0 ; i<3 ; i++) ml->RemoveAt(ml->GetEntries()-16);
/// TH1Proj ///
cl = gROOT->GetClass("CXTH1Proj");
......@@ -973,7 +974,8 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Copy","CopyObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Undraw","UndrawObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupSeparator,cl); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Add to Stored spectra","AddToStoredSpectra",this,"TObject *",0); ml->AddFirst(n);
......@@ -982,13 +984,11 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Show Background","PopUpShowBackground",this,"TObject *",0); ml->AddFirst(n);
for(int i=0 ; i<6 ; i++) ml->RemoveAt(ml->GetEntries()-1);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-9);
ml->RemoveAt(ml->GetEntries()-13);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-14);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddAt(n,5);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddAt(n,5);
ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-4);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-10);
ml->RemoveAt(ml->GetEntries()-15);
for(int i=0 ; i<3 ; i++) ml->RemoveAt(ml->GetEntries()-16);
/// CXRadCubeTH1Proj ///
cl = gROOT->GetClass("CXRadCubeTH1Proj");
......@@ -997,7 +997,8 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Copy","CopyObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Undraw","UndrawObject",fCanvas,"TObject *",0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupSeparator,cl); ml->AddFirst(n);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Add to Stored spectra","AddToStoredSpectra",this,"TObject *",0); ml->AddFirst(n);
......@@ -1006,13 +1007,11 @@ void CXMainWindow::UpdateContextMenus()
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl, "Show Background","PopUpShowBackground",this,"TObject *",0); ml->AddFirst(n);
for(int i=0 ; i<6 ; i++) ml->RemoveAt(ml->GetEntries()-1);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-9);
ml->RemoveAt(ml->GetEntries()-13);
for(int i=0 ; i<4 ; i++) ml->RemoveAt(ml->GetEntries()-14);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Normalize","HistNorm",this,"TObject*", 0); ml->AddAt(n,5);
n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,cl,"Scale","HistScale",this,"Float_t,TObject*", 1); ml->AddAt(n,5);
ml->RemoveAt(ml->GetEntries()-3);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-4);
for(int i=0 ; i<2 ; i++) ml->RemoveAt(ml->GetEntries()-10);
ml->RemoveAt(ml->GetEntries()-15);
for(int i=0 ; i<3 ; i++) ml->RemoveAt(ml->GetEntries()-16);
/// TH2F ///
cl = gROOT->GetClass("TH2F");
......
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