void arrow_standalone() { TEveManager::Create(kFALSE); // ---------------------------------------------------------------------- TGMainFrame* mf = new TGMainFrame(gClient->GetRoot(), 800, 400, kHorizontalFrame); mf->SetWindowName("Arrow Foo"); // ---------------------------------------------------------------------- TGCompositeFrame* evf = new TGCompositeFrame(mf, 400, 400); mf->AddFrame(evf, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY)); TGLEmbeddedViewer* ev = new TGLEmbeddedViewer(evf); evf->AddFrame(ev->GetFrame(), new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY)); TEveViewer* eve_v = new TEveViewer("YourViewer"); eve_v->SetGLViewer(ev, ev->GetFrame()); eve_v->IncDenyDestroy(); eve_v->AddScene(gEve->GetEventScene()); gEve->GetViewers()->AddElement(eve_v); // ---------------------------------------------------------------------- // To create embedded canvas ... no menus on top. // TRootEmbeddedCanvas* ec = // new TRootEmbeddedCanvas("EmbeddedCanvas", mf, 400, 400); // mf->AddFrame(ec, new TGLayoutHints(kLHintsNormal | // kLHintsExpandX | kLHintsExpandY)); // -------------------------------- // This one is tricky - must be after embedded canvas but before std canvas! mf->MapSubwindows(); // -------------------------------- // To create full canvas with menus. mf->SetEditable(); TCanvas* c = new TCanvas("Foo", "Bar", 400, 400); mf->SetEditable(kFALSE); // ---------------------------------------------------------------------- mf->Layout(); mf->MapWindow(); // ---------------------------------------------------------------------- // Populate the viewer ... here we just call the arrow.C. TEveUtil::Macro("arrow.C"); }
void tableWidgetTest() { int width=440; int height=400; // Create a main frame TGMainFrame *fMain = new TGMainFrame(gClient->GetRoot(),width,height); TGCompositeFrame *tFrame = new TGCompositeFrame(fMain, width, height); TGLayoutHints *tFrameHints = new TGLayoutHints(kLHintsTop|kLHintsLeft|kLHintsExpandX|kLHintsExpandY); fMain->AddFrame(tFrame,tFrameHints); std::vector<std::string> columns; columns.push_back("one long title"); columns.push_back("two"); columns.push_back("another long one"); columns.push_back("four"); std::vector<std::string> data; for(int iRow =1; iRow < 1000; ++iRow) { for(int iCol =1; iCol < 5; ++iCol) { std::stringstream s; s<<iRow<<" "<<iCol; data.push_back(s.str()); } } FWTestTableManager* tableM = new FWTestTableManager(columns,data); FWTableWidget* table = new FWTableWidget(tableM, tFrame); table->Connect("rowClicked(Int_t,Int_t,Int_t)","FWTestTableManager",tableM,"rowClicked(Int_t,Int_t,Int_t)"); table->sort(0,true); tFrame->AddFrame(table,tFrameHints); fMain->SetWindowName("Header Test"); fMain->MapSubwindows(); fMain->Layout(); fMain->MapWindow(); }
Int_t THaScalerGui::InitPlots() { // Initialize plots (xscaler style) if (!scaler) { cout << "THaScalerGui::ERROR: no scaler defined... cannot init."<<endl; return -1; } InitPages(); yboxsize = new Int_t[SCAL_NUMBANK]; occupied = new Int_t[SCAL_NUMBANK]; memset(occupied, 0, SCAL_NUMBANK*sizeof(Int_t)); fDataBuff = new TGTextBuffer[SCAL_NUMBANK*SCAL_NUMCHAN]; pair<Int_t, TGTextEntry *> txtpair; pair<Int_t, TNtuple *> ntupair; char string_ntup[]="UpdateNum:Count:Rate:RateI"; iloop = 0; lastsize = YBOXSMALL; showselect = SHOWRATE; TGTab *fTab = new TGTab(this, 600, 800); TGLayoutHints *fLayout = new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 10, 10, 10, 10); TGLayoutHints *fLayout2 = new TGLayoutHints(kLHintsNormal ,10, 10, 10, 10); if (!scaler->GetDataBase()) { cout << "THaScalerGui::WARNING: no database. Will use defaults..."<<endl; } Int_t crate = scaler->GetCrate(); std::string sdirect; for (Int_t ipage = 0; ipage < npages; ipage++) { Int_t slot = slotmap[ipage]; char cpage[100]; sprintf(cpage,"%d",ipage); std::string spage = cpage; sdirect = "none"; if (scaler->GetDataBase()) sdirect = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-tabs", spage.c_str()); if (sdirect != "none") spage = sdirect; TGCompositeFrame *tgcf = fTab->AddTab(spage.c_str()); std::string slayout = "none"; if (scaler->GetDataBase()) slayout = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-layout", (std::string)cpage); UInt_t pos = slayout.find("x"); int nrow = 8; int ncol = 4; // defaults if (pos != std::string::npos) { nrow = atoi(slayout.substr(0,pos).c_str()); ncol = atoi(slayout.substr(pos+1,slayout.length()).c_str()); } yboxsize[ipage] = YBOXSMALL; if (nrow * ncol > 16) yboxsize[ipage] = YBOXBIG; GCValues_t gval; gval.fMask = kGCForeground; gClient->GetColorByName("black", gval.fForeground); GContext_t labelgc = gVirtualX->CreateGC(gClient->GetRoot()->GetId(), &gval); TGLabel *fLpage; std::string pagename = "none"; if (scaler->GetDataBase()) pagename = scaler->GetDataBase()->GetStringDirectives(crate, "xscaler-pagename", (std::string)cpage); if (pagename == "none") pagename = spage; fLpage = new TGLabel(tgcf, new TGString(pagename.c_str()),labelgc); tgcf->AddFrame(fLpage,fLayout); occupied[ipage] = nrow; Int_t chan = 0; for (int row = 0; row < nrow; row++) { // rows TGCompositeFrame *fr; fr = new TGCompositeFrame(tgcf, 50, 0, kHorizontalFrame); TGHorizontalLayout *fLhorz; fLhorz = new TGHorizontalLayout(fr); fr->SetLayoutManager(fLhorz); for (int col = 0; col < ncol; col++) { // columns int index = ipage*SCAL_NUMCHAN + ncol*row+col; ntupair.first = index; char nname[10]; sprintf(nname,"%d",index); ntupair.second = new TNtuple(nname,"scaler",string_ntup); fDataHistory.insert(ntupair); TGTextButton *fButton1; char cbutton[100]; std::string buttonname = "none"; if (scaler->GetDataBase()) { std::vector<std::string> strb = scaler->GetDataBase()->GetShortNames(crate,slot,chan); buttonname = strb[0]; } if (buttonname == "none") { sprintf(cbutton,"%d ==>",ncol*row+col+1); } else { sprintf(cbutton,buttonname.c_str()); } fButton1 = new TGTextButton(fr,new TGHotString(cbutton), SCAL_NUMBANK*SCAL_NUMCHAN + OFFSET_HIST + index); fr->AddFrame(fButton1, fLayout); fButton1->Associate(this); txtpair.first = index; txtpair.second = new TGTextEntry(fr,&fDataBuff[index]); fDataEntry.insert(txtpair); fr->AddFrame(fDataEntry[index],fLayout); chan++; } tgcf->AddFrame(fr,fLayout); } } AddFrame(fTab,new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,0,0,0,0)); TGGroupFrame *fGb = new TGGroupFrame(this, new TGString("Click channel button for history plot. Click ``Show Rates'' or ``Show Counts, etc''")); TGCompositeFrame *fGCb = new TGCompositeFrame(fGb, 10, 0, kHorizontalFrame); TGHorizontalLayout *fLhorzb = new TGHorizontalLayout(fGCb); fGCb->SetLayoutManager(fLhorzb); TGHotString *fLabel = new TGHotString("HELP"); TGTextButton *fHelp = new TGTextButton(fGCb,fLabel,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_HELP); fGCb->AddFrame(fHelp, fLayout2); fHelp->Associate(this); fLabel = new TGHotString("QUIT"); TGTextButton *fQuit = new TGTextButton(fGCb,fLabel,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_QUIT); fGCb->AddFrame(fQuit, fLayout2); fQuit->Associate(this); TGLabel *fGlabel2 = new TGLabel(fGCb, new TGString(" ")); fGCb->AddFrame(fGlabel2, fLayout); TGHotString *fHString1 = new TGHotString("Show Rates"); fRateSelect = new TGCheckButton(fGCb,fHString1,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_RATE); fGCb->AddFrame(fRateSelect, fLayout); fRateSelect->Associate(this); fRateSelect->SetState(kButtonDown); TGHotString *fHString2 = new TGHotString("Show Counts"); fCountSelect = new TGCheckButton(fGCb, fHString2,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_COUNT); fGCb->AddFrame(fCountSelect, fLayout); fCountSelect->Associate(this); fCountSelect->SetState(kButtonUp); TGHotString *fHString3 = new TGHotString("Norm-by-Current"); fNormISelect = new TGCheckButton(fGCb,fHString3,SCAL_NUMBANK*SCAL_NUMCHAN+OFFSET_NORMI); fGCb->AddFrame(fNormISelect, fLayout); fNormISelect->Associate(this); fNormISelect->SetState(kButtonUp); fGb->AddFrame(fGCb,fLayout2); TGLayoutHints *fL1 = new TGLayoutHints(kLHintsNormal | kLHintsExpandX , 10, 10, 10, 10); AddFrame(fGb, fL1); MapSubwindows(); Layout(); SetWindowName("HALL A SCALER DATA"); SetIconName("Scalers"); MapWindow(); Resize(900,yboxsize[0]); lastsize = yboxsize[0]; return 0; };
//______________________________________________________________________________ Bool_t ArgusWindow::CreateTabs() { ArgusTab *tab; Int_t iTab; const Int_t nTabs = fTabObjects->GetEntriesFast(); TGCompositeFrame *tabFrame; Int_t newID; TGTab *parentTab; TGTab *newTab; TGListTreeItem *item; ROMEString command = ""; Int_t iParent; // Bool_t isSwitch; for (iTab = 0; iTab < nTabs; iTab++) { tab = GetTabObjectAt(iTab); // isSwitch = tab->IsSwitch(); // switch off the tab if its ancestor is off iParent = fParentIndex[iTab]; while (iParent != -1) { if (! GetTabObjectAt(iParent)->IsSwitch()) { tab->SetSwitch(kFALSE); break; } iParent = fParentIndex[iParent]; } // cout << "CreateTabs : " << iTab << " " << tab->IsSwitch() << " " << isSwitch << " " << tab->GetName() << endl; if (!tab->IsSwitch()) { continue; } if (!fListTreeView) { parentTab = (fParentIndex[iTab]==-1) ? fTab : static_cast<TGTab*>(fTGTab->At(fParentIndex[iTab])); if (fNumberOfChildren[iTab]<=0) { if (fTabWindow) { if (parentTab) { newID = parentTab->GetNumberOfTabs() + ( (fParentIndex[iTab]==-1) ? 0 : 1000*fParentIndex[iTab] ); tabFrame = parentTab->AddTab(tab->GetTitle()); tab->ReparentWindow(tabFrame, 60, 20); tab->ArgusInit(); tab->SetID(newID); tabFrame->AddFrame(tab, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY , 0, 0, 0, 0)); } } } else { newID = parentTab->GetNumberOfTabs() + ( (fParentIndex[iTab]==-1) ? 0 : 1000*fParentIndex[iTab] ); tabFrame = parentTab->AddTab(tab->GetTitle()); tab->ReparentWindow(tabFrame, 60, 20); tab->ArgusInit(); tab->SetID(newID); newTab = new TGTab(tabFrame); command.SetFormatted("gAnalyzer->GetWindow()->ProcessMessage($MSG, $PARM1 + %d, $PARM2)", iTab*1000); newTab->SetCommand(command.Data()); tabFrame->AddFrame(newTab, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 0, 0, 1, 1)); fTGTab->AddAt(newTab, iTab); } } else { if (fTabWindow) { // we don't have listtrees for sub-windows item = (fParentIndex[iTab]==-1) ? 0 : fListTreeItem[fParentIndex[iTab]]; fListTreeItem[iTab] = fListTree->AddItem(item, tab->GetTitle()); fListTree->OpenItem(fListTreeItem[iTab]); } if (fNumberOfChildren[iTab]<=0) { tab->ReparentWindow(fMainFrame, 60, 20); tab->ArgusInit(); fMainFrame->AddFrame(tab, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY , 0, 0, 0, 0)); if (!fTabWindow) { return kTRUE; } } else { tab->ArgusInit(); } } } return kTRUE; }
MyMainFrame::MyMainFrame(const TGWindow *p, UInt_t w, UInt_t h) : TGMainFrame(p, w, h) { // Create horizontal splitter TGVerticalFrame *fVf = new TGVerticalFrame(this, 10, 10); TGHorizontalFrame *fH1 = new TGHorizontalFrame(fVf, 10, 50, kFixedHeight); TGHorizontalFrame *fH2 = new TGHorizontalFrame(fVf, 10, 10); TGCompositeFrame *fFtop = new TGCompositeFrame(fH1, 10, 10, kSunkenFrame); TGCompositeFrame *fFbottom = new TGCompositeFrame(fH2, 10, 10, kSunkenFrame); TGLabel *fLtop = new TGLabel(fFtop, "Top Frame"); TGLabel *fLbottom = new TGLabel(fFbottom, "Bottom Frame"); fFtop->AddFrame(fLtop, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 0, 0)); fFbottom->AddFrame(fLbottom, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 0, 0, 0)); fH1->AddFrame(fFtop, new TGLayoutHints(kLHintsTop | kLHintsExpandY | kLHintsExpandX, 0, 0, 1, 2)); fH2->AddFrame(fFbottom, new TGLayoutHints(kLHintsTop | kLHintsExpandY | kLHintsExpandX, 0, 0, 1, 2)); fH1->Resize(fFtop->GetDefaultWidth(), fH1->GetDefaultHeight()+20); fH2->Resize(fFbottom->GetDefaultWidth(), fH2->GetDefaultHeight()+20); fVf->AddFrame(fH1, new TGLayoutHints(kLHintsTop | kLHintsExpandX)); TGHSplitter *hsplitter = new TGHSplitter(fVf,2,2); hsplitter->SetFrame(fH1, kTRUE); fVf->AddFrame(hsplitter, new TGLayoutHints(kLHintsTop | kLHintsExpandX)); fVf->AddFrame(fH2, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); // button frame TGVerticalFrame *hframe = new TGVerticalFrame(this, 10, 10); TGCompositeFrame *cframe2 = new TGCompositeFrame(hframe, 170, 50, kHorizontalFrame | kFixedWidth); TGTextButton *save = new TGTextButton(cframe2, "&Save"); cframe2->AddFrame(save, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 3, 2, 2, 2)); save->Connect("Clicked()", "MyMainFrame", this, "DoSave()"); save->SetToolTipText("Click on the button to save the application as C++ macro"); TGTextButton *exit = new TGTextButton(cframe2, "&Exit ","gApplication->Terminate(0)"); cframe2->AddFrame(exit, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 2, 2)); hframe->AddFrame(cframe2, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 1)); AddFrame(fVf, new TGLayoutHints(kLHintsRight | kLHintsExpandX | kLHintsExpandY)); AddFrame(hframe, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 1)); // What to clean up in dtor SetCleanup(kDeepCleanup); // Set a name to the main frame SetWindowName("Horizontal Splitter"); SetWMSizeHints(300, 250, 600, 600, 0, 0); MapSubwindows(); Resize(GetDefaultSize()); MapWindow(); }
void gossipGUI::BuildSiPMFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildSiPMFrame( TGFrame *parentFrame )" << endl; sipmFrame = new TGCompositeFrame(parentFrame, 60, 20, kHorizontalFrame); ///Parameters TGGroupFrame *parameterGroupFrame = new TGGroupFrame(sipmFrame, "Parameters", kHorizontalFrame); sipmFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryPDE = new TGNumberEntry(parametersEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPDE, layout1); labelPDE = new TGLabel(parametersLabelsFrame,"PDE [%]"); parametersLabelsFrame->AddFrame(labelPDE, layout2); entryGain = new TGNumberEntry(parametersEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryGain, layout1); labelGain = new TGLabel(parametersLabelsFrame,"Gain [1E4]"); parametersLabelsFrame->AddFrame(labelGain, layout2); entryENF = new TGNumberEntry(parametersEntriesFrame,2,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryENF, layout1); labelENF = new TGLabel(parametersLabelsFrame,"Gain fluct. [1E4]"); parametersLabelsFrame->AddFrame(labelENF, layout2); entryTau_dr = new TGNumberEntry(parametersEntriesFrame,2000,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_dr, layout1); labelTau_dr = new TGLabel(parametersLabelsFrame,"DR time-const. [ns]"); parametersLabelsFrame->AddFrame(labelTau_dr, layout2); entryPap1 = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPap1, layout1); labelPap1 = new TGLabel(parametersLabelsFrame,"AP prob. (slow) [%]"); parametersLabelsFrame->AddFrame(labelPap1, layout2); entryTau_ap1 = new TGNumberEntry(parametersEntriesFrame,200,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_ap1, layout1); labelTau_ap1 = new TGLabel(parametersLabelsFrame,"AP time-const. (slow) [ns]"); parametersLabelsFrame->AddFrame(labelTau_ap1, layout2); entryPap2 = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPap2, layout1); labelPap2 = new TGLabel(parametersLabelsFrame,"AP prob. (fast) [%]"); parametersLabelsFrame->AddFrame(labelPap2, layout2); entryTau_ap2 = new TGNumberEntry(parametersEntriesFrame,50,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_ap2, layout1); labelTau_ap2 = new TGLabel(parametersLabelsFrame,"AP time-const. (fast) [ns]"); parametersLabelsFrame->AddFrame(labelTau_ap2, layout2); entryPx = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELLimitMinMax,0,100); parametersEntriesFrame->AddFrame(entryPx, layout1); labelPx = new TGLabel(parametersLabelsFrame,"CT prob. [%]"); parametersLabelsFrame->AddFrame(labelPx, layout2); entryEN = new TGNumberEntry(parametersEntriesFrame,2,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryEN, layout1); labelEN = new TGLabel(parametersLabelsFrame,"Pedestal noise"); parametersLabelsFrame->AddFrame(labelEN, layout2); entryTau_rec = new TGNumberEntry(parametersEntriesFrame,10,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryTau_rec, layout1); labelTau_rec = new TGLabel(parametersLabelsFrame,"Recovery time [ns]"); parametersLabelsFrame->AddFrame(labelTau_rec, layout2); ///Single pixel waveform TGGroupFrame *waveformGroupFrame = new TGGroupFrame(sipmFrame, "Single Pixel Waveform", kHorizontalFrame); sipmFrame->AddFrame(waveformGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *waveformEntriesFrame = new TGCompositeFrame(waveformGroupFrame, 400, 400); //Entries waveformGroupFrame->AddFrame(waveformEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *waveformLabelsFrame = new TGCompositeFrame(waveformGroupFrame, 400, 400); //Labels waveformGroupFrame->AddFrame(waveformLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryTau_le = new TGNumberEntry(waveformEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryTau_le, layout1); labelTau_le = new TGLabel(waveformLabelsFrame,"Rise time [ns]"); waveformLabelsFrame->AddFrame(labelTau_le, layout2); entryTau_te = new TGNumberEntry(waveformEntriesFrame,40,6, -1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryTau_te, layout1); labelTau_te = new TGLabel(waveformLabelsFrame,"Decay time [ns]"); waveformLabelsFrame->AddFrame(labelTau_te, layout2); entryJitter = new TGNumberEntry(waveformEntriesFrame,200,6, -1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryJitter, layout1); labelJitter = new TGLabel(waveformLabelsFrame,"Jitter [ps]"); waveformLabelsFrame->AddFrame(labelJitter, layout2); entrySignalAmp = new TGNumberEntry(waveformEntriesFrame,20,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entrySignalAmp, layout1); labelSignalAmp = new TGLabel(waveformLabelsFrame,"Amplitude [mV]"); waveformLabelsFrame->AddFrame(labelSignalAmp, layout2); entryRMS = new TGNumberEntry(waveformEntriesFrame,1.5,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryRMS, layout1); labelRMS = new TGLabel(waveformLabelsFrame,"Electronic Noise [mV]"); waveformLabelsFrame->AddFrame(labelRMS, layout2); entrySampling = new TGNumberEntry(waveformEntriesFrame,0.1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entrySampling, layout1); labelSampling = new TGLabel(waveformLabelsFrame,"Sampling [ns]"); waveformLabelsFrame->AddFrame(labelSampling, layout2); entryCutoff = new TGNumberEntry(waveformEntriesFrame,0.01,6,-1,TGNumberFormat::kNESRealThree,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); waveformEntriesFrame->AddFrame(entryCutoff, layout1); labelCutoff = new TGLabel(waveformLabelsFrame,"Cutoff [%]"); waveformLabelsFrame->AddFrame(labelCutoff, layout2); ///Geometry TGGroupFrame *geometryGroupFrame = new TGGroupFrame(sipmFrame, "Geometry", kHorizontalFrame); sipmFrame->AddFrame(geometryGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *geometryEntriesFrame = new TGCompositeFrame(geometryGroupFrame, 400, 400); //Entries geometryGroupFrame->AddFrame(geometryEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *geometryLabelsFrame = new TGCompositeFrame(geometryGroupFrame, 400, 400); //Labels geometryGroupFrame->AddFrame(geometryLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNpx = new TGNumberEntry(geometryEntriesFrame,10,6,-1, TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entryNpx, layout1); labelNpx = new TGLabel(geometryLabelsFrame,"nPixels x"); geometryLabelsFrame->AddFrame(labelNpx, layout2); entryNpy = new TGNumberEntry(geometryEntriesFrame,10,6,-1,TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entryNpy, layout1); labelNpy = new TGLabel(geometryLabelsFrame,"nPixels y"); geometryLabelsFrame->AddFrame(labelNpy, layout2); entrySizeX = new TGNumberEntry(geometryEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entrySizeX, layout1); labelSizeX = new TGLabel(geometryLabelsFrame,"Size x [mm]"); geometryLabelsFrame->AddFrame(labelSizeX, layout2); entrySizeY = new TGNumberEntry(geometryEntriesFrame,1,6,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); geometryEntriesFrame->AddFrame(entrySizeY, layout1); labelSizeY = new TGLabel(geometryLabelsFrame,"Size y [mm]"); geometryLabelsFrame->AddFrame(labelSizeY, layout2); }
void gossipGUI::BuildDAQFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildDAQFrame( TGFrame *parentFrame )" << endl; daqFrame = new TGCompositeFrame(parentFrame, 60, 20, kHorizontalFrame); TGButtonGroup *buttonGroupMeasurement = new TGButtonGroup(daqFrame,"Select Measurement"); new TGRadioButton(buttonGroupMeasurement, "Waveform"); new TGRadioButton(buttonGroupMeasurement, "Charge Spectrum"); new TGRadioButton(buttonGroupMeasurement, "Time Spectrum"); new TGRadioButton(buttonGroupMeasurement, "Threshold Scan"); new TGRadioButton(buttonGroupMeasurement, "Statistic"); new TGRadioButton(buttonGroupMeasurement, "Response Curve"); buttonGroupMeasurement->SetButton(kTextLeft); buttonGroupMeasurement->Connect("Pressed(Int_t)", "gossipGUI", this, "SelectMeasurement(int)"); daqFrame->AddFrame(buttonGroupMeasurement,new TGLayoutHints(kLHintsLeft, 0, 0, 5, 0)); TGGroupFrame *parameterGroupFrame = new TGGroupFrame(daqFrame, "Parameters", kHorizontalFrame); daqFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNentries = new TGNumberEntry(parametersEntriesFrame,1000,8,-1,TGNumberFormat::kNESInteger,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNentries, layout1); labelNentries = new TGLabel(parametersLabelsFrame,"nEntries"); parametersLabelsFrame->AddFrame(labelNentries, layout2); entryGate = new TGNumberEntry(parametersEntriesFrame,300,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryGate, layout1); labelGate = new TGLabel(parametersLabelsFrame,"Gate [ns] "); parametersLabelsFrame->AddFrame(labelGate, layout2); entryPreGate = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryPreGate, layout1); labelPreGate = new TGLabel(parametersLabelsFrame,"Pregate [ns] "); parametersLabelsFrame->AddFrame(labelPreGate, layout2); entryPedestal = new TGNumberEntry(parametersEntriesFrame,50,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryPedestal, layout1); labelPedestal = new TGLabel(parametersLabelsFrame,"Pedestal"); parametersLabelsFrame->AddFrame(labelPedestal, layout2); entryThreshStart = new TGNumberEntry(parametersEntriesFrame,15,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStart, layout1); labelThreshStart = new TGLabel(parametersLabelsFrame,"Threshold start"); parametersLabelsFrame->AddFrame(labelThreshStart, layout2); entryThreshStop = new TGNumberEntry(parametersEntriesFrame,60,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStop, layout1); labelThreshStop = new TGLabel(parametersLabelsFrame,"Threshold stop"); parametersLabelsFrame->AddFrame(labelThreshStop, layout2); entryThreshStep = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryThreshStep, layout1); labelThreshStep = new TGLabel(parametersLabelsFrame,"Threshold step"); parametersLabelsFrame->AddFrame(labelThreshStep, layout2); entryDiscriMinTime = new TGNumberEntry(parametersEntriesFrame,3,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryDiscriMinTime, layout1); labelDiscriMinTime = new TGLabel(parametersLabelsFrame,"Discri. mintime"); parametersLabelsFrame->AddFrame(labelDiscriMinTime, layout2); entryDiscriWidth = new TGNumberEntry(parametersEntriesFrame,10,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryDiscriWidth, layout1); labelDiscriWidth = new TGLabel(parametersLabelsFrame,"Discri. width"); parametersLabelsFrame->AddFrame(labelDiscriWidth, layout2); entryNgammaMax = new TGNumberEntry(parametersEntriesFrame,1000,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgammaMax, layout1); labelNgammaMax = new TGLabel(parametersLabelsFrame,"nPhotons max."); parametersLabelsFrame->AddFrame(labelNgammaMax, layout2); entryNgammaStep = new TGNumberEntry(parametersEntriesFrame,50,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAPositive,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgammaStep, layout1); labelNgammaStep = new TGLabel(parametersLabelsFrame,"nPhotons step"); parametersLabelsFrame->AddFrame(labelNgammaStep, layout2); }
void gossipGUI::BuildLightSourceFrame( TGFrame *parentFrame ) { if(getenv("GOSSIP_DEBUG")!=0 && strncmp(getenv("GOSSIP_DEBUG"),"1",1)==0) cout << "gossipGUI::BuildLightSourceFrame( TGFrame *parentFrame )" << endl; lightSourceFrame = new TGCompositeFrame(parentFrame, 60, 20, kVerticalFrame); TGGroupFrame *parameterGroupFrame = new TGGroupFrame(lightSourceFrame, "Parameters", kHorizontalFrame); lightSourceFrame->AddFrame(parameterGroupFrame, new TGLayoutHints(kLHintsTop | kLHintsLeft, 2, 2, 2, 2)); TGCompositeFrame *parametersEntriesFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Entries parameterGroupFrame->AddFrame(parametersEntriesFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 0)); TGCompositeFrame *parametersLabelsFrame = new TGCompositeFrame(parameterGroupFrame, 400, 400); //Labels parameterGroupFrame->AddFrame(parametersLabelsFrame, new TGLayoutHints(kLHintsRight | kLHintsTop, 5, 0, 8, 0)); entryNgamma = new TGNumberEntry(parametersEntriesFrame,10,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryNgamma, layout1); labelNgamma = new TGLabel(parametersLabelsFrame,"nPhotons"); parametersLabelsFrame->AddFrame(labelNgamma, layout2); checkButtonPhotonFluct = new TGCheckButton(parametersEntriesFrame,""); parametersEntriesFrame->AddFrame(checkButtonPhotonFluct, new TGLayoutHints(kLHintsRight | kLHintsTop, 0, 0, 6, 0)); labelNgammaFluct = new TGLabel(parametersLabelsFrame,"Fluctuations"); parametersLabelsFrame->AddFrame(labelNgammaFluct, layout2); checkButtonPhotonFluct->SetOn(); comboBoxLEDpulse = new TGComboBox(parametersEntriesFrame,-1, kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground); parametersEntriesFrame->AddFrame(comboBoxLEDpulse, layout1); labelLEDpulse = new TGLabel(parametersLabelsFrame,"Pulse"); parametersLabelsFrame->AddFrame(labelLEDpulse, layout2); comboBoxLEDpulse->AddEntry("flat",1); comboBoxLEDpulse->AddEntry("gaus",2); comboBoxLEDpulse->AddEntry("exp",3); comboBoxLEDpulse->AddEntry("exp2",4); comboBoxLEDpulse->Resize(80,22); comboBoxLEDpulse->Select(1); entryLEDtime = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDtime, layout1); labelLEDtime = new TGLabel(parametersLabelsFrame,"Initial time [ns]"); parametersLabelsFrame->AddFrame(labelLEDtime, layout2); entryLEDduration = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDduration, layout1); labelLEDduration = new TGLabel(parametersLabelsFrame,"Duration [ns]"); parametersLabelsFrame->AddFrame(labelLEDduration, layout2); entryLEDriseTime = new TGNumberEntry(parametersEntriesFrame,5,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDriseTime, layout1); labelLEDriseTime = new TGLabel(parametersLabelsFrame,"Rise time [ns]"); parametersLabelsFrame->AddFrame(labelLEDriseTime, layout2); comboBoxLEDgeometry = new TGComboBox(parametersEntriesFrame,-1, kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground); parametersEntriesFrame->AddFrame(comboBoxLEDgeometry, layout1); labelLEDgeometry = new TGLabel(parametersLabelsFrame,"Geometry"); parametersLabelsFrame->AddFrame(labelLEDgeometry, layout2); comboBoxLEDgeometry->AddEntry("square",1); comboBoxLEDgeometry->AddEntry("elliptic",2); comboBoxLEDgeometry->Resize(80,22); comboBoxLEDgeometry->Select(1); entryLEDxPos = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDxPos, layout1); labelLEDxPos = new TGLabel(parametersLabelsFrame,"Position x [mm]"); parametersLabelsFrame->AddFrame(labelLEDxPos, layout2); entryLEDyPos = new TGNumberEntry(parametersEntriesFrame,0,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEAAnyNumber,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDyPos, layout1); labelLEDyPos = new TGLabel(parametersLabelsFrame,"Position y [mm]"); parametersLabelsFrame->AddFrame(labelLEDyPos, layout2); entryLEDxWidth = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDxWidth, layout1); labelLEDxWidth = new TGLabel(parametersLabelsFrame,"Width x [mm]"); parametersLabelsFrame->AddFrame(labelLEDxWidth, layout2); entryLEDyWidth = new TGNumberEntry(parametersEntriesFrame,1,8,-1,TGNumberFormat::kNESRealOne,TGNumberFormat::kNEANonNegative,TGNumberFormat::kNELNoLimits); parametersEntriesFrame->AddFrame(entryLEDyWidth, layout1); labelLEDyWidth = new TGLabel(parametersLabelsFrame,"Width y [mm]"); parametersLabelsFrame->AddFrame(labelLEDyWidth, layout2); }