Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7819)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 7825)
@@ -265,5 +265,6 @@
     //savemenu->AddEntry("Save status.x&cf",  kFileSaveAsXCF);
     //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF);
-    //savemenu->AddEntry("Save status.&bmp",  kFileSaveAsBMP);
+    savemenu->AddEntry("Save status.&bmp",  kFileSaveAsBMP);
+    savemenu->AddEntry("Save status.&xml",  kFileSaveAsXML);
     savemenu->AddSeparator();
     savemenu->AddEntry(MString::Form("%s&C",    fname.Data()), kFileSaveAsC);
@@ -303,5 +304,6 @@
     //savemenu->AddEntry("Save status.x&cf",  kFileSaveAsXCF);
     //savemenu->AddEntry("Save status.&tiff", kFileSaveAsTIFF);
-    //savemenu->AddEntry("Save status.&bmp",  kFileSaveAsBMP);
+    savemenu->AddEntry("Save status.&bmp",  kFileSaveAsBMP);
+    savemenu->AddEntry("Save status.&xml",  kFileSaveAsXML);
     savemenu2->AddSeparator();
     savemenu2->AddEntry(MString::Form("%s&C",    fname2.Data()), kTabSaveAsC);
@@ -822,4 +824,17 @@
     TRootEmbeddedCanvas *ec = GetEmbeddedCanvas(cf);
     return ec ? ec->GetCanvas() : NULL;
+}
+
+// --------------------------------------------------------------------------
+//
+// Returns the range of tabs containing valid canvases for the condition
+// num.
+//
+void MStatusDisplay::GetCanvasRange(Int_t &from, Int_t &to, Int_t num) const
+{
+    const Int_t max  = gROOT->IsBatch() ? fBatch->GetSize()+1 : fTab->GetNumberOfTabs();
+
+    from = num<0 ?   1 : num;
+    to   = num<0 ? max : num+1;
 }
 
@@ -1510,7 +1525,11 @@
     //    return kTRUE;
 
-    //case kFileSaveAsBMP:
-    //    SaveAsBMP();
-    //    return kTRUE;
+    case kFileSaveAsBMP:
+        SaveAsBMP();
+        return kTRUE;
+
+    case kFileSaveAsXML:
+        SaveAsXML();
+        return kTRUE;
 
     case kFileSaveAsC:
@@ -1562,11 +1581,15 @@
     //    return kTRUE;
 
-    //case kTabSaveAsBMP:
-    //    SaveAsBMP(fTab->GetCurrent());
-    //    return kTRUE;
-
     //case kTabSaveAsTIFF:
     //    SaveAsTIFF(fTab->GetCurrent());
     //    return kTRUE;
+
+    case kTabSaveAsBMP:
+        SaveAsBMP(fTab->GetCurrent());
+        return kTRUE;
+
+    case kTabSaveAsXML:
+        SaveAsXML(fTab->GetCurrent());
+        return kTRUE;
 
     case kTabSaveAsC:
@@ -1918,10 +1941,10 @@
     {
         type = 'M';
-        val /= 1024;
+        val /= 1000;
     }
     if (val>999)
     {
         type = 'G';
-        val /= 1024;
+        val /= 1000;
     }
     const TString txt = MString::Form("%.1f%c", val, type);
@@ -2142,7 +2165,6 @@
     list.Add(&named);
 
-    const Int_t max  = gROOT->IsBatch() ? fBatch->GetSize()+1 : fTab->GetNumberOfTabs();
-    const Int_t from = num<0 ?   1 : num;
-    const Int_t to   = num<0 ? max : num+1;
+    Int_t from, to;
+    GetCanvasRange(from, to, num);
 
     TCanvas *c;
@@ -2305,5 +2327,5 @@
         static_cast<TPostScript&>(vps).Range(psw, psh);
     // if (vps.InheritsFrom(TPDF::Class()))
-    //     static_cast<TPDF&>(vps).Range(psw/2, psh/2);
+    //     static_cast<TPDF&>(vps).Range(psw*0.69, psh*0.69);
     // if (vps.InheritsFrom(TSVG::Class()))
     //     static_cast<TSVG&>(vps).Range(psw, psh);
@@ -2314,6 +2336,6 @@
     if (vps.InheritsFrom(TPostScript::Class()))
         static_cast<TPostScript&>(vps).TextNDC(u, v, string);
-    // if (vps.InheritsFrom(TPDF::Class()))
-    //    static_cast<TPDF&>(vps).TextNDC(u, v, string);
+    if (vps.InheritsFrom(TPDF::Class()))
+        static_cast<TPDF&>(vps).TextNDC(u, v, string);
     // if (vps.InheritsFrom(TSVG::Class()))
     //    static_cast<TSVG&>(vps).TextNDC(u, v, string);
@@ -2406,7 +2428,6 @@
     // Maintain tab numbers
     //
-    const Int_t max  = gROOT->IsBatch() ? fBatch->GetSize()+1 : fTab->GetNumberOfTabs();
-    const Int_t from = num<0 ?   1 : num;
-    const Int_t to   = num<0 ? max : num+1;
+    Int_t from, to;
+    GetCanvasRange(from, to, num);
 
     for (int i=from; i<to; i++)
@@ -2534,5 +2555,5 @@
 Bool_t MStatusDisplay::SaveAsImage(Int_t num, TString name, TImage::EImageFileTypes type)
 {
-//#if ROOT_VERSION_CODE < ROOT_VERSION(4,04,00)
+#if ROOT_VERSION_CODE < ROOT_VERSION(5,12,00)
     if (gROOT->IsBatch())
     {
@@ -2540,5 +2561,5 @@
         return 0;
     }
-//#endif
+#endif
 
     SetStatusLine1("Writing image file...");
@@ -2585,7 +2606,7 @@
 //        ext = AddExtension(name, "cur", num);
 //        break;
-//    case TImage::kBmp:
-//        ext = AddExtension(name, "bmp", num);
-//        break;
+    case TImage::kBmp:
+        ext = AddExtension(name, "bmp", num);
+        break;
 //    case TImage::kXcf:
 //        ext = AddExtension(name, "xcf", num);
@@ -2600,7 +2621,7 @@
 //        ext = AddExtension(name, "tga", num);
 //        break;
-//    case TImage::kXml:
-//        ext = AddExtension(name, "xml", num);
-//        break;
+    case TImage::kXml:
+        ext = AddExtension(name, "xml", num);
+        break;
     default:
         *fLog << warn << "Sorry, unknown or unsupported file type..." << endl;
@@ -2618,6 +2639,6 @@
     // Maintain tab numbers
     //
-    const Int_t from = num<0 ? 1 : num;
-    const Int_t to   = num<0 ? fTab->GetNumberOfTabs() : num+1;
+    Int_t from, to;
+    GetCanvasRange(from, to, num);
 
     for (int i=from; i<to; i++)
@@ -2714,6 +2735,6 @@
     // Maintain tab numbers
     //
-    const Int_t from = num<0 ? 1 : num;
-    const Int_t to   = num<0 ? fTab->GetNumberOfTabs() : num+1;
+    Int_t from, to;
+    GetCanvasRange(from, to, num);
 
     for (int i=from; i<to; i++)
@@ -2819,4 +2840,6 @@
     if (name.EndsWith(".gif"))  return SaveAsGIF(num, name);
     if (name.EndsWith(".png"))  return SaveAsPNG(num, name);
+    if (name.EndsWith(".bmp"))  return SaveAsBMP(num, name);
+    if (name.EndsWith(".xml"))  return SaveAsXML(num, name);
     if (name.EndsWith(".jpg"))  return SaveAsJPG(num, name);
     if (name.EndsWith(".xpm"))  return SaveAsXPM(num, name);
@@ -2841,4 +2864,6 @@
         "Jpeg files",   "*.jpeg",
         "Xpm files",    "*.xpm",
+        "Bmp files",    "*.bmp",
+        "Xml files",    "*.xml",
         "Macro files",  "*.C",
         "ROOT files",   "*.root",
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 7819)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 7825)
@@ -46,6 +46,6 @@
         kFileSaveAsPS, kFileSaveAsPDF, kFileSaveAsSVG, kFileSaveAsRoot,
         kFileSaveAsPNG, kFileSaveAsGIF, kFileSaveAsJPG, kFileSaveAsXPM,
-        /*kFileSaveAsBMP, kFileSaveAsXCF, kFileSaveAsTIFF,*/
-        kFileSaveAsC, kFilePrint, kFilePrinterName,
+        kFileSaveAsBMP, /*kFileSaveAsXCF, kFileSaveAsTIFF,*/
+        kFileSaveAsXML, kFileSaveAsC, kFilePrint, kFilePrinterName,
         kFileClose, kFileExit, kFileReset,
         // kLoop
@@ -54,6 +54,6 @@
         kTabSave, kTabSaveAs, kTabSaveAsPS, kTabSaveAsPDF, kTabSaveAsSVG,
         kTabSaveAsRoot, kTabSaveAsPNG, kTabSaveAsGIF, kTabSaveAsJPG,
-        kTabSaveAsXPM, /*kTabSaveAsBMP, kTabSaveAsXCF, kTabSaveAsTIFF,*/
-        kTabSaveAsC,
+        kTabSaveAsXPM, kTabSaveAsBMP, /*kTabSaveAsXCF, kTabSaveAsTIFF,*/
+        kTabSaveAsXML, kTabSaveAsC,
         kTabPrint, kTabNext, kTabPrevious, kTabRemove,
         // kSize
@@ -154,4 +154,5 @@
     TString PrintDialog(TString &p, TString &c, TString &t, const char *ext=0);
 
+    void GetCanvasRange(Int_t &from, Int_t &to, Int_t num=-1) const;
 
 public:
@@ -220,5 +221,6 @@
      //Bool_t SaveAsTIFF(TString name="") { return SaveAsTIFF(-1, name); }
      //Bool_t SaveAsXCF(TString name="")  { return SaveAsXCF(-1, name); }
-     //Bool_t SaveAsBMP(TString name="")  { return SaveAsBMP(-1, name); }
+     Bool_t SaveAsBMP(TString name="")  { return SaveAsBMP(-1, name); }
+     Bool_t SaveAsXML(TString name="")  { return SaveAsXML(-1, name); }
      Bool_t SaveAsC(TString name="")    { return SaveAsC(-1, name); }
      Int_t  SaveAsRoot(TString name="") { return SaveAsRoot(-1, name); }
@@ -235,5 +237,6 @@
      //Bool_t SaveAsTIFF(Int_t num, TString name="") { return SaveAsImage(num, name, TImage::kTiff); }
      //Bool_t SaveAsXCF(Int_t num, TString name="")  { return SaveAsImage(num, name, TImage::kXcf); }
-     //Bool_t SaveAsBMP(Int_t num, TString name="")  { return SaveAsImage(num, name, TImage::kBmp); }
+     Bool_t SaveAsBMP(Int_t num, TString name="")  { return SaveAsImage(num, name, TImage::kBmp); }
+     Bool_t SaveAsXML(Int_t num, TString name="")  { return SaveAsImage(num, name, TImage::kXml); }
      Bool_t SaveAsC(Int_t num, TString name="");
      Int_t  SaveAsRoot(Int_t num, TString name="");
