Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 2157)
+++ trunk/MagicSoft/Mars/Changelog	(revision 2158)
@@ -28,4 +28,10 @@
    * mhist/Makefile, mhist/HistLinkDef.h:
      - added MHCurrents
+
+   * mgui/MCamDisplay.[h,cc]:
+     - changed number of ItemsLegend to display the maximum, too
+
+   * macros/sumcurrents.C:
+     - added
 
 
Index: trunk/MagicSoft/Mars/macros/sumcurrents.C
===================================================================
--- trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2157)
+++ trunk/MagicSoft/Mars/macros/sumcurrents.C	(revision 2158)
@@ -29,5 +29,5 @@
 //  This macro shows how to fill and display a histogram using Mars
 //
-void sumcurrents(const char *fname="../currents/dcs_vega.dat")
+void sumcurrents(const char *fname="../currents/dcs_arcturus.dat")
 {
     //
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2157)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.cc	(revision 2158)
@@ -66,5 +66,5 @@
 #include "MImgCleanStd.h"
 
-#define kItemsLegend 50 // see SetPalette(1,0)
+#define kItemsLegend 48 // see SetPalette(1,0)
 
 ClassImp(MCamDisplay);
@@ -74,6 +74,5 @@
 //  Default Constructor. To be used by the root system ONLY.
 //
-MCamDisplay::MCamDisplay()
-    : fGeomCam(NULL), fAutoScale(kTRUE)
+MCamDisplay::MCamDisplay() : fGeomCam(NULL), fAutoScale(kTRUE)
 {
     fNumPixels = 0;
@@ -90,6 +89,4 @@
     fMinimum = 0;
     fMaximum = 1;
-
-    //fData.Set(0);
 }
 
@@ -99,5 +96,5 @@
 //
 MCamDisplay::MCamDisplay(MGeomCam *geom)
-    : fGeomCam(NULL), fAutoScale(kTRUE), fData(geom->GetNumPixels()), fMinimum(0), fMaximum(1)
+    : fGeomCam(NULL), fAutoScale(kTRUE), fColors(kItemsLegend), fData(geom->GetNumPixels()), fMinimum(0), fMaximum(1)
 {
     fGeomCam = (MGeomCam*)geom->Clone(); 
@@ -139,11 +136,9 @@
 
     fLegend  = new TClonesArray("TBox",  kItemsLegend);
-    fLegText = new TClonesArray("TText", kItemsLegend);
-
-    for (Int_t i = 0; i<kItemsLegend; i++)
-    {
-        TBox  &newbox = *new ((*fLegend)[i])  TBox;
-        TText &newtxt = *new ((*fLegText)[i]) TText;
-
+    fLegText = new TClonesArray("TText", kItemsLegend+1);
+
+    for (Int_t i=0; i<kItemsLegend; i++)
+    {
+        TBox &newbox = *new ((*fLegend)[i])  TBox;
         newbox.SetX1(fRange);
         newbox.SetX2(fRange+w);
@@ -154,5 +149,9 @@
         newbox.SetBit(/*kNoContextMenu|*/kCannotPick);
 #endif
-
+    }
+
+    for (Int_t i=0; i<kItemsLegend+1; i++)
+    {
+        TText &newtxt = *new ((*fLegText)[i]) TText;
         newtxt.SetTextSize(0.025);
         newtxt.SetTextAlign(12);
@@ -344,8 +343,8 @@
     {
         gStyle->SetPalette(51, NULL);
-        Int_t c[50];
-        for (int i=0; i<50; i++)
-            c[49-i] = gStyle->GetColorPalette(i);
-        gStyle->SetPalette(50, c);
+        TArrayI c(kItemsLegend);
+        for (int i=0; i<kItemsLegend; i++)
+            c[kItemsLegend-i-1] = gStyle->GetColorPalette(i);
+        gStyle->SetPalette(kItemsLegend, c.GetArray());
     }
     else
@@ -714,5 +713,5 @@
 void MCamDisplay::UpdateLegend(Float_t minphe, Float_t maxphe, Bool_t islog)
 {
-    for (Int_t i=0; i<kItemsLegend; i+=3)
+    for (Int_t i=0; i<kItemsLegend+1; i+=3)
     {
         const Float_t pos = (Float_t)i/kItemsLegend;
@@ -724,5 +723,5 @@
             val = minphe + pos * (maxphe-minphe);
 
-        TText &txt = *GetText(i);
+        TText &txt = *(TText*)fLegText->At(i);
         txt.SetText(txt.GetX(), txt.GetY(), Form(val<1e6?"%5.1f":"%5.1e", val));
     }
Index: trunk/MagicSoft/Mars/mgui/MCamDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2157)
+++ trunk/MagicSoft/Mars/mgui/MCamDisplay.h	(revision 2158)
@@ -10,4 +10,7 @@
 #ifndef ROOT_TArrayF
 #include <TArrayF.h>
+#endif
+#ifndef ROOT_TArrayI
+#include <TArrayI.h>
 #endif
 #ifndef ROOT_TClonesArray
@@ -40,5 +43,5 @@
     Float_t        fRange;       // the range in millimeters of the present geometry
 
-    Int_t          fColors[50];
+    TArrayI        fColors;
 
     TArrow        *fArrowX;      // Coordinate System
@@ -58,5 +61,4 @@
 
     TBox  *GetBox(Int_t i)  { return (TBox*) fLegend->At(i); }
-    TText *GetText(Int_t i) { return (TText*)fLegText->At(i); }
 
     MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
