#include "JobControl/JobC.h"#include "Midad/Base/Mint.h"Go to the source code of this file.
Functions | |
| void | TridSetup (JobC &jc) |
Variables | |
| R__EXTERN Mint * | gMint |
| R__EXTERN PageDisplay * | gPageDisplay |
|
|
Global function to set up TriD. Does all the hard work for you. Definition at line 117 of file TridSetup.cxx. References GuiCompositeFrameBase::Add(), PageDisplay::AddPage(), PageDisplay::close_window, GuiMainWindow::ConnectClose(), TridPageDisplay::fNextPassSignal, TridPageDisplay::fNextSignal, TridPageDisplay::fPrevSignal, TridControl::fSignal_RestoreWindowGeometry, TridControl::fSignal_SaveWindowGeometry, PageDisplay::FullZoom(), Mint::GetJint(), gMint, gPageDisplay, gPageDisplayWindow, gSystem(), PageDisplay::Init(), TridControl::Instance(), jc, Jint::mom_modified, RestoreControlWindow(), TridControl::RestoreWindowGeometries(), SaveControlWindow(), GuiMainWindow::ShowAll(), and tc. 00118 {
00119 // Create a mint.
00120 if(gMint) delete gMint;
00121 gMint = new Mint(jc);
00122
00123 // Create a window.
00124 if(gPageDisplayWindow) delete gPageDisplayWindow;
00125 gPageDisplayWindow = new GuiMainWindow(500,400);
00126 gPageDisplayWindow->SetWindowName("TriD Minos Event Display");
00127
00128
00129 // Put a page display in it.
00130 if(gPageDisplay) delete gPageDisplay;
00131 TridPageDisplay* pd = new TridPageDisplay(*gPageDisplayWindow, gMint);
00132 gPageDisplay = pd;
00133
00134
00135 // Set up the hooks.
00136 pd->Init();
00137 pd->close_window.connect(slot(*gPageDisplayWindow,&GuiMainWindow::SendCloseMessage));
00138 //pd->fNextSignal.connect(SigC::slot(&DoNext));
00139 //pd->fNextSignal.connect(SigC::slot(&DoPrev));
00140 pd->fNextSignal. connect(SigC::slot_class(*gMint,&Mint::Next));
00141 pd->fNextPassSignal.connect(SigC::slot_class(*gMint,&Mint::NextPass));
00142 pd->fPrevSignal. connect(SigC::slot_class(*gMint,&Mint::Prev));
00143
00144 // Important only for Brett's stuff:
00145 //gMint->GetJint().mom_modified.connect(slot(*gMint,&GMint::NewMom));
00146
00147 // General:
00148 gMint->GetJint().mom_modified.connect(slot_class(*(PageDisplay*)pd,
00149 &PageDisplay::ClearDisplay));
00150 gMint->GetJint().mom_modified.connect(slot_class(*(PageDisplay*)pd,
00151 &PageDisplay::UpdateDisplay));
00152
00153 pd->AddPage("EventInfoPage",true);
00154 pd->AddPage("SelectionInfoPage",true);
00155
00156
00157 // Blit the window.
00158 gPageDisplayWindow->Add(*pd);
00159 gPageDisplayWindow->ShowAll();
00160 gPageDisplayWindow->ConnectClose(true);
00161
00162 //
00163 // Next, spawn pages according to the defaults we know.
00164 //
00165 const char* filename = gSystem->Getenv("TRID_CONFIG_FILE");
00166 if(filename ==0) filename = ".tridrc";
00167
00168 TEnv env(filename);
00169 const char* windowlist = env.GetValue("Trid.DefaultWindows","");
00170 // split the line.
00171 char windownames[10][100];
00172 int num = sscanf(windowlist,"%99s %99s %99s %99s %99s %99s %99s %99s %99s %99s",
00173 windownames[0],windownames[1],
00174 windownames[2],windownames[3],
00175 windownames[4],windownames[5],
00176 windownames[6],windownames[7],
00177 windownames[8],windownames[9]);
00178 for(int i=0;i<num;i++) {
00179 pd->MySpawnSinglePage(windownames[i]);
00180 }
00181
00182
00183 //
00184 // Finally, tell all the windows to move themselves to the correct
00185 // locations to make it pretty.
00186 //
00187 static SigC::Ptr<TridControl> tc = TridControl::Instance(pd);
00188
00189 //... including the control window.
00190 tc->fSignal_SaveWindowGeometry.connect (SigC::slot(&SaveControlWindow));
00191 tc->fSignal_RestoreWindowGeometry.connect(SigC::slot(&RestoreControlWindow));
00192
00193 // Do the restoration.
00194 tc->RestoreWindowGeometries();
00195 RestoreControlWindow(env);
00196
00197 // Zoom to default position
00198 pd->FullZoom();
00199 }
|
|
|
Definition at line 10 of file TridSetup.h. |
|
|
Definition at line 11 of file TridSetup.h. |
1.3.9.1