Index: trunk/SophyaPI/PIext/pihisto2d.cc
===================================================================
--- trunk/SophyaPI/PIext/pihisto2d.cc	(revision 2232)
+++ trunk/SophyaPI/PIext/pihisto2d.cc	(revision 2234)
@@ -41,4 +41,5 @@
 UseDyn();
 UseFrac();
+SetStats();
 SetName("Histo2DDrw"); 
 // PIHisto2D has specific control tools
@@ -187,6 +188,6 @@
 printf("                 Dyn=%g,%g Frac=%g,%g LogSc=%g H=%p\n"
       ,mHMin,mHMax,mFracMin,mFracMax,mLogScale,mHisto);
-if(lp<1) return;
-mHisto->PrintStatus();
+if(lp>=1) mHisto->PrintStatus();
+fflush(stdout);
 }
 
@@ -278,5 +279,6 @@
 
 // gestion epaisseur de ligne
-if (GetGraphicAtt().GetLineAtt() == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
+PILineAtt LineAtt = GetGraphicAtt().GetLineAtt();
+if(LineAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
 
 // gestion Markers ou plot avec des points.
@@ -369,8 +371,9 @@
 g->SelForeground(coul);
 g->SelFontSzPt(FontSize,FontAtt);
+g->SelLine(LineAtt);
 if (cmap) delete cmap;
 
 // Fin du dessin, ecriture de la statistique.
-DrawStats(g);
+if(stats) DrawStats(g);
 }
 
@@ -457,6 +460,6 @@
 //|         .   ==> 0<valeur<1
 //|------------------------------------------
-//|            C1111111111222222222233333333
-//|  C01234567890123456789012345678901234567
+//|             1111111111222222222233333333
+//|   01234567890123456789012345678901234567
 //| " .+23456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*"
 //|------------------------------------------
@@ -486,4 +489,110 @@
 //      ,dx,dy,dxg,dyg,np);
 return np;
+}
+
+//++
+int PIHisto2D::DecodeOptionString(vector<string> & opt, bool rmdecopt)
+//
+//	Decodage des options
+//--
+{
+  int optsz1 = opt.size();
+  if(optsz1<1) return(0); 
+  int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt);
+  if(optsz1-ndec1<1) return(ndec1);  // si tout a ete decode
+
+  vector<string> udopt;  // On gardera ici les options non decodees
+  unsigned int k = 0;
+  int ndec = opt.size();
+  bool listopt=false;
+  for( k=0; k<opt.size(); k++ ) {
+    string opts = opt[k];
+    if(opts=="h2help") {
+      string info; GetOptionsHelpInfo(info);
+      size_t q = info.find("PIHisto2D");
+      if(q<info.length()-1) cout<<info.substr(q)<<endl;
+    } else if(opts=="h2list") {
+      listopt=true;
+    } else if(opts=="sta" || opts=="stat" || opts=="stats") {
+      SetStats(true);
+    } else if(  opts=="nsta"   || opts=="nstat"
+             || opts=="nostat" || opts=="nostats") {
+      SetStats(false);
+    } else if(opts.substr(0,8)=="h2scale=") {
+      unsigned short t=TypScale(); float ls=LogScale();
+      if(opts.substr(8,3)=="lin") t=0;
+      else if(opts.substr(8,3)=="log")
+        {t=1; sscanf(opts.c_str(),"h2scale=log,%g",&ls);}
+      UseScale(t,ls);
+    } else if(opts.substr(0,7)=="h2disp=") {
+      unsigned short t=TypDisplay(); float fpts=FPoints();
+      if(opts.substr(7,3)=="var") t=0;
+      else if(opts.substr(7,3)=="hbk") t=2;
+      else if(opts.substr(7,3)=="img") t=3;
+      else if(opts.substr(7,3)=="pts")
+        {t=1; sscanf(opts.c_str(),"h2disp=pts,%g",&fpts);}
+      UseDisplay(t,fpts);
+    } else if(opts.substr(0,6)=="h2dyn=") {
+      float hmin=HMin(),hmax=HMax(); size_t q = opts.find(',');
+      sscanf(opts.c_str(),"h2dyn=%g",&hmin);
+      if(q<opts.length()-1) sscanf(opts.substr(q+1).c_str(),"%g",&hmax);
+      UseDyn(hmin,hmax);
+    } else if(opts.substr(0,7)=="h2frac=") {
+      float fmin=FMin(),fmax=FMax(); size_t q = opts.find(',');
+      sscanf(opts.c_str(),"h2frac=%g",&fmin);
+      if(q<opts.length()-1) sscanf(opts.substr(q+1).c_str(),"%g",&fmax);
+      UseFrac(fmin,fmax);
+    } else if(opts.substr(0,6)=="h2col=") {
+      bool fcol=Color(); CMapId cmid=ColMap(); bool rmap=IsColMapRev();
+      if(opts.find(",rev")<opts.length()-1) rmap=true;
+      if(opts.find(",nor")<opts.length()-1) rmap=false;
+      for(int k=0; k<PIColorMap::NumberStandardColorMaps(); k++) {
+        string cn=PIColorMap::GetStandardColorMapName(k);
+        for(unsigned int j=0; j<cn.length(); j++) cn[j]=tolower(cn[j]);
+        if(opts.find(cn)<opts.length()-1)
+          {fcol=true; cmid=PIColorMap::GetStandardColorMapId(k); break;}
+      }
+      UseColors(fcol,cmid,rmap);
+   } else {
+      ndec--;
+      // S'il faut supprimer les options decodees
+      if (rmdecopt)  udopt.push_back(opts);
+    }
+  }
+  // S'il faut supprimer les options decodees, on remplace l'argument opt
+  // par le vecteur des options non decodees.
+  if (rmdecopt)  opt = udopt;
+  // Liste des options si demande
+  if(listopt) Print();
+  return(ndec+ndec1);
+}
+
+//++
+void PIHisto2D::GetOptionsHelpInfo(string& info)
+//
+//	Help relatif au options
+//--
+{
+// On recupere d'abord la chaine info de la classe de base
+PIDrawer::GetOptionsHelpInfo(info);
+info += " ---- PIHisto2D options help info (see also ALT-O): \n" ;
+info += "- h2help: get this help text\n";
+info += "- h2list: list choosen options\n";
+info += "- sta,stat,stats:            activate   statistic display\n";
+info += "  nsta,nstat,nostat,nostats: deactivate statistic display\n";
+info += "- h2disp=typ[,fracpts]: choose display type\n";
+info += "    typ=var: variable size boxes\n";
+info += "    typ=hbk: \"a la hbook2\"\n";
+info += "    typ=img: image like (use \"h2col\" for color map)\n";
+info += "    typ=pts: point clouds (fracpts=max possible fraction\n";
+info += "             of used pixels per bin [0,1])\n";
+info += "- h2scale=lin/log[,logscale]: choose linear or logarithmic scale\n";
+info += "- h2dyn=[hmin][,hmax]: choose histogramme range for display\n";
+info += "- h2col=[colname][,colsigne] : color table\n";
+info += "    colname: name of color table (ex: grey32,midas_heat,...)\n";
+info += "             (see general graphicatt description)\n";
+info += "    colsigne: reverse (\"rev\") or normal (\"nor\") color table\n";
+info += "- h2frac=[fmin][,fmax]: choose sub-range display [0,1]\n";
+return;
 }
 
@@ -625,5 +734,5 @@
 mOPop[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-// Menu du choix des couleurs
+// Menu du choix de la table des couleurs
   cpy += bsy+spy;
 mOPop[2] = new PIOptMenu(this,"optmen-h2d-3",2*bsx,bsy,cpx,cpy);
Index: trunk/SophyaPI/PIext/pihisto2d.h
===================================================================
--- trunk/SophyaPI/PIext/pihisto2d.h	(revision 2232)
+++ trunk/SophyaPI/PIext/pihisto2d.h	(revision 2234)
@@ -13,4 +13,5 @@
 
 #include "histos2.h"
+#include "pidrawer.h"
 #include "piscdrawwdg.h"
 
@@ -30,7 +31,9 @@
   virtual void Draw(PIGraphicUC* g,double xmin,double ymin,double xmax,double ymax);
 
-  //   AppendTextInfo a faire un jour - Reza 21/01/2002 
-  //  virtual void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax);
+  //AppendTextInfo a faire un jour - Reza 21/01/2002 
+  //virtual void AppendTextInfo(string& info,double xmin,double ymin
+  //                           ,double xmax,double ymax);
 
+  // Ce que fait l'action de clic avec la souris
   virtual void GetClickInfo(string& info, double x, double y
                            ,double x0=0.,double y0=0.,bool fgdiff=false); 
@@ -38,10 +41,16 @@
   virtual void UpdateLimits();
   virtual void DrawStats(PIGraphicUC* g);
+  inline  void SetStats(bool fg=true) {stats=fg;}
 
-//  Methode permettant l'affichage d'une fenetre de controle specialisee 
+  //  Methode permettant l'affichage d'une fenetre de controle specialisee 
   virtual void ShowControlWindow(PIBaseWdgGen* wdg);
-//  Desactivation de la fenetre de controle specialisee
+  //  Desactivation de la fenetre de controle specialisee
   virtual void DeactivateControlWindow(PIBaseWdgGen* wdg);
 
+  //   Methode de decodage des options
+  virtual int  DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
+  virtual void GetOptionsHelpInfo(string& info);
+
+  // Methodes inline
   inline Histo2D*       Histogram()   {return(mHisto);}
   inline bool           Color()       {return(mFgCol);}
@@ -62,5 +71,5 @@
 
   Histo2D* mHisto;
-  bool mAdDO;
+  bool mAdDO; bool stats;
   bool mFgCol; CMapId mCmap; bool mRevCmap;
   unsigned short mTypScal; float mLogScale;
