#include <TMainDisplayWindow.hxx>
Public Member Functions | |
TGTextButton * | GetResetButton () |
TGTextButton * | GetNextButton () |
TGTextButton * | GetQuitButton () |
TGNumberEntry * | GetSkipEventButton () |
TMainDisplayWindow (const TGWindow *p, UInt_t w, UInt_t h, bool isOffline) | |
virtual | ~TMainDisplayWindow () |
void | SavePadButtonAction () |
Method to call when 'save pad' button is pressed. | |
void | SaveCanvasButtonAction () |
Method to call when 'save canvas' button is pressed. | |
void | PauseResumeButtonAction () |
Method to call when 'pause/resume' button is pressed. | |
bool | IsDisplayPaused () |
std::pair< int, int > | AddSingleTab (std::string name, TGTab *tab=0, int mainTabIndex=-1) |
std::pair< int, int > | AddCanvas (std::string subtabname, std::string tabname=std::string("")) |
void | BuildWindow () |
void | ResetSize () |
TCanvas * | GetCanvas (const char *name) |
Get a particular canvas based on canvas name. | |
TRootEmbeddedCanvas * | GetCurrentEmbeddedCanvas () |
Return the current embedded canvas. | |
TGCompositeFrame * | GetCurrentCompositeFrame () |
TGCompositeFrame * | GetCompositeFrame (std::pair< int, int > index) |
std::pair< int, int > | GetCurrentTabIndex () |
Return an pair<int> index for current tab/sub-tab;. | |
std::string | GetCurrentTabName () |
Return the canvas name for the current tab. | |
TGTab * | GetSubTab (int index) |
TGMainFrame * | GetMain () |
TGTab * | GetTab () |
Private Member Functions | |
TGTab * | GetTab (std::pair< int, int > tabindex) |
std::string | GetTabName (TGTab *tab, int index=-1) |
int | GetNumberSubTabs (int i) |
TRootEmbeddedCanvas * | GetEmbeddedCanvas (const char *name) |
Private Attributes | |
TGMainFrame * | fMain |
TGTab * | fTab |
TGFrame * | fFrame |
TGHorizontalFrame * | fHframe |
bool | fIsOffline |
bool | fProcessingPaused |
Is processing paused? | |
TGTextButton * | fSavePadButton |
Buttons to make plots of current pad/canvas. | |
TGTextButton * | fSaveCanvasButton |
TGTextButton * | fNextButton |
TGTextButton * | fResetButton |
TGTextButton * | fQuitButton |
TGTextButton * | fPauseButton |
TGNumberEntry * | fNumberSkipEventButton |
Definition at line 18 of file TMainDisplayWindow.hxx.
TMainDisplayWindow::TMainDisplayWindow | ( | const TGWindow * | p, | |
UInt_t | w, | |||
UInt_t | h, | |||
bool | isOffline | |||
) |
Definition at line 12 of file TMainDisplayWindow.cxx.
00014 { 00015 fIsOffline = isOffline; 00016 fProcessingPaused = false; 00017 fNumberSkipEventButton = 0; 00018 00019 // Create a main frame 00020 fMain = new TGMainFrame(p,w,h); 00021 00022 fTab = new TGTab(fMain); 00023 fTab->Resize(fTab->GetDefaultSize()); 00024 fMain->AddFrame(fTab, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); 00025 fTab->MoveResize(2,2,300,300); 00026 00027 // _______________________________________________________________________________________ 00028 // Set up buttons for bottom of mainframe. 00029 00030 // Create a horizontal frame widget with buttons 00031 fHframe = new TGHorizontalFrame(fMain,200,40); 00032 00033 00034 // Set different options for bottom, depending on if using offline or online. 00035 if(fIsOffline){ 00036 00037 fNextButton = new TGTextButton(fHframe,"&Next"); 00038 fHframe->AddFrame(fNextButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00039 00040 }else{ 00041 00042 fNumberSkipEventButton = new TGNumberEntry(fHframe, 0, 9,999, TGNumberFormat::kNESInteger, 00043 TGNumberFormat::kNEANonNegative, 00044 TGNumberFormat::kNELLimitMinMax, 00045 1, 100000); 00046 fNumberSkipEventButton->SetIntNumber(5); 00047 fHframe->AddFrame(fNumberSkipEventButton, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); 00048 00049 TGLabel *labelEv = new TGLabel(fHframe, "Plot every Xth events"); 00050 fHframe->AddFrame(labelEv, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 5, 5)); 00051 00052 } 00053 00054 00055 // Add the histogram reset button. 00056 fResetButton = new TGTextButton(fHframe,"&Reset Histograms"); 00057 fHframe->AddFrame(fResetButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00058 00059 00060 // Add buttons to save current pad or current canvas. 00061 fSavePadButton = new TGTextButton(fHframe,"&Save Active Pad"); 00062 fSavePadButton->Connect("Clicked()", "TMainDisplayWindow", this, "SavePadButtonAction()"); 00063 fHframe->AddFrame(fSavePadButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00064 00065 fSaveCanvasButton = new TGTextButton(fHframe,"&Save Canvas"); 00066 fSaveCanvasButton->Connect("Clicked()", "TMainDisplayWindow", this, "SaveCanvasButtonAction()"); 00067 fHframe->AddFrame(fSaveCanvasButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00068 00069 // Disable the save buttons if online 00070 if(!fIsOffline){ 00071 fSavePadButton->SetEnabled(false); 00072 fSaveCanvasButton->SetEnabled(false); 00073 } 00074 00075 00076 if(!fIsOffline){ 00077 fPauseButton = new TGTextButton(fHframe,"&Pause"); 00078 fHframe->AddFrame(fPauseButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00079 fPauseButton->Connect("Clicked()", "TMainDisplayWindow", this, "PauseResumeButtonAction()"); 00080 } 00081 00082 00083 fQuitButton = new TGTextButton(fHframe,"&Quit"); 00084 fHframe->AddFrame(fQuitButton, new TGLayoutHints(kLHintsCenterX,5,5,3,4)); 00085 00086 00087 fMain->AddFrame(fHframe, new TGLayoutHints(kLHintsNormal,2,2,2,2)); 00088 00089 }
TMainDisplayWindow::~TMainDisplayWindow | ( | ) | [virtual] |
std::pair< int, int > TMainDisplayWindow::AddCanvas | ( | std::string | subtabname, | |
std::string | tabname = std::string("") | |||
) |
Definition at line 214 of file TMainDisplayWindow.cxx.
References AddSingleTab(), fTab, GetSubTab(), and GetTabName().
Referenced by TRootanaDisplay::AddSingleCanvas().
00214 { 00215 00216 // If we want to add tab to main tab-list, tabname is empty 00217 if(tabname.empty()){ 00218 std::cout << "Adding new canvas in tab named '" << subtabname << "'" << std::endl; 00219 return AddSingleTab(subtabname); 00220 } 00221 00222 // Otherwise we try to find an existing tab with that name. 00223 bool foundTab = false; 00224 TGTab *subtab = 0; 00225 int mainTabIndex = 0; 00226 for(int itab = 0; itab < fTab->GetNumberOfTabs() ; itab++){ 00227 00228 if(GetTabName(fTab,itab).compare(tabname) == 0){ 00229 subtab = GetSubTab(itab); 00230 mainTabIndex = itab; 00231 } 00232 } 00233 00234 if(subtab){ 00235 std::cout << "Adding new canvas in sub-tab named '" << subtabname << "' of tab " << tabname << std::endl; 00236 return AddSingleTab(subtabname,subtab,mainTabIndex); 00237 } 00238 00239 // We didn't find an existing sub-tab; create it. 00240 TGCompositeFrame *compositeFrame = fTab->AddTab(tabname.c_str()); 00241 compositeFrame->SetLayoutManager(new TGVerticalLayout(compositeFrame)); 00242 subtab = new TGTab(compositeFrame); 00243 compositeFrame->AddFrame(subtab, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); 00244 00245 std::cout << "Creating new tab named '"<< tabname <<"'. " 00246 << "Creating a new canvas in sub-tab named '" << subtabname << "'" << std::endl; 00247 return AddSingleTab(subtabname,subtab,fTab->GetNumberOfTabs()-1); 00248 00249 00250 }
std::pair< int, int > TMainDisplayWindow::AddSingleTab | ( | std::string | name, | |
TGTab * | tab = 0 , |
|||
int | mainTabIndex = -1 | |||
) |
Definition at line 183 of file TMainDisplayWindow.cxx.
References fDefaultHeight, and fTab.
Referenced by AddCanvas().
00183 { 00184 00185 00186 // Add a new tab element, of type TGCompositeFrame 00187 TGCompositeFrame *compositeFrame; 00188 if(tab==0) 00189 compositeFrame = fTab->AddTab(name.c_str()); 00190 else 00191 compositeFrame = tab->AddTab(name.c_str()); 00192 compositeFrame->SetLayoutManager(new TGVerticalLayout(compositeFrame)); 00193 00194 // Add a canvas within that composite frame. 00195 char cname[500]; 00196 std::pair<int,int> index; 00197 if(tab ==0){ 00198 sprintf(cname,"Canvas_%i",fTab->GetNumberOfTabs() - 1); 00199 index.first = fTab->GetNumberOfTabs() - 1; 00200 index.second = - 1; 00201 }else{ 00202 sprintf(cname,"Canvas_%i_%i",mainTabIndex,tab->GetNumberOfTabs() - 1); 00203 //sprintf(cname,"Canvas_%i_%i",fTab->GetNumberOfTabs() - 1,tab->GetNumberOfTabs() - 1); 00204 index.first = mainTabIndex; // fTab->GetNumberOfTabs() - 1; 00205 index.second = tab->GetNumberOfTabs() - 1; 00206 } 00207 TRootEmbeddedCanvas *embed_canvas = new TRootEmbeddedCanvas(cname, compositeFrame,fDefaultWidth,fDefaultHeight); 00208 compositeFrame->AddFrame(embed_canvas, new TGLayoutHints(kLHintsTop | kLHintsExpandX,5,5,5,0)); 00209 00210 return index; 00211 00212 }
void TMainDisplayWindow::BuildWindow | ( | ) |
This method should be called just once, after you have added all the canvases and tabs that you want.
Definition at line 266 of file TMainDisplayWindow.cxx.
References fMain.
Referenced by TRootanaDisplay::InitializeMainWindow().
00266 { 00267 00268 fMain->MapSubwindows(); 00269 // Initialize the layout algorithm 00270 fMain->Resize(fMain->GetDefaultSize()); 00271 // Map main frame 00272 fMain->MapWindow(); 00273 00274 00275 }
TCanvas * TMainDisplayWindow::GetCanvas | ( | const char * | name | ) |
Get a particular canvas based on canvas name.
Definition at line 368 of file TMainDisplayWindow.cxx.
References GetEmbeddedCanvas().
Referenced by MyTestLoop::PlotCanvas().
00368 { 00369 TRootEmbeddedCanvas* embed = GetEmbeddedCanvas(name); 00370 if(embed) return embed->GetCanvas(); 00371 00372 return 0; 00373 }
TGCompositeFrame * TMainDisplayWindow::GetCompositeFrame | ( | std::pair< int, int > | index | ) |
Definition at line 304 of file TMainDisplayWindow.cxx.
References fTab, and GetSubTab().
Referenced by TRootanaDisplay::AddSingleCanvas().
00304 { 00305 00306 TGTab *subtab = GetSubTab(index.first); 00307 TGCompositeFrame* frame; 00308 if(subtab) 00309 frame = subtab->GetTabContainer(index.second); 00310 else 00311 frame = fTab->GetTabContainer(index.first); 00312 return frame; 00313 00314 }
TGCompositeFrame * TMainDisplayWindow::GetCurrentCompositeFrame | ( | ) |
Definition at line 316 of file TMainDisplayWindow.cxx.
References fTab, and GetSubTab().
Referenced by GetCurrentEmbeddedCanvas().
00316 { 00317 TGTab *subtab = GetSubTab(fTab->GetCurrent()); 00318 TGCompositeFrame* frame; 00319 if(subtab) 00320 frame = subtab->GetTabContainer(subtab->GetCurrent()); 00321 else 00322 frame = fTab->GetTabContainer(fTab->GetCurrent()); 00323 return frame; 00324 }
TRootEmbeddedCanvas * TMainDisplayWindow::GetCurrentEmbeddedCanvas | ( | ) |
Return the current embedded canvas.
Definition at line 326 of file TMainDisplayWindow.cxx.
References GetCurrentCompositeFrame(), and GetTRootEmbeddedCanvasFromTGCompositeFrame().
Referenced by TRootanaDisplay::UpdatePlotsAction().
00326 { 00327 00328 TGCompositeFrame* frame = GetCurrentCompositeFrame(); 00329 return GetTRootEmbeddedCanvasFromTGCompositeFrame(frame); 00330 00331 }
std::pair< int, int > TMainDisplayWindow::GetCurrentTabIndex | ( | ) |
Return an pair<int> index for current tab/sub-tab;.
Definition at line 252 of file TMainDisplayWindow.cxx.
References fTab, and GetSubTab().
Referenced by GetCurrentTabName(), and TRootanaDisplay::UpdatePlotsAction().
00252 { 00253 std::pair<int,int> tmp; 00254 tmp.first = fTab->GetCurrent(); 00255 TGTab *subtab = GetSubTab(fTab->GetCurrent()); 00256 if(subtab) 00257 tmp.second = subtab->GetCurrent(); 00258 else 00259 tmp.second = -1; 00260 00261 return tmp; 00262 00263 }
std::string TMainDisplayWindow::GetCurrentTabName | ( | ) |
Return the canvas name for the current tab.
Definition at line 414 of file TMainDisplayWindow.cxx.
References GetCurrentTabIndex(), GetTab(), and GetTabName().
00414 { 00415 00416 std::pair<int,int> tabindex = GetCurrentTabIndex(); 00417 TGTab *tab = GetTab(tabindex); 00418 if(!tab || tab->GetNumberOfTabs() == 0){ 00419 return std::string("not found"); 00420 } 00421 return GetTabName(tab); 00422 00423 00424 }
TRootEmbeddedCanvas * TMainDisplayWindow::GetEmbeddedCanvas | ( | const char * | name | ) | [private] |
Definition at line 334 of file TMainDisplayWindow.cxx.
References fTab, GetSubTab(), GetTabName(), and GetTRootEmbeddedCanvasFromTGCompositeFrame().
Referenced by GetCanvas().
00334 { 00335 00336 00337 // Complicated. Need to loop over all possible tabs and sub-tabs, looking for 00338 // first match. 00339 for(int itab = 0; itab < fTab->GetNumberOfTabs() ; itab++){ 00340 00341 if(GetTabName(fTab, itab).compare(name) == 0){ 00342 TGCompositeFrame* frame = fTab->GetTabContainer(itab); 00343 return GetTRootEmbeddedCanvasFromTGCompositeFrame(frame); 00344 } 00345 00346 TGTab *subtab = 0; 00347 if(subtab = GetSubTab(itab)){ 00348 for (int isubtab = 0; isubtab < subtab->GetNumberOfTabs() ; isubtab++){ 00349 00350 //std::cout << itab << " " << isubtab << " Name! " << GetTabName(subtab, isubtab) << std::endl; 00351 if(GetTabName(subtab, isubtab).compare(name) == 0){ 00352 TGCompositeFrame* frame = subtab->GetTabContainer(isubtab); 00353 return GetTRootEmbeddedCanvasFromTGCompositeFrame(frame); 00354 } 00355 } 00356 } 00357 } 00358 00359 return 0; 00360 00361 00362 }
TGMainFrame* TMainDisplayWindow::GetMain | ( | ) | [inline] |
Definition at line 136 of file TMainDisplayWindow.hxx.
References fMain.
Referenced by TRootanaDisplay::UpdatePlotsAction().
00136 {return fMain;};
TGTextButton* TMainDisplayWindow::GetNextButton | ( | ) | [inline] |
Definition at line 77 of file TMainDisplayWindow.hxx.
References fNextButton.
Referenced by TRootanaDisplay::InitializeMainWindow().
00077 { return fNextButton;}
int TMainDisplayWindow::GetNumberSubTabs | ( | int | i | ) | [private] |
Definition at line 492 of file TMainDisplayWindow.cxx.
References fTab.
00492 { 00493 00494 00495 TGCompositeFrame* frame = fTab->GetTabContainer(i); 00496 00497 // This is awkward. Each composite frame actually has a bunch of elements, 00498 // one of which might be a TGTab 00499 TList* mylist = frame->GetList(); 00500 00501 TIter next(mylist); 00502 00503 while (TObject *obj = next()){ 00504 TGFrameElement *frame_element = dynamic_cast<TGFrameElement*>(obj); 00505 if(frame_element){ 00506 TGTab *this_tab = dynamic_cast<TGTab*>(frame_element->fFrame); 00507 if(this_tab){ 00508 return this_tab->GetNumberOfTabs(); 00509 } 00510 } 00511 } 00512 00513 // didn't find sub-tab, so return 0 00514 return 0; 00515 }
TGTextButton* TMainDisplayWindow::GetQuitButton | ( | ) | [inline] |
Definition at line 79 of file TMainDisplayWindow.hxx.
References fQuitButton.
Referenced by TRootanaDisplay::InitializeMainWindow().
00079 { return fQuitButton;}
TGTextButton* TMainDisplayWindow::GetResetButton | ( | ) | [inline] |
Definition at line 75 of file TMainDisplayWindow.hxx.
References fResetButton.
Referenced by TRootanaDisplay::InitializeMainWindow().
00075 { return fResetButton;}
TGNumberEntry* TMainDisplayWindow::GetSkipEventButton | ( | ) | [inline] |
Definition at line 81 of file TMainDisplayWindow.hxx.
References fNumberSkipEventButton.
Referenced by TRootanaDisplay::EventSkipButtonPushed(), TRootanaDisplay::InitializeMainWindow(), and TRootanaDisplay::SetNumberSkipEvent().
00081 { return fNumberSkipEventButton;}
TGTab * TMainDisplayWindow::GetSubTab | ( | int | index | ) |
Definition at line 163 of file TMainDisplayWindow.cxx.
References fTab.
Referenced by AddCanvas(), TRootanaDisplay::AddSingleCanvas(), GetCompositeFrame(), GetCurrentCompositeFrame(), GetCurrentTabIndex(), GetEmbeddedCanvas(), and GetTab().
00163 { 00164 00165 TGCompositeFrame* frame = fTab->GetTabContainer(index); 00166 00167 TList* mylist = frame->GetList(); 00168 00169 TIter next(mylist); 00170 while (TObject *obj = next()){ 00171 TGFrameElement *frame_element = dynamic_cast<TGFrameElement*>(obj); 00172 00173 if(frame_element){ 00174 TGTab *this_tab = dynamic_cast<TGTab*>(frame_element->fFrame); 00175 if(this_tab) return this_tab; 00176 } 00177 } 00178 00179 return 0; 00180 00181 }
TGTab* TMainDisplayWindow::GetTab | ( | ) | [inline] |
Definition at line 137 of file TMainDisplayWindow.hxx.
References fTab.
Referenced by GetCurrentTabName().
00137 {return fTab;};
TGTab * TMainDisplayWindow::GetTab | ( | std::pair< int, int > | tabindex | ) | [private] |
Definition at line 376 of file TMainDisplayWindow.cxx.
References fTab, and GetSubTab().
Referenced by TRootanaDisplay::InitializeMainWindow().
00376 { 00377 00378 TGTab *tab = 0; 00379 if(tabindex.second == -1) 00380 tab = fTab; 00381 else{ 00382 tab = GetSubTab(tabindex.first); 00383 } 00384 00385 if(!tab) return 0; 00386 return tab; 00387 00388 }
std::string TMainDisplayWindow::GetTabName | ( | TGTab * | tab, | |
int | index = -1 | |||
) | [private] |
Definition at line 389 of file TMainDisplayWindow.cxx.
Referenced by AddCanvas(), GetCurrentTabName(), and GetEmbeddedCanvas().
00389 { 00390 00391 TIter nextTab(tab->GetList()); 00392 nextTab(); // Skip the first element. This is the overall TGCompositeFrame, not the tabbed one. 00393 00394 // Get the index for the current canvas 00395 if(index < 0) 00396 index = tab->GetCurrent(); 00397 TGFrameElement *el; 00398 TGTabElement *tabel = 0; 00399 TGCompositeFrame *comp = 0; 00400 // Loop over the number of tabs, until we find the right one. 00401 for(int i = 0; i <= index; i++){ 00402 el = (TGFrameElement *) nextTab(); 00403 tabel = (TGTabElement *) el->fFrame; 00404 el = (TGFrameElement *) nextTab(); 00405 comp = (TGCompositeFrame *) el->fFrame; 00406 } 00407 if(tabel){ 00408 return std::string(*tabel->GetText()); 00409 } 00410 00411 return std::string("not found"); 00412 }
bool TMainDisplayWindow::IsDisplayPaused | ( | ) | [inline] |
Definition at line 97 of file TMainDisplayWindow.hxx.
References fProcessingPaused.
Referenced by TRootanaDisplay::ProcessMidasEvent().
00097 { 00098 return fProcessingPaused; 00099 }
void TMainDisplayWindow::PauseResumeButtonAction | ( | ) |
Method to call when 'pause/resume' button is pressed.
Definition at line 476 of file TMainDisplayWindow.cxx.
References fPauseButton, fProcessingPaused, fSaveCanvasButton, and fSavePadButton.
00476 { 00477 00478 if(fProcessingPaused){ 00479 fProcessingPaused = false; 00480 fPauseButton->SetText("Pause"); 00481 fSavePadButton->SetEnabled(false); 00482 fSaveCanvasButton->SetEnabled(false); 00483 }else{ 00484 fProcessingPaused = true; 00485 fPauseButton->SetText("Resume"); 00486 fSavePadButton->SetEnabled(true); 00487 fSaveCanvasButton->SetEnabled(true); 00488 } 00489 }
void TMainDisplayWindow::ResetSize | ( | ) |
This resizing is still not working right! You can easily get a situation where resizing doesn't work. Argh.
Definition at line 95 of file TMainDisplayWindow.cxx.
Referenced by TRootanaDisplay::ProcessMidasEvent(), and TRootanaDisplay::UpdatePlotsAction().
00095 { 00096 00097 // Resize each part of the tab. 00098 for(int itab = 0; itab < fTab->GetNumberOfTabs() ; itab++){ 00099 00100 TGCompositeFrame* frame = fTab->GetTabContainer(itab); 00101 00102 // This is awkward. Each composite frame actually has a bunch of elements. 00103 // Try to resize all the elements that are TGFrameElements. 00104 // This seems to work if the added frame is a TRootEmbeddedCanvas; not sure 00105 // otherwise. 00106 TList* mylist = frame->GetList(); 00107 00108 TIter next(mylist); 00109 while (TObject *obj = next()){ 00110 00111 00112 TGFrameElement *frame_element = dynamic_cast<TGFrameElement*>(obj); 00113 00114 if(frame_element){ 00115 frame_element->fFrame->Resize((frame_element->fFrame->GetDefaultSize().fWidth) 00116 *(fMain->GetSize().fWidth)/(fMain->GetDefaultSize().fWidth), 00117 (frame_element->fFrame->GetDefaultSize().fHeight) 00118 *(fMain->GetSize().fHeight)/(fMain->GetDefaultSize().fHeight)); 00119 00120 00121 TGTab *this_tab = dynamic_cast<TGTab*>(frame_element->fFrame); 00122 if(this_tab){ 00123 // Resize each part of the tab. 00124 for(int jtab = 0; jtab < this_tab->GetNumberOfTabs() ; jtab++){ 00125 00126 TGCompositeFrame* frame2 = this_tab->GetTabContainer(jtab); 00127 00128 // This is awkward. Each composite frame actually has a bunch of elements. 00129 // Try to resize all the elements that are TGFrameElements. 00130 // This seems to work if the added frame is a TRootEmbeddedCanvas; not sure 00131 // otherwise. 00132 TList* mylist2 = frame2->GetList(); 00133 00134 TIter next2(mylist2); 00135 while (TObject *obj2 = next2()){ 00136 00137 00138 TGFrameElement *frame_element = dynamic_cast<TGFrameElement*>(obj2); 00139 00140 if(frame_element){ 00141 frame_element->fFrame->Resize((frame_element->fFrame->GetDefaultSize().fWidth) 00142 *(fMain->GetSize().fWidth)/(fMain->GetDefaultSize().fWidth), 00143 (frame_element->fFrame->GetDefaultSize().fHeight) 00144 *(fMain->GetSize().fHeight)/(fMain->GetDefaultSize().fHeight)); 00145 } 00146 } 00147 } 00148 00149 } 00150 00151 00152 }else 00153 std::cout << "TMainDisplayWindow::ResetSize:: Dynamic cast of obj to TGFrameElement failed." << std::endl; 00154 00155 00156 } 00157 00158 00159 } 00160 00161 }
void TMainDisplayWindow::SaveCanvasButtonAction | ( | ) |
Method to call when 'save canvas' button is pressed.
Definition at line 462 of file TMainDisplayWindow.cxx.
References filetypes, and fMain.
00462 { 00463 00464 static TString dir("."); 00465 TGFileInfo fi; 00466 fi.fFileTypes = filetypes; 00467 fi.fIniDir = StrDup(dir); 00468 new TGFileDialog(gClient->GetRoot(), fMain, kFDSave, &fi); 00469 printf("Open file: %s (dir: %s)\n", fi.fFilename, 00470 fi.fIniDir); 00471 00472 gPad->GetCanvas()->SaveAs(fi.fFilename); 00473 00474 }
void TMainDisplayWindow::SavePadButtonAction | ( | ) |
Method to call when 'save pad' button is pressed.
Definition at line 442 of file TMainDisplayWindow.cxx.
References filetypes, and fMain.
00442 { 00443 static TString dir("."); 00444 TGFileInfo fi; 00445 fi.fFileTypes = filetypes; 00446 fi.fIniDir = StrDup(dir); 00447 new TGFileDialog(gClient->GetRoot(), fMain, kFDSave, &fi); 00448 printf("Open file: %s (dir: %s)\n", fi.fFilename, 00449 fi.fIniDir); 00450 00451 // Resize pad while saving; to get good image resolution.fTab 00452 double xl = gPad->GetXlowNDC(), xh = gPad->GetXlowNDC() + gPad->GetWNDC(); 00453 double yl = gPad->GetYlowNDC(), yh = gPad->GetYlowNDC() + gPad->GetHNDC(); 00454 00455 gPad->SetPad(0,0,1.0,1.0); 00456 gPad->SaveAs(fi.fFilename); 00457 gPad->SetPad(xl,yl,xh,yh); 00458 gPad->Update(); 00459 00460 }
TGFrame* TMainDisplayWindow::fFrame [private] |
Definition at line 27 of file TMainDisplayWindow.hxx.
TGHorizontalFrame* TMainDisplayWindow::fHframe [private] |
Definition at line 28 of file TMainDisplayWindow.hxx.
bool TMainDisplayWindow::fIsOffline [private] |
Variables to keep track of state of display Are we processing offline?
Definition at line 32 of file TMainDisplayWindow.hxx.
TGMainFrame* TMainDisplayWindow::fMain [private] |
Definition at line 23 of file TMainDisplayWindow.hxx.
Referenced by BuildWindow(), GetMain(), ResetSize(), SaveCanvasButtonAction(), SavePadButtonAction(), and ~TMainDisplayWindow().
TGTextButton* TMainDisplayWindow::fNextButton [private] |
Definition at line 41 of file TMainDisplayWindow.hxx.
Referenced by GetNextButton().
TGNumberEntry* TMainDisplayWindow::fNumberSkipEventButton [private] |
Definition at line 53 of file TMainDisplayWindow.hxx.
Referenced by GetSkipEventButton().
TGTextButton* TMainDisplayWindow::fPauseButton [private] |
Definition at line 50 of file TMainDisplayWindow.hxx.
Referenced by PauseResumeButtonAction().
bool TMainDisplayWindow::fProcessingPaused [private] |
Is processing paused?
Definition at line 34 of file TMainDisplayWindow.hxx.
Referenced by IsDisplayPaused(), and PauseResumeButtonAction().
TGTextButton* TMainDisplayWindow::fQuitButton [private] |
Definition at line 47 of file TMainDisplayWindow.hxx.
Referenced by GetQuitButton().
TGTextButton* TMainDisplayWindow::fResetButton [private] |
Definition at line 44 of file TMainDisplayWindow.hxx.
Referenced by GetResetButton().
TGTextButton* TMainDisplayWindow::fSaveCanvasButton [private] |
Definition at line 38 of file TMainDisplayWindow.hxx.
Referenced by PauseResumeButtonAction().
TGTextButton* TMainDisplayWindow::fSavePadButton [private] |
Buttons to make plots of current pad/canvas.
Definition at line 37 of file TMainDisplayWindow.hxx.
Referenced by PauseResumeButtonAction().
TGTab* TMainDisplayWindow::fTab [private] |
Definition at line 24 of file TMainDisplayWindow.hxx.
Referenced by AddCanvas(), AddSingleTab(), GetCompositeFrame(), GetCurrentCompositeFrame(), GetCurrentTabIndex(), GetEmbeddedCanvas(), GetNumberSubTabs(), GetSubTab(), GetTab(), ResetSize(), and ~TMainDisplayWindow().