Changeset 7887 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 08/19/06 20:22:55 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r7851 r7887 230 230 // 231 231 return (TString)o.GetName()==o.ClassName() ? (TString)o.ClassName() : 232 MString::Form ("%s [%s]", o.GetName(), o.ClassName());232 MString::Format("%s [%s]", o.GetName(), o.ClassName()); 233 233 } 234 234 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r7827 r7887 253 253 filemenu->AddSeparator(); 254 254 255 const TString fname(MString::Form ("Save %s.", gROOT->GetName()));255 const TString fname(MString::Format("Save %s.", gROOT->GetName())); 256 256 MGPopupMenu *savemenu = new MGPopupMenu(gClient->GetRoot()); 257 savemenu->AddEntry(MString::Form ("%s&ps", fname.Data()), kFileSaveAsPS);258 savemenu->AddEntry(MString::Form ("%sp&df", fname.Data()), kFileSaveAsPDF);259 savemenu->AddEntry(MString::Form ("%s&svg", fname.Data()), kFileSaveAsSVG);257 savemenu->AddEntry(MString::Format("%s&ps", fname.Data()), kFileSaveAsPS); 258 savemenu->AddEntry(MString::Format("%sp&df", fname.Data()), kFileSaveAsPDF); 259 savemenu->AddEntry(MString::Format("%s&svg", fname.Data()), kFileSaveAsSVG); 260 260 savemenu->AddSeparator(); 261 savemenu->AddEntry(MString::Form ("%sp&ng", fname.Data()), kFileSaveAsPNG);262 savemenu->AddEntry(MString::Form ("%s&gif", fname.Data()), kFileSaveAsGIF);263 savemenu->AddEntry(MString::Form ("%s&jpg", fname.Data()), kFileSaveAsJPG);264 savemenu->AddEntry(MString::Form ("%s&xpm", fname.Data()), kFileSaveAsXPM);261 savemenu->AddEntry(MString::Format("%sp&ng", fname.Data()), kFileSaveAsPNG); 262 savemenu->AddEntry(MString::Format("%s&gif", fname.Data()), kFileSaveAsGIF); 263 savemenu->AddEntry(MString::Format("%s&jpg", fname.Data()), kFileSaveAsJPG); 264 savemenu->AddEntry(MString::Format("%s&xpm", fname.Data()), kFileSaveAsXPM); 265 265 //savemenu->AddEntry("Save status.x&cf", kFileSaveAsXCF); 266 266 //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF); … … 268 268 savemenu->AddEntry("Save status.&xml", kFileSaveAsXML); 269 269 savemenu->AddSeparator(); 270 savemenu->AddEntry(MString::Form ("%s&C", fname.Data()), kFileSaveAsC);271 savemenu->AddEntry(MString::Form ("%s&root", fname.Data()), kFileSaveAsRoot);270 savemenu->AddEntry(MString::Format("%s&C", fname.Data()), kFileSaveAsC); 271 savemenu->AddEntry(MString::Format("%s&root", fname.Data()), kFileSaveAsRoot); 272 272 savemenu->Associate(this); 273 273 … … 292 292 tabmenu->AddSeparator(); 293 293 294 const TString fname2(MString::Form ("Save %s-i.", gROOT->GetName()));294 const TString fname2(MString::Format("Save %s-i.", gROOT->GetName())); 295 295 MGPopupMenu *savemenu2 = new MGPopupMenu(gClient->GetRoot()); 296 savemenu2->AddEntry(MString::Form ("%s&ps", fname2.Data()), kTabSaveAsPS);297 savemenu2->AddEntry(MString::Form ("%sp&df", fname2.Data()), kTabSaveAsPDF);298 savemenu2->AddEntry(MString::Form ("%s&svg", fname2.Data()), kTabSaveAsSVG);296 savemenu2->AddEntry(MString::Format("%s&ps", fname2.Data()), kTabSaveAsPS); 297 savemenu2->AddEntry(MString::Format("%sp&df", fname2.Data()), kTabSaveAsPDF); 298 savemenu2->AddEntry(MString::Format("%s&svg", fname2.Data()), kTabSaveAsSVG); 299 299 savemenu2->AddSeparator(); 300 savemenu2->AddEntry(MString::Form ("%sp&ng", fname2.Data()), kTabSaveAsPNG);301 savemenu2->AddEntry(MString::Form ("%s&gif", fname2.Data()), kTabSaveAsGIF);302 savemenu2->AddEntry(MString::Form ("%s&jpg", fname2.Data()), kTabSaveAsJPG);303 savemenu2->AddEntry(MString::Form ("%s&xpm", fname2.Data()), kTabSaveAsXPM);300 savemenu2->AddEntry(MString::Format("%sp&ng", fname2.Data()), kTabSaveAsPNG); 301 savemenu2->AddEntry(MString::Format("%s&gif", fname2.Data()), kTabSaveAsGIF); 302 savemenu2->AddEntry(MString::Format("%s&jpg", fname2.Data()), kTabSaveAsJPG); 303 savemenu2->AddEntry(MString::Format("%s&xpm", fname2.Data()), kTabSaveAsXPM); 304 304 //savemenu->AddEntry("Save status.x&cf", kFileSaveAsXCF); 305 305 //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF); … … 307 307 savemenu->AddEntry("Save status.&xml", kFileSaveAsXML); 308 308 savemenu2->AddSeparator(); 309 savemenu2->AddEntry(MString::Form ("%s&C", fname2.Data()), kTabSaveAsC);310 savemenu2->AddEntry(MString::Form ("%s&root", fname2.Data()), kTabSaveAsRoot);309 savemenu2->AddEntry(MString::Format("%s&C", fname2.Data()), kTabSaveAsC); 310 savemenu2->AddEntry(MString::Format("%s&root", fname2.Data()), kTabSaveAsRoot); 311 311 savemenu2->Associate(this); 312 312 … … 440 440 441 441 // Add MARS version 442 TGLabel *l = new TGLabel(f, MString::Form ("Official Release: V%s", MARSVER));442 TGLabel *l = new TGLabel(f, MString::Format("Official Release: V%s", MARSVER)); 443 443 fList->Add(l); 444 444 … … 451 451 452 452 // Add root version 453 l = new TGLabel(f, MString::Form ("Using ROOT v%s", ROOTVER));453 l = new TGLabel(f, MString::Format("Using ROOT v%s", ROOTVER)); 454 454 fList->Add(l); 455 455 … … 660 660 void MStatusDisplay::SetStatusLine2(const MParContainer &cont) 661 661 { 662 SetStatusLine2(MString::Form ("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle()));662 SetStatusLine2(MString::Format("%s: %s", cont.GetDescriptor().Data(), cont.GetTitle())); 663 663 } 664 664 … … 1097 1097 { 1098 1098 // Tell the X-Requester how to call this method 1099 TString str = MString::Form ("%d", (ULong_t)f);1099 TString str = MString::Format("%d", (ULong_t)f); 1100 1100 1101 1101 TMethodCall call(IsA(), "UpdateTab", "NULL"); … … 1272 1272 gSystem->Unlink(tmp); 1273 1273 1274 SetStatusLine2(MString::Form ("Done (%dpage(s))", pages));1274 SetStatusLine2(MString::Format("Done (%dpage(s))", pages)); 1275 1275 1276 1276 return pages; … … 1380 1380 1381 1381 // Code taken from TGTextEdit::Print 1382 const TString pipe = MString::Form ("a2ps -o%s", name.Data());1382 const TString pipe = MString::Format("a2ps -o%s", name.Data()); 1383 1383 FILE *p = gSystem->OpenPipe(pipe, "w"); 1384 1384 if (!p) … … 1493 1493 1494 1494 case kFileTab: 1495 AddTab(MString::Form ("%d", fTab->GetNumberOfTabs()));1495 AddTab(MString::Format("%d", fTab->GetNumberOfTabs())); 1496 1496 return kTRUE; 1497 1497 … … 1683 1683 SetStatusLine2(""); 1684 1684 *fLog << inf << "Saving log... " << flush; 1685 if (fLogBox->GetText()->Save(MString::Form ("%s.log", gROOT->GetName())))1685 if (fLogBox->GetText()->Save(MString::Format("%s.log", gROOT->GetName()))) 1686 1686 { 1687 1687 *fLog << "done." << endl; … … 1699 1699 SetStatusLine2(""); 1700 1700 *fLog << inf << "Appending log... " << flush; 1701 if (fLogBox->GetText()->Append(MString::Form ("%s.log", gROOT->GetName())))1701 if (fLogBox->GetText()->Append(MString::Format("%s.log", gROOT->GetName()))) 1702 1702 { 1703 1703 *fLog << "done." << endl; … … 1948 1948 void MStatusDisplay::UpdateMemory() const 1949 1949 { 1950 const TString path = MString::Form ("/proc/%d/status", gSystem->GetPid());1950 const TString path = MString::Format("/proc/%d/status", gSystem->GetPid()); 1951 1951 if (gSystem->AccessPathName(path, kFileExists)) 1952 1952 return; … … 1970 1970 val /= 1000; 1971 1971 } 1972 const TString txt = MString::Form ("%.1f%c", val, type);1972 const TString txt = MString::Format("%.1f%c", val, type); 1973 1973 fStatusBar->SetText(txt, 2); 1974 1974 } … … 2464 2464 } 2465 2465 2466 SetStatusLine2(MString::Form ("Tab #%d", i));2466 SetStatusLine2(MString::Format("Tab #%d", i)); 2467 2467 2468 2468 // … … 2526 2526 PSToolsTextNDC(*ps, 0.5, 1.015, TString("MARS - Magic Analysis and Reconstruction Software - ")+d.AsString()); 2527 2527 ps->SetTextAlign(31); // right top 2528 PSToolsTextNDC(*ps, 1, 1.015, MString::Form ("Page No.%i (%i) ", page++, i));2528 PSToolsTextNDC(*ps, 1, 1.015, MString::Format("Page No.%i (%i) ", page++, i)); 2529 2529 line.PaintLineNDC(0, 1.01, 1, 1.01); 2530 2530 … … 2570 2570 *fLog << inf << "done." << endl; 2571 2571 2572 SetStatusLine2(MString::Form ("Done (%dpages)", page-1));2572 SetStatusLine2(MString::Format("Done (%dpages)", page-1)); 2573 2573 2574 2574 return page-1; … … 2675 2675 } 2676 2676 2677 SetStatusLine2(MString::Form ("Tab #%d", i));2677 SetStatusLine2(MString::Format("Tab #%d", i)); 2678 2678 2679 2679 // … … 2771 2771 } 2772 2772 2773 SetStatusLine2(MString::Form ("Tab #%d", i));2773 SetStatusLine2(MString::Format("Tab #%d", i)); 2774 2774 2775 2775 // -
trunk/MagicSoft/Mars/mbase/MString.cc
r5713 r7887 120 120 // M/TString. 121 121 // 122 MString MString::Form (const char *fmt, ...)122 MString MString::Format(const char *fmt, ...) 123 123 { 124 124 va_list ap; … … 129 129 return ret; 130 130 } 131 132 // -------------------------------------------------------------------------- 133 // 134 // This is my implementation for root versions prior to 5.12/00 where 135 // TString::Form didn't exist. 136 // 137 void MString::Form(const char *fmt, ...) 138 { 139 va_list ap; 140 va_start(ap, fmt); 141 142 Print(fmt, ap); 143 } -
trunk/MagicSoft/Mars/mbase/MString.h
r7804 r7887 18 18 MString &Print(const char *fmt, ...); 19 19 20 #ifndef __CINT__ 21 static MString Form(const char *fmt, ...); 22 #endif 20 static MString Format(const char *fmt, ...); 21 22 void Form(const char *fmt, ...); 23 23 24 24 ClassDef(MString, 1) // Tool to make Form() thread safe against other TStrings -
trunk/MagicSoft/Mars/mbase/MTask.cc
r7838 r7887 361 361 // 362 362 if (fName==ClassName()) 363 return fSerialNumber==0 ? (TString)ClassName() : MString::Form ("%s;%d", ClassName(), fSerialNumber);363 return fSerialNumber==0 ? (TString)ClassName() : MString::Format("%s;%d", ClassName(), fSerialNumber); 364 364 365 365 return fSerialNumber>0 ? 366 MString::Form ("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) :367 MString::Form ("%s [%s]", fName.Data(), ClassName());366 MString::Format("%s;%d [%s]", fName.Data(), fSerialNumber, ClassName()) : 367 MString::Format("%s [%s]", fName.Data(), ClassName()); 368 368 } 369 369
Note:
See TracChangeset
for help on using the changeset viewer.