Changeset 9185
- Timestamp:
- 12/02/08 11:12:35 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9184 r9185 19 19 -*-*- END OF LINE -*-*- 20 20 21 2008/12/02 Thomas Bretz 22 23 * mbase/MStatusDisplay.[h,cc], mbase/MEvtLoop.cc: 24 - added Pause and Single Step option 25 26 27 21 28 2008/12/01 Daniela Dorner 22 29 … … 47 54 result fit better 48 55 - added a histogram showing the readin source position of the MCs 56 57 * mcorsika/CorsikaLinkDef.h, mcorsika/Makefile, 58 mcorsika/MCorsikaEvtHeader.[h,cc], mcorsika/MCorsikaRead.[h,cc], 59 mcorsika/MCorsikaRunHeader.[h,cc]: 60 - addedcc MCorsikaRunHeader.h 49 61 50 62 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r8892 r9185 296 296 switch (fDisplay->CheckStatus()) 297 297 { 298 case MStatusDisplay::kLoopPause: 299 fDisplay->SetStatusLine1("Paused."); 300 while (fDisplay && fDisplay->CheckStatus()==MStatusDisplay::kLoopPause) 301 { 302 gSystem->ProcessEvents(); 303 gSystem->Sleep(1); 304 } 305 break; 306 case MStatusDisplay::kLoopStep: 307 fDisplay->SetPause(); 298 308 case MStatusDisplay::kLoopNone: 299 309 break; -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r9148 r9185 326 326 // 327 327 MGPopupMenu *loopmenu = new MGPopupMenu(gClient->GetRoot()); 328 loopmenu->AddEntry("&Stop", kLoopStop); 328 loopmenu->AddEntry("&Pause", kLoopPause); 329 loopmenu->AddEntry("Single S&tep", kLoopStep); 330 loopmenu->AddSeparator(); 331 loopmenu->AddEntry("&Stop", kLoopStop); 329 332 loopmenu->Associate(this); 333 334 loopmenu->DisableEntry(kLoopStep); 330 335 331 336 // … … 368 373 fList->Add(layitem); 369 374 370 MGMenuBar *menubar = new MGMenuBar(this, 1, 1, kHorizontalFrame);371 menubar->AddPopup("&File", filemenu, layitem);372 menubar->AddPopup("Lo&g", logmenu, layitem);373 menubar->AddPopup("&Size", sizemenu, layitem);374 menubar->AddPopup("&Tab", tabmenu, layitem);375 menubar->AddPopup("&Loop", loopmenu, layitem);376 menubar->BindKeys(this);377 AddFrame( menubar);375 fMenuBar = new MGMenuBar(this, 1, 1, kHorizontalFrame); 376 fMenuBar->AddPopup("&File", filemenu, layitem); 377 fMenuBar->AddPopup("Lo&g", logmenu, layitem); 378 fMenuBar->AddPopup("&Size", sizemenu, layitem); 379 fMenuBar->AddPopup("&Tab", tabmenu, layitem); 380 fMenuBar->AddPopup("&Loop", loopmenu, layitem); 381 fMenuBar->BindKeys(this); 382 AddFrame(fMenuBar); 378 383 379 384 // … … 394 399 fList->Add(loopmenu); 395 400 fList->Add(sizemenu); 396 fList->Add( menubar);401 fList->Add(fMenuBar); 397 402 fList->Add(tabmenu); 398 403 fList->Add(logmenu); … … 663 668 { 664 669 SetStatusLine2(MString::Format("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle())); 670 } 671 672 // -------------------------------------------------------------------------- 673 // 674 // Get TGPopupMenu as defined by name from fMenuBar 675 // 676 TGPopupMenu *MStatusDisplay::GetPopup(const char *name) 677 { 678 if (!fMenuBar) 679 return 0; 680 681 TGPopupMenu *m = fMenuBar->GetPopup(name); 682 if (!m) 683 { 684 *fLog << warn << name << " doesn't exist in menu bar." << endl; 685 return 0; 686 } 687 688 return m; 665 689 } 666 690 … … 1541 1565 switch (id) 1542 1566 { 1567 case kLoopPause: 1568 { 1569 TGPopupMenu *m = GetPopup("Loop"); 1570 if (!m) 1571 return kTRUE; 1572 1573 if (fStatus==kLoopNone) 1574 { 1575 fStatus = (Status_t)kLoopPause; 1576 m->CheckEntry(kLoopPause); 1577 m->EnableEntry(kLoopStep); 1578 return kTRUE; 1579 } 1580 if (fStatus==kLoopPause) 1581 { 1582 fStatus = (Status_t)kLoopNone; 1583 m->UnCheckEntry(kLoopPause); 1584 m->DisableEntry(kLoopStep); 1585 return kTRUE; 1586 } 1587 } 1588 return kTRUE; 1589 1590 case kLoopStep: 1591 fStatus = (Status_t)kLoopStep; 1592 return kTRUE; 1593 1543 1594 case kLoopStop: 1544 1595 case kFileClose: -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r9067 r9185 20 20 class MLog; 21 21 class MGList; 22 class MGMenuBar; 22 23 class MStatusArray; 23 24 class MParContainer; … … 32 33 class TGTextView; 33 34 class TGStatusBar; 35 class TGPopupMenu; 34 36 class TGTabElement; 35 37 class TGProgressBar; … … 51 53 kFileClose, kFileExit, kFileReset, 52 54 // kLoop 53 kLoopNone, kLoop Stop,55 kLoopNone, kLoopPause, kLoopStep, kLoopStop, 54 56 // kTab 55 57 kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsPDF, kTabSaveAsSVG, … … 97 99 TMutex *fMutex; 98 100 101 MGMenuBar *fMenuBar; 99 102 TGStatusBar *fStatusBar; 100 103 … … 141 144 void RemoveTab(int i); 142 145 void SetStatusLine(const char *txt, Int_t idx); 146 147 // Menu helper functions 148 TGPopupMenu *GetPopup(const char *name); 143 149 144 150 // Drawing helper … … 291 297 Status_t CheckStatus() const { return fStatus; } 292 298 void ClearStatus() { fStatus = kLoopNone; } 299 void SetPause() { fStatus = kLoopPause; } 293 300 294 301 void Lock() { fIsLocked++; }
Note:
See TracChangeset
for help on using the changeset viewer.