Changeset 2058
- Timestamp:
- 05/05/03 10:37:08 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2057 r2058 1 2 3 4 1 -*-*- END OF LINE -*-*- 2 3 2003/05/05: Thomas Bretz 4 5 * mbase/MEvtLoop.cc: 6 - underline Instatiation Message 7 - small change to a warning output 8 9 * mbase/MLog.[h,cc]: 10 - added stuff for underlining 11 - changed from TGListBox to TGViewText 12 13 * mmain/MStatusDisplay.[h,cc]: 14 - changed fLogBox from TGListBox to TGViewText 15 - added menu 'Log' 16 - changed division of status line to 'Goldener Schnitt' 17 18 5 19 6 20 2003/05/05: Wolfgang Wittek … … 10 24 11 25 26 12 27 2003/05/02: Thomas Bretz 28 29 * Makefile.conf.general, Makefile.conf.linux, Makefile.conf.linux-gnu, 30 Makefile.conf.osf1, Makefile.conf.osf5.1: 31 - added MARSDEFINES, MARSFLAGS, MARSLIBS 32 33 * mars.cc: 34 - replaces HAVE_LOGO by HAVE_XPM 13 35 36 * NEWS: 37 - updated 38 39 * mbase/MLogo.cc: 40 - replaces marslogo_neu by marslogo 41 - encapsulated in HAVE_XPM 42 43 * mbase/Makefile: 44 - added MLogo.cc 45 46 * mmain/MGMenu.cc: 47 - fixed the 'KeyAutoRepeat' bug 48 14 49 * manalysis/MCerPhotEvt.[h,cc: 15 50 - added RemoveUnusedPixels … … 24 59 * mbase/MLog.[h,cc]: 25 60 - added flushing and tab conversion to GUI 61 - added color support 26 62 27 63 * mbase/MParList.cc: … … 44 80 - added writing C 45 81 - changes SaveAs to non-const (added output to status lines) 82 - replaced TGLabels by TGStatusBar 46 83 47 84 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2052 r2058 108 108 fName = name; 109 109 110 *fLog << inf << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << endl; 110 fLog->Underline(); 111 *fLog << inf << "Instantiated MEvtLoop (" << name << "), using ROOT v" << ROOTVER << "\033[0m" << endl; 111 112 } 112 113 … … 240 241 return kTRUE; 241 242 default: 243 *fLog << warn << "MEvtloop: fDisplay->ChecStatus() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl; 242 244 fDisplay->ClearStatus(); 243 *fLog << warn << "Display shows unknown status... cleared." << endl;244 245 break; 245 246 } -
trunk/MagicSoft/Mars/mbase/MLog.cc
r2054 r2058 80 80 #include <pthread.h> 81 81 #endif 82 #include <TG ListBox.h>82 #include <TGTextView.h> 83 83 84 84 #include "MLogManip.h" … … 133 133 // which is used for the output (i) 134 134 // 135 MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), f GuiLineId(0), fout(NULL), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)135 MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fout(NULL), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0) 136 136 { 137 137 Init(); … … 143 143 // ofstream as the default output device 144 144 // 145 MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), f GuiLineId(0), fout(&out), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0)145 MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fout(&out), fOutAllocated(kFALSE), fgui(NULL), fNumLines(0) 146 146 { 147 147 Init(); … … 151 151 // 152 152 // default constructor which initializes the streamer and sets the given 153 // TG ListBoxas the default output device154 // 155 MLog::MLog(TG ListBox &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fGuiLineId(0),fout(NULL), fOutAllocated(kFALSE), fgui(&out), fNumLines(0)153 // TGTextView as the default output device 154 // 155 MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fout(NULL), fOutAllocated(kFALSE), fgui(&out), fNumLines(0) 156 156 { 157 157 Init(); … … 164 164 // or not. 165 165 // 166 MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), f GuiLineId(0), fgui(NULL), fNumLines(0)166 MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fgui(NULL), fNumLines(0) 167 167 { 168 168 Init(); … … 193 193 fDebugLevel = log.fDebugLevel; 194 194 fDevice = log.fDevice; 195 } 196 197 void MLog::Underline() 198 { 199 if (fDevice&eStdout) 200 cout << kUnderline; 201 202 if (fDevice&eStderr) 203 cerr << kUnderline; 195 204 } 196 205 … … 272 281 } 273 282 283 #include <TVirtualX.h> 274 284 void MLog::UpdateGui() 275 285 { … … 279 289 // lock mutex 280 290 Lock(); 291 292 TGText &txt=*fgui->GetText(); 281 293 282 294 // copy lines to TGListBox … … 285 297 // Replace all tabs by 7 white spaces 286 298 fGuiLines[i]->ReplaceAll("\t", " "); 287 fgui->AddEntry(*fGuiLines[i], fGuiLineId++);299 txt.InsText(TGLongPosition(0, txt.RowCount()), *fGuiLines[i]); 288 300 delete fGuiLines[i]; 289 301 } … … 292 304 fNumLines=0; 293 305 294 // cut list box top 1000 lines 295 fgui->RemoveEntries(0, fGuiLineId-1000); 306 // cut text box top 1000 lines 307 while (txt.RowCount()>1000) 308 txt.DelLine(0); 309 296 310 // show last entry 297 fgui->SetTopEntry(fGuiLineId-1); 311 fgui->Layout(); 312 fgui->SetVsbPosition(txt.RowCount()-1); 313 298 314 // tell a main loop, that list box contents have changed 299 315 fgui->SetBit(kHasChanged); -
trunk/MagicSoft/Mars/mbase/MLog.h
r2054 r2058 18 18 19 19 20 class TG ListBox;20 class TGTextView; 21 21 22 22 class MLog : public streambuf, public ostream, public TObject … … 54 54 Bool_t fIsNull; //! Switch output completely off 55 55 56 Int_t fGuiLineId; //! 57 58 ofstream *fout; //! possible file output stream 59 Bool_t fOutAllocated; //! flag if fout is created by MLogging 60 TGListBox *fgui; //! Listbox output 56 ofstream *fout; //! possible file output stream 57 Bool_t fOutAllocated; //! flag if fout is created by MLogging 58 TGTextView *fgui; //! Text View output 61 59 62 60 Bool_t fIsDirectGui; //! Pipe text directly to the GUI (for single threaded environments) … … 84 82 MLog(int i=eStdout); 85 83 MLog(ofstream &out); 86 MLog(TG ListBox&out);84 MLog(TGTextView &out); 87 85 MLog(const char *fname, int flag=-1); 88 86 … … 97 95 void UpdateGui(); 98 96 97 void Underline(); 98 99 99 void SetDebugLevel(int i) { fDebugLevel = i; } 100 100 int GetDebugLevel() const { return fDebugLevel; } … … 104 104 void DisableOutputDevice(Flags_t f) { fDevice &= ~f; } 105 105 void operator=(ofstream &out) { SetOutputFile(out); } 106 void operator=(TG ListBox *out){ SetOutputGui(out); }106 void operator=(TGTextView *out) { SetOutputGui(out); } 107 107 108 108 Bool_t IsOutputDeviceEnabled(int i) const { return fDevice & i; } 109 109 110 void SetOutputGui(TG ListBox*out, int flag=-1)110 void SetOutputGui(TGTextView *out, int flag=-1) 111 111 { 112 112 fgui = out; -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2054 r2058 79 79 #include <TG3DLine.h> // TGHorizontal3DLine 80 80 #include <TGButton.h> // TGPictureButton 81 #include <TG ListBox.h> // TGListBox81 #include <TGTextView.h> // TGTextView 82 82 #include <TGStatusBar.h> // TGStatusBar 83 83 #include <TGProgressBar.h> // TGHProgressBar … … 153 153 154 154 // 155 // Log Menu 156 // 157 MGPopupMenu *logmenu = new MGPopupMenu(gClient->GetRoot()); 158 logmenu->AddEntry("&Copy Selected", kLogCopy); 159 logmenu->AddEntry("Clear all", kLogClear); 160 logmenu->AddSeparator(); 161 logmenu->AddEntry("Select All", kLogSelect); 162 /* 163 logmenu->AddSeparator(); 164 logmenu->AddEntry("Search", kLogSearch); 165 */ 166 logmenu->AddSeparator(); 167 logmenu->AddEntry("Save", kLogSave); 168 logmenu->AddEntry("Save append", kLogAppend); 169 logmenu->Associate(this); 170 171 // 155 172 // Menu Bar 156 173 // 157 174 MGMenuBar *menubar = new MGMenuBar(this, 1, 1, kHorizontalFrame); 158 175 menubar->AddPopup("&File", filemenu, NULL); 176 menubar->AddPopup("Lo&g", logmenu, NULL); 177 menubar->AddPopup("&Size", sizemenu, NULL); 159 178 menubar->AddPopup("&Tab", tabmenu, NULL); 160 179 menubar->AddPopup("&Loop", loopmenu, NULL); 161 menubar->AddPopup("&Size", sizemenu, NULL);162 180 menubar->BindKeys(this); 163 181 AddFrame(menubar); … … 180 198 fList->Add(menubar); 181 199 fList->Add(tabmenu); 200 fList->Add(logmenu); 182 201 fList->Add(linesep); 183 202 } … … 220 239 f->AddFrame(mars, lay2); 221 240 } 222 /*223 TGShutter *s = new TGShutter(f);224 fList->Add(s);225 f->AddFrame(s, lay);226 s->AddItem(new TGShutterItem(s, new TGHotString("Hallo1")));227 s->AddItem(new TGShutterItem(s, new TGHotString("Hallo2")));228 */229 241 230 242 // Add date and time … … 261 273 TGCompositeFrame *f = fTab->AddTab("-Logbook-"); 262 274 263 // Create TGListBox(p, id=-1, opt, back) for logging contents 264 fLogBox = new TGListBox(f, -1, kSunkenFrame); 265 //fLogBox->Associate(this); 275 276 fLogBox = new TGTextView(f, 1, 1/*, -1, 0, TGTextView::GetBlackPixel()*/); 277 if (fFont) 278 fLogBox->SetFont(fFont); 279 fLogBox->Associate(this); 266 280 267 281 // Add List box to the tab … … 334 348 } 335 349 336 337 350 // -------------------------------------------------------------------------- 338 351 // … … 343 356 fStatusBar = new TGStatusBar(this, 1, 1); 344 357 345 fStatusBar->SetParts(2); 358 // 359 // 1-a a 360 // 1: ------|---- 361 // 362 // a/(1-a) = (1-a)/1 363 // a^2+a-1 = 0 364 // a = (-1+-sqrt(1+4))/2 = sqrt(5)/2-1/2 = 0.618 365 // 366 Int_t p[2] = {38, 62}; 367 368 fStatusBar->SetParts(p, 2); 346 369 347 370 TGLayoutHints *layb = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 4, 0, 3); … … 399 422 gROOT->GetListOfCleanups()->Add(this); 400 423 424 fFont = gVirtualX->LoadQueryFont("7x13bold"); 401 425 402 426 // … … 452 476 453 477 delete fList; 478 479 if (fFont) 480 gVirtualX->DeleteFont(fFont); 454 481 455 482 gROOT->GetListOfSpecials()->Remove(this); … … 643 670 } 644 671 672 /* 673 if (...) 674 fMenu->AddPopup("&CaOs", fCaOs, NULL); 675 else 676 fMenu->RemovePopup("CaOs"); 677 fMenu->Resize(fMenu->GetDefaultSize()); 678 MapSubwindows(); 679 MapWindow(); 680 */ 681 645 682 // -------------------------------------------------------------------------- 646 683 // … … 728 765 case kSize1280: 729 766 Resize(1280, 980); 767 return kTRUE; 768 769 case kLogClear: 770 fLogBox->Clear(); 771 return kTRUE; 772 case kLogCopy: 773 fLogBox->Copy(); 774 return kTRUE; 775 case kLogSelect: 776 fLogBox->SelectAll(); 777 return kTRUE; 778 case kLogSearch: 779 //virtual Bool_t Search(const char *string, Bool_t direction, Bool_t caseSensitive); 780 return kTRUE; 781 case kLogSave: 782 SetStatusLine1("Saving log..."); 783 SetStatusLine2(""); 784 *fLog << inf << "Saving log... " << flush; 785 if (fLogBox->GetText()->Save("statusdisplay.log")) 786 { 787 *fLog << "done." << endl; 788 SetStatusLine2("done."); 789 } 790 else 791 { 792 *fLog << "failed!" << endl; 793 SetStatusLine2("Failed!"); 794 } 795 return kTRUE; 796 797 case kLogAppend: 798 SetStatusLine1("Appending logg..."); 799 SetStatusLine2(""); 800 *fLog << inf << "Appending log... " << flush; 801 if (fLogBox->GetText()->Append("statusdisplay.log")) 802 { 803 *fLog << "done." << endl; 804 SetStatusLine2("done."); 805 } 806 else 807 { 808 *fLog << "failed!" << endl; 809 SetStatusLine2("Failed!"); 810 } 730 811 return kTRUE; 731 812 … … 795 876 // -------------------------------------------------------------------------- 796 877 // 878 // Process the kC_TEXTVIEW messages 879 // 880 Bool_t MStatusDisplay::ProcessMessageTextview(Long_t submsg, Long_t mp1, Long_t mp2) 881 { 882 // kC_TEXTVIEW, kTXT_ISMARKED, widget id, [true|false] // 883 // kC_TEXTVIEW, kTXT_DATACHANGE, widget id, 0 // 884 // kC_TEXTVIEW, kTXT_CLICK2, widget id, position (y << 16) | x) // 885 // kC_TEXTVIEW, kTXT_CLICK3, widget id, position (y << 16) | x) // 886 // kC_TEXTVIEW, kTXT_F3, widget id, true // 887 // kC_TEXTVIEW, kTXT_OPEN, widget id, 0 // 888 // kC_TEXTVIEW, kTXT_CLOSE, widget id, 0 // 889 // kC_TEXTVIEW, kTXT_SAVE, widget id, 0 // 890 switch (submsg) 891 { 892 case kTXT_ISMARKED: 893 cout << "Textview-IsMarked #" << mp1 << " " << (mp2?"yes":"no") << endl; 894 return kTRUE; 895 896 case kTXT_DATACHANGE: 897 cout << "Textview-DataChange #" << mp1 << endl; 898 return kTRUE; 899 900 case kTXT_CLICK2: 901 cout << "Textview-Click2 #" << mp1 << " x=" << (mp2&0xffff) << " y= " << (mp2>>16) << endl; 902 return kTRUE; 903 904 case kTXT_CLICK3: 905 cout << "Textview-Click3 #" << mp1 << " x=" << (mp2&0xffff) << " y= " << (mp2>>16) << endl; 906 return kTRUE; 907 908 case kTXT_F3: 909 cout << "Textview-F3 #" << mp1 << endl; 910 return kTRUE; 911 912 case kTXT_OPEN: 913 cout << "Textview-Open #" << mp1 << endl; 914 return kTRUE; 915 916 case kTXT_CLOSE: 917 cout << "Textview-Close #" << mp1 << endl; 918 return kTRUE; 919 920 case kTXT_SAVE: 921 cout << "Textview-Save #" << mp1 << endl; 922 return kTRUE; 923 } 924 925 cout << "Textview: " << "Submsg:" << submsg << " Mp1=" << mp1 << " Mp2=" << mp2 << endl; 926 return kTRUE; 927 } 928 929 // -------------------------------------------------------------------------- 930 // 797 931 // Process the messages from the GUI 798 932 // … … 804 938 case kC_COMMAND: 805 939 return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2); 940 941 case kC_TEXTVIEW: 942 return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2); 806 943 } 807 944 … … 866 1003 fLog->UpdateGui(); 867 1004 1005 /* 868 1006 if (!fLogBox->TestBit(kHasChanged)) 869 1007 return kTRUE; 870 1008 871 fLogBox->MapSubwindows(); 872 fLogBox->Layout(); 873 fLogBox->ResetBit(kHasChanged); 1009 fLogBox->ResetBit(kHasChanged); 1010 */ 874 1011 return kTRUE; 875 1012 } -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.h
r2054 r2058 23 23 24 24 class TGTab; 25 class TG ListBox;25 class TGTextView; 26 26 class TGStatusBar; 27 27 class TGProgressBar; … … 32 32 public: 33 33 typedef enum { 34 kLoopNone, 35 kLoopStop, 36 kFileSave, 37 kFileSaveAs, 38 kFileSaveAsPS, 39 kFileSaveAsRoot, 40 kFileSaveAsGIF, 41 kFileSaveAsC, 42 kFilePrint, 43 kFilePrinterName, 44 kTabSave, 45 kTabSaveAs, 46 kTabSaveAsPS, 47 kTabSaveAsRoot, 48 kTabSaveAsGIF, 49 kTabSaveAsC, 50 kTabPrint, 51 kTabNext, 52 kTabPrevious, 53 kSize640, 54 kSize800, 55 kSize960, 56 kSize1024, 57 kSize1280, 34 // KFile 35 kFileSave, kFileSaveAs, kFileSaveAsPS, kFileSaveAsRoot, 36 kFileSaveAsGIF, kFileSaveAsC, kFilePrint, kFilePrinterName, 58 37 kFileExit, 59 kPicMagic, 60 kPicMars 38 // kLoop 39 kLoopNone, kLoopStop, 40 // kTab 41 kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsRoot, kTabSaveAsGIF, 42 kTabSaveAsC, kTabPrint, kTabNext, kTabPrevious, 43 // kSize 44 kSize640, kSize800, kSize960, kSize1024, kSize1280, 45 // kLog 46 kLogCopy, kLogClear, kLogSelect, kLogSearch, kLogSave, kLogAppend, 47 // kPic 48 kPicMagic, kPicMars 61 49 } Status_t; 62 50 … … 78 66 Int_t fLogIdx; 79 67 TTimer fLogTimer; 80 TGListBox *fLogBox; 68 TGTextView *fLogBox; 69 70 FontStruct_t fFont; 81 71 82 72 void AddMenuBar(); … … 91 81 Bool_t ProcessMessageCommandMenu(Long_t mp1); 92 82 Bool_t ProcessMessageCommand(Long_t submsg, Long_t mp1, Long_t mp2); 83 Bool_t ProcessMessageTextview(Long_t submsg, Long_t mp1, Long_t mp2); 93 84 Bool_t ProcessMessage(Long_t msg, Long_t mp1, Long_t mp2); 94 85 void CloseWindow();
Note:
See TracChangeset
for help on using the changeset viewer.