本文整理汇总了C++中TControlBar::SetButtonWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TControlBar::SetButtonWidth方法的具体用法?C++ TControlBar::SetButtonWidth怎么用?C++ TControlBar::SetButtonWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TControlBar
的用法示例。
在下文中一共展示了TControlBar::SetButtonWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CalibEI
//___________________________________________________________________________________
void CalibEI(const TString &i)
{
//
TControlBar* bar = new TControlBar("vertical", "Intrinsic MWPC-"+i+" calibration");
bar->AddButton("dPhiEI", "CalibEI("+i+",1)", "dPhi shift E wrt I");
bar->AddButton("dPhiEI(Z)", "CalibEI("+i+",2)", "dPhi shift E wrt I as a func of Z");
bar->AddButton("dPhiEI(Phi)", "CalibEI("+i+",3)", "dPhi shift E wrt I as a func of Phi");
bar->AddButton("dPhiEI(Phi,Z)", "CalibEI("+i+",23)", "dPhi shift E wrt I as a func of Phi and Z");
bar->AddButton("dPhiEI(CGW)", "CalibEI("+i+",4)", "dPhi shift E wrt I as a func of CGW");
bar->AddButton("dPhiEI(CGI)", "CalibEI("+i+",5)", "dPhi shift E wrt I as a func of CGI");
bar->AddButton("dPhiEI(CGE)", "CalibEI("+i+",6)", "dPhi shift E wrt I as a func of CGE");
bar->SetButtonWidth(150);
bar->Show();
}
示例2: BrowseHistograms
void BrowseHistograms(const char* histname) {
fHistName=histname;
TSystemDirectory dir(".",".");
TList *files = dir.GetListOfFiles();
if (!files) {
cerr << "Error: No files found in " << fFileDir << endl;
return;
}
files->Sort();
histograms = new TList();
saved = new TList();
c = new TCanvas("canvas","Browse Histograms");
TSystemFile *file;
TIter next(files);
Int_t n=0;
TString fname;
while ((file=(TSystemFile*)next())) {
fname = file->GetName();
if (!file->IsDirectory() && fname.EndsWith(".root")) {
histograms->Add(new TObjString(fname));
n++;
//if(n>10)
// break;
}
}
DrawCurrHistogram();
TControlBar *bar = new TControlBar("vertical", "Control", 10, 10);
bar->AddButton("Next","ProcessClick(1);", "Show next run");
bar->AddButton("Next And Save","NextAndSave();", "Show previous run");
bar->AddButton("Next And Forget","NextAndForget();", "Show previous run");
bar->AddButton("Prev","ProcessClick(-1);", "Show previous run");
bar->AddButton("Print saved","PrintSaved();", "Show previous run");
bar->SetButtonWidth(90);
bar->Show();
}
示例3: CalibMwpcNaI
//___________________________________________________________________________________
void CalibMwpcNaI(const TString &i)
{
//
TControlBar* bar = new TControlBar("vertical", "MWPC-"+i+" wrt NaI");
bar->AddButton("dPhi", "CalibMwpcNaI("+i+",1,0,0,0,0)", "dPhi Mwpc-NaI");
bar->AddButton("dX", "CalibMwpcNaI("+i+",2,0,0,0,0)", "X shift");
bar->AddButton("dY", "CalibMwpcNaI("+i+",3,0,0,0,0)", "Y shift");
bar->AddButton("dZ", "CalibMwpcNaI("+i+",4,0,0,0,0)", "Z shift");
bar->AddButton("dPhi tracks", "CalibMwpcNaI("+i+",5,0,0,0,0)", "dPhi between tracks");
bar->AddButton("dTheta tracks", "CalibMwpcNaI("+i+",6,0,0,0,0)", "dTheta between tracks");
bar->AddButton("dPsi tracks", "CalibMwpcNaI("+i+",7,0,0,0,0)", "dPsi between tracks");
bar->AddButton("dZinter vs Zinter", "CalibMwpcNaI("+i+",8,0,0,0,0)", "");
bar->AddButton("dXinter vs Zinter", "CalibMwpcNaI("+i+",9,0,0,0,0)", "");
bar->AddButton("dYinter vs Zinter", "CalibMwpcNaI("+i+",10,0,0,0,0)", "");
bar->AddButton("dZinter vs PhiInter", "CalibMwpcNaI("+i+",11,0,0,0,0)", "");
bar->AddButton("dXinter vs PhiInter", "CalibMwpcNaI("+i+",12,0,0,0,0)", "");
bar->AddButton("dYinter vs PhiInter", "CalibMwpcNaI("+i+",13,0,0,0,0)", "");
bar->AddButton("dPhiInter vs PhiInter", "CalibMwpcNaI("+i+",14,0,0,0,0)", "");
bar->AddButton("dPhiInter vs Zinter", "CalibMwpcNaI("+i+",15,0,0,0,0)", "");
bar->SetButtonWidth(150);
bar->Show();
}
示例4: CalibMwpc
//___________________________________________________________________________________
void CalibMwpc()
{
//
TControlBar* bar = new TControlBar("vertical", "MWPC-1 wrt MWPC-0 calibration");
bar->AddButton("dPhi", "CalibMwpc(1, 0, 0, 0, 0)", "dPhi MWPC1 - MWPC0");
bar->AddButton("dX", "CalibMwpc(2, 0, 0, 0, 0)", "dX MWPC1 - MWPC0");
bar->AddButton("dY", "CalibMwpc(3, 0, 0, 0, 0)", "dY MWPC1 - MWPC0");
bar->AddButton("dZ", "CalibMwpc(4, 0, 0, 0, 0)", "dZ MWPC1 - MWPC0");
bar->AddButton("dPhi tracks", "CalibMwpc(5, 0, 0, 0, 0)", "dPhi tracks 1-2");
bar->AddButton("dTheta tracks", "CalibMwpc(6, 0, 0, 0, 0)", "dTheta tracks 1-2");
bar->AddButton("dTheta2 tracks2", "CalibMwpc(66, 0, 0, 0, 0)", "dTheta tracks 1-2");
bar->AddButton("dPsi tracks", "CalibMwpc(7, 0, 0, 0, 0)", "dPsi tracks 1-2");
bar->AddButton("dZinter vs Zinter", "CalibMwpc(8, 0, 0, 0, 0)", "dZ vs Zinter");
bar->AddButton("dXinter vs Zinter", "CalibMwpc(9, 0, 0, 0, 0)", "dX vs Zinter");
bar->AddButton("dYinter vs Zinter", "CalibMwpc(10, 0, 0, 0, 0)", "dY vs Zinter");
bar->AddButton("dZinter vs PhiInter", "CalibMwpc(11, 0, 0, 0, 0)", "dZinter vs PhiInter");
bar->AddButton("dXinter vs PhiInter", "CalibMwpc(12, 0, 0, 0, 0)", "dXinter vs PhiInter");
bar->AddButton("dYinter vs PhiInter", "CalibMwpc(13, 0, 0, 0, 0)", "dYinter vs PhiInter");
bar->AddButton("dPhi vs PhiInter", "CalibMwpc(14, 0, 0, 0, 0)", "dPhi vs PhiInter");
bar->AddButton("dPhi vs ZInter", "CalibMwpc(15, 0, 0, 0, 0)", "dPhi vs ZInter");
bar->SetButtonWidth(150);
bar->Show();
}
示例5: GetControlBar
//__________________________________________________________________
void GetControlBar() {
gROOT->Reset();
/*
//Add the tutorials directory to the macro path
//This is necessary in case this macro is executed from another user directory
TString dir = gSystem->UnixPathName(gInterpreter->GetCurrentMacroName());
dir.ReplaceAll("PeakSearch_207Bi_interactive.C","");
dir.ReplaceAll("/./","");
const char *current = gROOT->GetMacroPath();
gROOT->SetMacroPath(Form("%s:%s",current,dir.Data()));
*/
TControlBar *bar = new TControlBar("vertical", "Controls",20,10);
//bar->SetNumberOfColumns(3);
//bar->SetNumberOfRows(7);
bar->AddButton("Root Browser", "new TBrowser;", "Start the ROOT Browser");
bar->AddButton("Open folder", "OpenDataFile();", "Open data folder, provide name on screen");
bar->AddButton("OpenPeaksFile", "OpenPeaksFile()", "Open the output file of the peaks details");
bar->AddButton("Next histogram", "GetNextHistogram(+1)"," Load the next histogram");
bar->AddButton("Prev histogram", "GetNextHistogram(-1)"," Load the previous histogram");
bar->AddButton("Rebin histogram ", "RebinHistogram()"," Rebin the current histogram");
bar->AddButton("Store binning ", "WriteRebin()"," Write the adequate bining of the histogram ");
bar->AddButton("Close", "Close()", "Close the files and exit");
TControlBar *bar2 = new TControlBar("vertical", "Bi207 (keV)",100,100);
//bar2->SetNumberOfColumns(3);
//bar->SetNumberOfRows(7);
bar2->AddButton("XRay 72.8", "AssignEnergy(72.805)", "AssignEnergy this energy : 21.4%");
bar2->AddButton("XRay 75.0", "AssignEnergy(74.969)", "AssignEnergy this energy : 35.7%");
bar2->AddButton("XRay 84.4", "AssignEnergy(84.450)", "AssignEnergy this energy : 4.31%");
bar2->AddButton("XRay 84.9", "AssignEnergy(84.938)", "AssignEnergy this energy : 8.27%");
bar2->AddButton("XRay 87.3", "AssignEnergy(87.300)", "AssignEnergy this energy : 3.02%");
//bar->AddSeparator() ;
//TControlBar *bar3 = new TControlBar("vertical", "Bi207 ICE (keV)",50,50);
//bar2->SetNumberOfColumns(3);
//bar->SetNumberOfRows(7);
bar2->AddButton("K 481.7", "AssignEnergy(481.6935)", "AssignEnergy this energy : 1.515%");
bar2->AddButton("L 553.8", "AssignEnergy(553.8372)", "AssignEnergy this energy : 0.438%");
bar2->AddButton("M 565.8", "AssignEnergy(565.8473)", "AssignEnergy this energy : 0.147%");
bar2->AddButton("K 975.6", "AssignEnergy(975.651)", "AssignEnergy this energy : 7.03%");
bar2->AddButton("L 1047.9", "AssignEnergy(1047.795)", "AssignEnergy this energy : 1.84%");
bar2->AddButton("M 1059.8", "AssignEnergy(1059.805)", "AssignEnergy this energy : 0.54%");
bar->SetButtonWidth(200);
bar->Show();
bar2->SetButtonWidth(200);
bar2->SetTextColor("blue");
//bar2->SetFont("-adobe-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-1");
bar2->Show();
/*
bar3->SetButtonWidth(100);
bar3->SetTextColor("red");
bar3->SetFont("-adobe-helvetica-bold-r-*-*-16-*-*-*-*-*-iso8859-1");
bar3->Show();
*/
gROOT->SaveContext();
}