Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

PageDisplay Class Reference

#include <PageDisplay.h>

Inheritance diagram for PageDisplay:

GuiBox GuiCompositeFrameBase GuiBase TridPageDisplay List of all members.

Public Member Functions

 PageDisplay (TGWindow &parent, Mint *mint)
virtual ~PageDisplay ()
virtual void Init (const PageDisplayConfig &cfg=PageDisplayConfig())
virtual GuiTextButtonAddButton (const char *text)
virtual GuiTextEntryAddEntry (const char *init_text)
virtual TObject * AddPage (const char *name, bool in_a_tab=true)
virtual TObject * SpawnSinglePage (const char *name, int width=640, int height=480)
virtual void OpenFile ()
virtual void LoadLib ()
virtual void PrintDisplay ()
virtual void PrintTab (int id) const
GuiTextButtonGetButton (const char *text)
virtual void StatusBar (const char *msg=0)
virtual void ClearDisplay ()
virtual void UpdateDisplay ()
virtual void UpdateTab (int tab_id)
virtual void Unzoom ()
virtual void Rezoom ()
virtual void AutoZoom ()
virtual void FullZoom ()
virtual DigitTextGetDigitText ()
virtual void MakeDigitText ()
virtual void MakeMCText ()
virtual void MakeMCTree ()
virtual void MakeMCVectors ()
GuiMenuBarGetMenuBar ()
GuiSliderGetTimeSlider ()
virtual void UpdateGui ()
GuiTabGetTab ()
GuiBoxGetButtonBox ()
void ProcessEvents ()
MintGetMint ()
virtual void MakeTimeHist ()
virtual void MakePmtPixels ()
virtual void DrawGeometry ()

Public Attributes

SigC::Signal0< void > close_window

Protected Types

typedef std::map< const char *,
GuiTextButton * > 
ButtonMap_t
typedef std::vector< PageABC * > PageList_t

Protected Member Functions

virtual void BuildGUI (const PageDisplayConfig &cfg)
virtual void SetupMenus ()
virtual void SetupButtons ()
virtual void SetupSliders ()
virtual void CandidateNames ()

Protected Attributes

MintfMint
GuiMenuBarfMenuBar
RunSnarlEntryfRSEntry
GuiBoxfBBox
GuiTabfTabs
GuiStatusBarfStatusBar
GuiSliderfTimeSlider
ButtonMap_t fButtonMap
PageList_t fPageList
PageList_t fSinglePageList
TimeHistfTimeHist
PmtPixelsfPmtPixels
DigitTextfDigitText
SigC::Ptr< MCTextfMCText
SigC::Ptr< MCTreefMCTree
MCVectorsfMCVectors
bool fUseRunSnarlEntry

Member Typedef Documentation

typedef std::map<const char*, GuiTextButton*> PageDisplay::ButtonMap_t [protected]
 

Definition at line 138 of file PageDisplay.h.

typedef std::vector<PageABC*> PageDisplay::PageList_t [protected]
 

Definition at line 143 of file PageDisplay.h.


Constructor & Destructor Documentation

PageDisplay::PageDisplay TGWindow &  parent,
Mint mint
 

Definition at line 57 of file PageDisplay.cxx.

Referenced by AddPage().

00058     : GuiBox(parent,kVerticalFrame,100,100)
00059     , fMint(mint)
00060     , fMenuBar(0)
00061     , fRSEntry(0)
00062     , fBBox(0)
00063     , fTabs(0)
00064     , fStatusBar(0)
00065     , fTimeSlider(0)
00066     , fTimeHist(0) // no delete
00067     , fPmtPixels(0)
00068     , fDigitText(0)
00069     , fMCText(0)
00070     , fMCTree(0)
00071     , fMCVectors(0)
00072 {
00073 }

PageDisplay::~PageDisplay  )  [virtual]
 

Definition at line 77 of file PageDisplay.cxx.

References fPageList, and fSinglePageList.

00078 {
00079     cerr << "PageDisplay::~PageDisplay()\n";
00080     int siz = fPageList.size();
00081     for (int ind = 0; ind < siz; ++ind)  
00082         delete(fPageList[ind]);
00083     siz = fSinglePageList.size();
00084     for (int ind = 0; ind < siz; ++ind)  
00085         delete(fSinglePageList[ind]);
00086 }


Member Function Documentation

GuiTextButton * PageDisplay::AddButton const char *  text  )  [virtual]
 

Definition at line 245 of file PageDisplay.cxx.

References fBBox, fButtonMap, GuiBase::GetMainWindow(), GuiBase::SetLayoutHints(), and GuiMainWindow::ShowAll().

Referenced by EVD::BuildButtons(), NueDisplayModule::BuildDisplay(), TridPageDisplay::SetupButtons(), and SetupButtons().

00246 {
00247     GuiMainWindow* mw = fBBox->GetMainWindow();
00248     if (!mw) { 
00249         cerr << "PageDisplay::AddButton: can't get main window\n";
00250         return 0;
00251     }
00252     int width = mw->GetWidth();
00253     int height = mw->GetHeight();
00254 
00255     GuiTextButton* b = manage(new GuiTextButton(*fBBox,text));
00256     b->SetLayoutHints(kLHintsExpandX);
00257     fBBox->Add(*b);
00258     fButtonMap[text] = b;
00259     
00260     mw->ShowAll();
00261     mw->Resize(width,height);
00262     return b;
00263 }

GuiTextEntry * PageDisplay::AddEntry const char *  init_text  )  [virtual]
 

Definition at line 270 of file PageDisplay.cxx.

References fBBox, GuiBase::GetMainWindow(), GuiBase::SetLayoutHints(), and GuiMainWindow::ShowAll().

Referenced by NueDisplayModule::BuildDisplay(), and SetupButtons().

00271 {
00272     GuiMainWindow* mw = fBBox->GetMainWindow();
00273     if (!mw) { 
00274         cerr << "PageDisplay::AddButton: can't get main window\n";
00275         return 0;
00276     }
00277     int width = mw->GetWidth();
00278     int height = mw->GetHeight();
00279 
00280     GuiTextEntry* e = manage(new GuiTextEntry(*fBBox,init_text));
00281     e->SetLayoutHints(kLHintsExpandX);
00282     fBBox->Add(*e);
00283     
00284     mw->ShowAll();
00285     mw->Resize(width,height);
00286     return e;
00287 }

TObject * PageDisplay::AddPage const char *  name,
bool  in_a_tab = true
[virtual]
 

Definition at line 289 of file PageDisplay.cxx.

References GuiCompositeFrameBase::Add(), GuiTab::Add(), close_window, PageProxyBase::Create(), fMint, fPageList, fTabs, GuiFrame::GetFrame(), GuiBase::GetMainWindow(), NamedFactory::GetProxy(), GuiBox::GuiBox(), PageABC::Init(), NamedFactory::Instance(), PageDisplay(), and GuiMainWindow::ShowAll().

Referenced by UserDisplayModule::BuildDisplay(), NueDisplayModule::BuildDisplay(), and TridSetup().

00290 {
00291     PageProxyBase* ppb = dynamic_cast<PageProxyBase*>
00292         (NamedFactory::Instance("Page").GetProxy(name));
00293     if (!ppb) {
00294         cerr << "Can't get page named: \"" << name << "\"\n";
00295         return 0;
00296     }
00297     if (in_a_tab) {
00298         PageABC* page = ppb->Create();
00299         GuiFrame* frame = fTabs->Add(name);
00300         GuiBox* box = manage(new GuiBox(*frame->GetFrame(), kVerticalFrame));
00301         frame->Add(*box);
00302 
00303         TObject* obj = page->Init(fMint,this,*box);
00304 
00305         fPageList.push_back(page);
00306         GuiMainWindow* mw = fTabs->GetMainWindow();
00307         assert(mw);
00308         mw->ShowAll();
00309         return obj;
00310     }
00311     else {
00312         using namespace SigC;
00313         int width=this->GetWidth(), height=this->GetHeight();
00314 
00315         GuiMainWindow* gmw = new GuiMainWindow(width-1,height-1);
00316         gmw->SetWindowName("PageDisplay");
00317         
00318         PageDisplay* pd = new PageDisplay(*gmw,fMint);
00319         gmw->Add(*pd);
00320         pd->close_window.connect(slot(*gmw,&GuiMainWindow::SendCloseMessage));
00321 
00322         return pd->AddPage(name,true);
00323     }
00324 }

void PageDisplay::AutoZoom  )  [virtual]
 

Definition at line 426 of file PageDisplay.cxx.

References fPageList, fSinglePageList, and fTabs.

Referenced by SetupMenus().

00427 {
00428   if(fTabs) {
00429     int cur = fTabs->GetCurrent();
00430     if (cur<0) return;
00431     fPageList[cur]->AutoZoom();
00432   }
00433   for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00434     fSinglePageList[ind]->AutoZoom();
00435   }
00436 }

void PageDisplay::BuildGUI const PageDisplayConfig cfg  )  [protected, virtual]
 

Reimplemented in TridPageDisplay.

Definition at line 88 of file PageDisplay.cxx.

References GuiCompositeFrameBase::Add(), fBBox, fRSEntry, fStatusBar, fTabs, GuiBox::GuiBox(), GuiTab::selected, GuiBase::SetLayoutHints(), SetupButtons(), SetupMenus(), SetupSliders(), UpdateTab(), and PageDisplayConfig::use_run_snarl_entry.

Referenced by Init().

00089 {
00090 
00091     // MENU
00092     this->SetupMenus();
00093 
00094     // RSE
00095     if (cfg.use_run_snarl_entry) {
00096         fRSEntry = manage(new RunSnarlEntry(*this));
00097         this->Add(*fRSEntry);
00098     }
00099     
00100     GuiBox* hbox = manage(new GuiBox(*this,kHorizontalFrame));
00101     this->Add(*hbox);
00102 
00103     // Button box
00104     fBBox = manage(new GuiBox(*hbox,kVerticalFrame));
00105     fBBox->SetLayoutHints(kLHintsExpandY);
00106     hbox->Add(*fBBox);
00107     this->SetupButtons();
00108 
00109     // Tabs
00110     fTabs = manage(new GuiTab(*hbox));
00111     hbox->Add(*fTabs);
00112     fTabs->selected.connect(slot(*this,&PageDisplay::UpdateTab));
00113 
00114     // Sliders
00115     this->SetupSliders();
00116 
00117     // status bar
00118     fStatusBar = manage(new GuiStatusBar(*this));
00119     this->Add(*fStatusBar);
00120 
00121 }

void PageDisplay::CandidateNames  )  [protected, virtual]
 

Definition at line 644 of file PageDisplay.cxx.

References apply_reg_gui(), GuiButtonBase::clicked, RegistryDialog::fApply, fMint, RegistryDialog::fOkay, RegistryDialog::fRegistryGui, Mint::GetCandidateLookup(), RegistryGui::SetRegistry(), and RegistryDialog::Spawn().

Referenced by SetupMenus().

00645 {
00646     RegistryDialog rd;
00647     rd.fRegistryGui->SetRegistry(fMint->GetCandidateLookup());
00648     rd.fOkay->clicked.connect(bind(slot(apply_reg_gui),this,rd.fRegistryGui));
00649     rd.fApply->clicked.connect(bind(slot(apply_reg_gui),this,rd.fRegistryGui));
00650     rd.Spawn();
00651 }

void PageDisplay::ClearDisplay  )  [virtual]
 

Definition at line 357 of file PageDisplay.cxx.

References fPageList, and fSinglePageList.

Referenced by apply_reg_gui().

00358 {
00359     int siz = fPageList.size();
00360     for (int ind = 0; ind < siz; ++ind)  
00361         fPageList[ind]->Clear();
00362     siz = fSinglePageList.size();
00363     for (int ind = 0; ind < siz; ++ind)  
00364         fSinglePageList[ind]->Clear();
00365 }

void PageDisplay::DrawGeometry  )  [virtual]
 

Definition at line 517 of file PageDisplay.cxx.

References UgliGeomHandle::Draw(), fMint, and Mint::GetUgliGeomHandle().

Referenced by SetupMenus().

00518 {
00519     UgliGeomHandle ugh = fMint->GetUgliGeomHandle();
00520     ugh.Draw();
00521 }

void PageDisplay::FullZoom  )  [virtual]
 

Definition at line 414 of file PageDisplay.cxx.

References fPageList, fSinglePageList, and fTabs.

Referenced by SetupMenus(), and TridSetup().

00415 {
00416   if(fTabs) {
00417     int cur = fTabs->GetCurrent();
00418     if (cur<0) return;
00419     fPageList[cur]->FullZoom();
00420   }
00421   for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00422     fSinglePageList[ind]->FullZoom();
00423   }
00424 }

GuiTextButton * PageDisplay::GetButton const char *  text  ) 
 

Definition at line 264 of file PageDisplay.cxx.

References fButtonMap.

00265 {
00266     ButtonMap_t::iterator mit = fButtonMap.find(text);
00267     if (mit == fButtonMap.end()) return 0;
00268     return mit->second;
00269 }

GuiBox* PageDisplay::GetButtonBox  )  [inline]
 

Definition at line 104 of file PageDisplay.h.

References fBBox.

Referenced by EVD::BuildButtons(), and NueDisplayModule::BuildDisplay().

00104 {return fBBox;};

DigitText * PageDisplay::GetDigitText  )  [virtual]
 

Definition at line 512 of file PageDisplay.cxx.

References fDigitText.

Referenced by GfxStripList::ExecuteEvent(), GfxDigitList::ExecuteEvent(), GfxDigitList::ExecuteEventDigit(), and GfxStripList::ExecuteEventStrip().

00513 {
00514     return fDigitText;
00515 }

GuiMenuBar & PageDisplay::GetMenuBar  ) 
 

Definition at line 186 of file PageDisplay.cxx.

References fMenuBar.

Referenced by EVD::BuildGfxMenu(), MultiPage::BuildMenus(), EVD::BuildMenus(), CheezyPage::BuildMenus(), and TridControl::TridControl().

00187 {
00188     assert(fMenuBar);
00189     return *fMenuBar;
00190 }

Mint* PageDisplay::GetMint  )  [inline]
 

Definition at line 110 of file PageDisplay.h.

References fMint.

Referenced by apply_reg_gui(), handle_free_run(), and handle_pause_entry().

00110 { return fMint; }

GuiTab* PageDisplay::GetTab  )  [inline]
 

Definition at line 101 of file PageDisplay.h.

References fTabs.

Referenced by EVD::Digittext(), EVD::MCtext(), EVD::MCTreetext(), DisplayOptions::OpenDialog(), and EVD::Recotext().

00101 {return fTabs;};

GuiSlider & PageDisplay::GetTimeSlider  ) 
 

Definition at line 239 of file PageDisplay.cxx.

References fTimeSlider.

Referenced by GfxTrackList::Configure(), GfxStripList::Configure(), GfxShowerList::Configure(), GfxDigitList::Configure(), MultiPage::Init(), and EVD::Init().

00240 {
00241     assert(fTimeSlider);
00242     return *fTimeSlider;
00243 }

virtual void PageDisplay::Init const PageDisplayConfig cfg = PageDisplayConfig()  )  [inline, virtual]
 

Definition at line 58 of file PageDisplay.h.

References BuildGUI().

Referenced by Mint::SpawnDisplay(), and TridSetup().

00059     { this->BuildGUI(cfg); }

void PageDisplay::LoadLib  )  [virtual]
 

Definition at line 466 of file PageDisplay.cxx.

References Form(), GuiBase::GetMainWindow(), and gSystem().

Referenced by SetupMenus().

00467 {
00468     GuiMainWindow* gmw = this->GetMainWindow();
00469     if (!gmw) {
00470         cerr << "PageDisplay::LoadLib no main window\n";
00471         return;
00472     }
00473 
00474     const char* filetypes[] = { "Library files", "*.so",
00475                                 "All files",    "*",
00476                                 0,              0 };
00477 
00478     // Use SRT_PUBLIC_CONTEXT/lib/SRT_SUBDIR as starting dir
00479     const char* spc = gSystem->Getenv("SRT_PUBLIC_CONTEXT");
00480     const char* ssd = gSystem->Getenv("SRT_SUBDIR");
00481     static TString dir = (spc&&ssd) ? Form("%s/lib/%s",spc,ssd) : ".";
00482         
00483     TGFileInfo fi;
00484     fi.fFileTypes = filetypes;
00485     fi.fIniDir = StrDup(dir);
00486     new TGFileDialog(gClient->GetRoot(), gmw, kFDOpen, &fi);
00487     dir = fi.fIniDir;
00488 
00489     cerr << "dir: " << dir << " file: " << fi.fFilename << endl;
00490 
00491     if (!fi.fFilename) {
00492         cerr << "open file aborted\n";
00493         return;
00494     }
00495 
00496     gSystem->Load(fi.fFilename);
00497 }

void PageDisplay::MakeDigitText  )  [virtual]
 

Definition at line 526 of file PageDisplay.cxx.

References fDigitText.

Referenced by SetupMenus().

00527 {
00528     if (fDigitText) return;
00529 
00530     GuiMainWindow* gmw = new GuiMainWindow(300,300); // no delete
00531     GuiTextView* gtv = manage(new GuiTextView(*gmw,300,300)); // no delete
00532     gmw->Add(*gtv);
00533 
00534     fDigitText = new DigitText(gtv);
00535     gmw->close_window.connect(bind(slot(&killer<DigitText>),fDigitText));
00536 
00537     gmw->ShowAll();
00538     gmw->ConnectClose();
00539 }

void PageDisplay::MakeMCText  )  [virtual]
 

Definition at line 540 of file PageDisplay.cxx.

References fMCText, and fMint.

Referenced by SetupMenus().

00541 {
00542     if (fMCText) return;
00543 
00544     GuiMainWindow* gmw = new GuiMainWindow(300,300); // no delete
00545     GuiTextView* gtv = manage(new GuiTextView(*gmw,300,300)); // no delete
00546     gmw->Add(*gtv);
00547 
00548     fMCText = manage(new MCText(gtv));
00549     gmw->close_window.connect(bind(slot(&killer<MCText>),fMCText));
00550 
00551     gmw->ShowAll();
00552     gmw->ConnectClose();
00553     fMCText->Update(fMint);
00554 }

void PageDisplay::MakeMCTree  )  [virtual]
 

Definition at line 555 of file PageDisplay.cxx.

References GuiScrolled::Add(), GuiCompositeFrameBase::Add(), GuiMainWindow::close_window, GuiMainWindow::ConnectClose(), fMCTree, fMint, GuiBase::SetLayoutHints(), and GuiMainWindow::ShowAll().

Referenced by SetupMenus().

00556 {
00557     if (fMCTree) return;
00558 
00559     GuiMainWindow* gmw = new GuiMainWindow(200,400); // no delete
00560 
00561     GuiScrolled* scrolled = manage(new GuiScrolled(*gmw));
00562     scrolled->SetLayoutHints(kLHintsExpandX | kLHintsExpandY);
00563     gmw->Add(*scrolled);
00564 
00565     GuiTree* gt = manage(new GuiTree(*scrolled->GetViewPort()));
00566     scrolled->Add(*gt);
00567     gt->SetCanvas(scrolled);
00568 
00569     fMCTree = manage(new MCTree(gt));
00570     gmw->close_window.connect(bind(slot(&killer<MCTree>),fMCTree));
00571 
00572     gmw->ShowAll();
00573     gmw->ConnectClose();
00574     fMCTree->Update(fMint);
00575 }

void PageDisplay::MakeMCVectors  )  [virtual]
 

Definition at line 576 of file PageDisplay.cxx.

References fMCTree, fMCVectors, fMint, GuiBase::SetLayoutHints(), and MCVectors::Update().

Referenced by SetupMenus().

00577 {
00578     if (fMCVectors) return;
00579 
00580     GuiMainWindow* gmw = new GuiMainWindow(300,300); // no delete
00581 
00582     GuiCanvas* can = manage(new GuiCanvas(*gmw,300,300));
00583     can->SetLayoutHints(kLHintsExpandX|kLHintsExpandY);
00584     gmw->Add(*can);
00585 
00586     can->GetCanvas()->cd();
00587     fMCVectors = new MCVectors(0,0,1,1);
00588 
00589     gmw->close_window.connect(bind(slot(&killer<MCTree>),fMCTree));
00590 
00591     gmw->ShowAll();
00592     gmw->ConnectClose();
00593     fMCVectors->Update(fMint);
00594 }

void PageDisplay::MakePmtPixels  )  [virtual]
 

Definition at line 596 of file PageDisplay.cxx.

References fMint, fPmtPixels, PmtPixels::Refresh(), and PmtPixels::SetMint().

Referenced by SetupMenus().

00597 {
00598     if (fPmtPixels) return;
00599     const int hsiz = 200;
00600     GuiMainWindow* gmw = new GuiMainWindow(hsiz,hsiz); // no delete
00601     GuiCanvas* gc = manage(new GuiCanvas(*gmw,hsiz,hsiz));
00602     gmw->Add(*gc);
00603     fPmtPixels = new PmtPixels(0,0,1,1);
00604     gc->GetCanvas()->cd();
00605     fPmtPixels->Draw();
00606     fPmtPixels->SetMint(fMint);
00607     gc->GetCanvas()->cd();
00608     gmw->ShowAll();
00609     gmw->ConnectClose();
00610     fPmtPixels->Refresh();
00611 }

void PageDisplay::MakeTimeHist  )  [virtual]
 

Definition at line 613 of file PageDisplay.cxx.

References TimeHist::Draw(), fMint, fTimeHist, TimeHist::Refresh(), and TimeHist::SetMint().

Referenced by SetupMenus().

00614 {
00615     if (fTimeHist) return;
00616 
00617     const int hsiz = 200;
00618     GuiMainWindow* gmw = new GuiMainWindow(hsiz,hsiz); // no delete
00619     GuiCanvas* gc = manage(new GuiCanvas(*gmw,hsiz,hsiz));
00620     gmw->Add(*gc);
00621 
00622     TCanvas* canvas = gc->GetCanvas();
00623     canvas->cd();
00624 
00625     fTimeHist = new TimeHist();
00626     fTimeHist->SetMint(fMint);
00627     fTimeHist->Draw();
00628 
00629     gPad = 0;
00630 
00631     gmw->ShowAll();
00632     gmw->ConnectClose();
00633     fTimeHist->Refresh();
00634 }

void PageDisplay::OpenFile  )  [virtual]
 

Definition at line 438 of file PageDisplay.cxx.

References JobCInput::AddFile(), fMint, Mint::GetJobC(), GuiBase::GetMainWindow(), and JobC::Input.

Referenced by SetupMenus().

00439 {
00440     GuiMainWindow* gmw = this->GetMainWindow();
00441     if (!gmw) {
00442         cerr << "PageDisplay::OpenFile no main window\n";
00443         return;
00444     }
00445 
00446     const char* filetypes[] = { "Data files", "*.root",
00447                                 "All files",    "*",
00448                                 0,              0 };
00449     static TString dir(".");
00450     TGFileInfo fi;
00451     fi.fFileTypes = filetypes;
00452     fi.fIniDir = StrDup(dir);
00453     new TGFileDialog(gClient->GetRoot(), gmw, kFDOpen, &fi);
00454     dir = fi.fIniDir;
00455 
00456     cerr << "dir: " << dir << " file: " << fi.fFilename << endl;
00457 
00458     if (!fi.fFilename) {
00459         cerr << "open file aborted\n";
00460         return;
00461     }
00462 
00463     fMint->GetJobC().Input.AddFile(fi.fFilename);
00464 
00465 }

void PageDisplay::PrintDisplay  )  [virtual]
 

Definition at line 499 of file PageDisplay.cxx.

References fSinglePageList, fTabs, and PrintTab().

Referenced by SetupMenus().

00500 {
00501   if(fTabs) this->PrintTab(fTabs->GetCurrent());
00502   for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00503     fSinglePageList[ind]->Print();
00504   }
00505 }

void PageDisplay::PrintTab int  id  )  const [virtual]
 

Definition at line 506 of file PageDisplay.cxx.

References fPageList.

Referenced by PrintDisplay().

00507 {
00508     if (tab_id < 0 || tab_id >= (int)fPageList.size()) return;
00509     fPageList[tab_id]->Print();
00510 }

void PageDisplay::ProcessEvents  ) 
 

Definition at line 353 of file PageDisplay.cxx.

00354 {
00355     fClient->HandleInput();
00356 }

void PageDisplay::Rezoom  )  [virtual]
 

Definition at line 402 of file PageDisplay.cxx.

References fPageList, fSinglePageList, and fTabs.

Referenced by SetupMenus().

00403 {
00404   if(fTabs) {
00405     int cur = fTabs->GetCurrent();
00406     if (cur<0) return;
00407     fPageList[cur]->Rezoom();
00408   }
00409   for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00410     fSinglePageList[ind]->Rezoom();
00411   }
00412 }

void PageDisplay::SetupButtons  )  [protected, virtual]
 

Reimplemented in TridPageDisplay.

Definition at line 210 of file PageDisplay.cxx.

References GuiTextEntry::activated, AddButton(), AddEntry(), GuiButtonBase::clicked, fMint, handle_free_run(), and handle_pause_entry().

Referenced by BuildGUI().

00211 {
00212     GuiTextButton* but;
00213     GuiTextEntry* ent;
00214 
00215     but = this->AddButton("Next -->");
00216     but->clicked.connect(slot_class(*fMint,&Mint::Next));
00217 
00218     but = this->AddButton("<-- Prev");
00219     but->clicked.connect(slot_class(*fMint,&Mint::Prev));
00220 
00221     but = this->AddButton("NextPass -->");
00222     but->clicked.connect(slot_class(*fMint,&Mint::NextPass));
00223 
00224     but = this->AddButton("Free Running");
00225     but->clicked.connect(bind(slot(handle_free_run),this,but));
00226 
00227     ent = this->AddEntry("0");
00228     ent->activated.connect(bind(slot(handle_pause_entry),this,ent));
00229 
00230 }

void PageDisplay::SetupMenus  )  [protected, virtual]
 

Reimplemented in TridPageDisplay.

Definition at line 134 of file PageDisplay.cxx.

References GuiMenu::Add(), GuiCompositeFrameBase::Add(), add_to_page_menu(), GuiMenuBar::AddMenu(), AutoZoom(), CandidateNames(), close_window, die_die_die(), DrawGeometry(), fMenuBar, FullZoom(), PageProxyBase::GetRegisteredNames(), LoadLib(), MakeDigitText(), MakeMCText(), MakeMCTree(), MakeMCVectors(), MakePmtPixels(), MakeTimeHist(), OpenFile(), PrintDisplay(), Rezoom(), and Unzoom().

Referenced by BuildGUI().

00135 {
00136     fMenuBar = manage(new GuiMenuBar(*this));
00137     this->Add(*fMenuBar);
00138 
00139     GuiMenu* file_menu = manage(new GuiMenu);
00140     fMenuBar->AddMenu(*file_menu,"File");
00141     file_menu->Add("Open...",slot(*this,&PageDisplay::OpenFile));
00142     file_menu->Add("Load Lib...",slot(*this,&PageDisplay::LoadLib));
00143     file_menu->Add("Print...",slot(*this,&PageDisplay::PrintDisplay));
00144     file_menu->Add("Close",close_window.slot());
00145     file_menu->Add("Quit",bind(slot(die_die_die),this));
00146 
00147     GuiMenu* pages_menu = manage(new GuiMenu);
00148     fMenuBar->AddMenu(*pages_menu,"Pages");
00149     
00150     GuiMenu* add_pages_menu = manage(new GuiMenu);
00151     pages_menu->Add("Add page",*add_pages_menu);
00152     GuiMenu* spawn_pages_menu = manage(new GuiMenu);
00153     pages_menu->Add("Spawn page",*spawn_pages_menu);
00154 
00155     vector<const char*> page_names = PageProxyBase::GetRegisteredNames();
00156     for (unsigned int ind = 0; ind < page_names.size(); ++ind) {
00157         add_to_page_menu(page_names[ind],add_pages_menu,this,true);
00158         add_to_page_menu(page_names[ind],spawn_pages_menu,this,false);
00159     }
00160     PageProxyBase::page_added.connect(bind(bind(bind(slot(add_to_page_menu),true),this),add_pages_menu));
00161     PageProxyBase::page_added.connect(bind(bind(bind(slot(add_to_page_menu),false),this),spawn_pages_menu));
00162     pages_menu->Add(0);
00163 
00164     GuiMenu* view_menu = manage(new GuiMenu);
00165     fMenuBar->AddMenu(*view_menu,"Views");
00166     view_menu->Add("3D Geometry",slot(*this,&PageDisplay::DrawGeometry));    
00167     view_menu->Add("Digit text",slot(*this,&PageDisplay::MakeDigitText));
00168     view_menu->Add("Time hist",slot(*this,&PageDisplay::MakeTimeHist));
00169     view_menu->Add("Pmt Pixels",slot(*this,&PageDisplay::MakePmtPixels));
00170     view_menu->Add("MC text",slot(*this,&PageDisplay::MakeMCText));
00171     view_menu->Add("MC tree",slot(*this,&PageDisplay::MakeMCTree));
00172     view_menu->Add("MC vectors",slot(*this,&PageDisplay::MakeMCVectors));
00173 
00174     GuiMenu* settings_menu = manage(new GuiMenu);
00175     fMenuBar->AddMenu(*settings_menu,"Settings");
00176     settings_menu->Add("Candidate Names",slot(*this,&PageDisplay::CandidateNames));
00177 
00178     GuiMenu* zoom_menu = manage(new GuiMenu);
00179     fMenuBar->AddMenu(*zoom_menu,"Zoom");
00180     zoom_menu->Add("Undo",slot(*this,&PageDisplay::Unzoom));
00181     zoom_menu->Add("Redo",slot(*this,&PageDisplay::Rezoom));
00182     zoom_menu->Add("Auto",slot(*this,&PageDisplay::AutoZoom));
00183     zoom_menu->Add("Full",slot(*this,&PageDisplay::FullZoom));
00184 }

void PageDisplay::SetupSliders  )  [protected, virtual]
 

Definition at line 232 of file PageDisplay.cxx.

References GuiCompositeFrameBase::Add(), fMint, fTimeSlider, Mint::GetTimeExtrema(), Mint::GetTimeRange(), GuiSlider::UseExtrema(), and GuiSlider::UseRange().

Referenced by BuildGUI().

00233 {
00234     fTimeSlider = manage(new GuiSlider(*this,kHorizontalFrame));
00235     this->Add(*fTimeSlider);
00236     fTimeSlider->UseRange(fMint->GetTimeRange());
00237     fTimeSlider->UseExtrema(fMint->GetTimeExtrema());
00238 }

TObject * PageDisplay::SpawnSinglePage const char *  name,
int  width = 640,
int  height = 480
[virtual]
 

Definition at line 326 of file PageDisplay.cxx.

References PageProxyBase::Create(), fMint, fSinglePageList, NamedFactory::GetProxy(), GuiBox::GuiBox(), PageABC::Init(), and NamedFactory::Instance().

Referenced by UserDisplayModule::BuildDisplay().

00327 {
00328     PageProxyBase* ppb = dynamic_cast<PageProxyBase*>
00329         (NamedFactory::Instance("Page").GetProxy(name));
00330     if (!ppb) {
00331         cerr << "Can't get page named: \"" << name << "\"\n";
00332         return 0;
00333     }
00334     PageABC* page = ppb->Create();
00335     fSinglePageList.push_back(page);
00336 
00337     GuiMainWindow* gmw = new GuiMainWindow(width-1,height-1);
00338     gmw->SetWindowName(name);
00339     GuiBox* box = manage(new GuiBox(*gmw, kVerticalFrame));
00340     gmw->Add(*box);
00341     TObject* obj = page->Init(fMint,this,*box);
00342     gmw->ShowAll();
00343     return obj;
00344 }

void PageDisplay::StatusBar const char *  msg = 0  )  [virtual]
 

Definition at line 347 of file PageDisplay.cxx.

References fStatusBar.

00348 {
00349 //    cerr << "Status bar: \"" << msg << "\"\n";
00350     if (msg) fStatusBar->SetText(msg);
00351     else fStatusBar->SetText("");
00352 }

void PageDisplay::Unzoom  )  [virtual]
 

Definition at line 390 of file PageDisplay.cxx.

References fPageList, fSinglePageList, and fTabs.

Referenced by SetupMenus().

00391 {
00392   if(fTabs) {
00393     int cur = fTabs->GetCurrent();
00394     if (cur<0) return;
00395     fPageList[cur]->Unzoom();
00396   }
00397   for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00398     fSinglePageList[ind]->Unzoom();
00399   }
00400 }

void PageDisplay::UpdateDisplay  )  [virtual]
 

Definition at line 366 of file PageDisplay.cxx.

References fMCText, fMCTree, fMCVectors, fMint, fPmtPixels, fRSEntry, fSinglePageList, fTabs, fTimeHist, Mint::GetDetector(), PmtPixels::Refresh(), TimeHist::Refresh(), MCVectors::Update(), RunSnarlEntry::Update(), and UpdateTab().

Referenced by apply_reg_gui().

00367 {
00368     if (! fMint->GetDetector()) return;
00369 
00370     if (fRSEntry) fRSEntry->Update(fMint);
00371 
00372     if(fTabs) this->UpdateTab(fTabs->GetCurrent());
00373     for (unsigned int ind = 0; ind < fSinglePageList.size(); ++ind) {
00374         fSinglePageList[ind]->Update();
00375     }
00376     
00377     if (fTimeHist) fTimeHist->Refresh();
00378     if (fPmtPixels) fPmtPixels->Refresh();
00379     if (fMCText) fMCText->Update(fMint);
00380     if (fMCTree) fMCTree->Update(fMint);
00381     if (fMCVectors) fMCVectors->Update(fMint);
00382 }

void PageDisplay::UpdateGui  )  [virtual]
 

Definition at line 653 of file PageDisplay.cxx.

References GuiBase::GetMainWindow().

Referenced by TridPage::SetupFrame().

00654 {
00655     GuiMainWindow* gmw = this->GetMainWindow();
00656     assert(gmw);
00657     gmw->Layout();
00658 }

void PageDisplay::UpdateTab int  tab_id  )  [virtual]
 

Definition at line 384 of file PageDisplay.cxx.

References fPageList.

Referenced by BuildGUI(), and UpdateDisplay().

00385 {
00386     if (tab_id < 0 || tab_id >= (int)fPageList.size()) return;
00387     fPageList[tab_id]->Update();
00388 }


Member Data Documentation

SigC::Signal0<void> PageDisplay::close_window
 

Definition at line 53 of file PageDisplay.h.

Referenced by AddPage(), SetupMenus(), and Mint::SpawnDisplay().

GuiBox* PageDisplay::fBBox [protected]
 

Definition at line 133 of file PageDisplay.h.

Referenced by AddButton(), AddEntry(), BuildGUI(), and GetButtonBox().

ButtonMap_t PageDisplay::fButtonMap [protected]
 

Definition at line 139 of file PageDisplay.h.

Referenced by AddButton(), and GetButton().

DigitText* PageDisplay::fDigitText [protected]
 

Definition at line 149 of file PageDisplay.h.

Referenced by GetDigitText(), and MakeDigitText().

SigC::Ptr<MCText> PageDisplay::fMCText [protected]
 

Definition at line 152 of file PageDisplay.h.

Referenced by MakeMCText(), and UpdateDisplay().

SigC::Ptr<MCTree> PageDisplay::fMCTree [protected]
 

Definition at line 153 of file PageDisplay.h.

Referenced by MakeMCTree(), MakeMCVectors(), and UpdateDisplay().

MCVectors* PageDisplay::fMCVectors [protected]
 

Definition at line 155 of file PageDisplay.h.

Referenced by MakeMCVectors(), and UpdateDisplay().

GuiMenuBar* PageDisplay::fMenuBar [protected]
 

Definition at line 131 of file PageDisplay.h.

Referenced by GetMenuBar(), and SetupMenus().

Mint* PageDisplay::fMint [protected]
 

Definition at line 129 of file PageDisplay.h.

Referenced by AddPage(), CandidateNames(), DrawGeometry(), GetMint(), MakeMCText(), MakeMCTree(), MakeMCVectors(), MakePmtPixels(), MakeTimeHist(), OpenFile(), SetupButtons(), SetupSliders(), SpawnSinglePage(), and UpdateDisplay().

PageList_t PageDisplay::fPageList [protected]
 

Definition at line 144 of file PageDisplay.h.

Referenced by AddPage(), AutoZoom(), ClearDisplay(), FullZoom(), PrintTab(), Rezoom(), Unzoom(), UpdateTab(), and ~PageDisplay().

PmtPixels* PageDisplay::fPmtPixels [protected]
 

Definition at line 147 of file PageDisplay.h.

Referenced by MakePmtPixels(), and UpdateDisplay().

RunSnarlEntry* PageDisplay::fRSEntry [protected]
 

Definition at line 132 of file PageDisplay.h.

Referenced by BuildGUI(), and UpdateDisplay().

PageList_t PageDisplay::fSinglePageList [protected]
 

Definition at line 144 of file PageDisplay.h.

Referenced by AutoZoom(), ClearDisplay(), FullZoom(), PrintDisplay(), Rezoom(), SpawnSinglePage(), Unzoom(), UpdateDisplay(), and ~PageDisplay().

GuiStatusBar* PageDisplay::fStatusBar [protected]
 

Definition at line 135 of file PageDisplay.h.

Referenced by BuildGUI(), and StatusBar().

GuiTab* PageDisplay::fTabs [protected]
 

Definition at line 134 of file PageDisplay.h.

Referenced by AddPage(), AutoZoom(), BuildGUI(), FullZoom(), GetTab(), PrintDisplay(), Rezoom(), Unzoom(), and UpdateDisplay().

TimeHist* PageDisplay::fTimeHist [protected]
 

Definition at line 146 of file PageDisplay.h.

Referenced by MakeTimeHist(), and UpdateDisplay().

GuiSlider* PageDisplay::fTimeSlider [protected]
 

Definition at line 136 of file PageDisplay.h.

Referenced by GetTimeSlider(), and SetupSliders().

bool PageDisplay::fUseRunSnarlEntry [protected]
 

Definition at line 157 of file PageDisplay.h.


The documentation for this class was generated from the following files:
Generated on Mon Mar 16 23:04:31 2009 for loon by doxygen 1.3.5