Index: trunk/SophyaPI/PI/pibwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/pibwdggen.cc	(revision 106)
+++ trunk/SophyaPI/PI/pibwdggen.cc	(revision 107)
@@ -16,4 +16,6 @@
 mWGrC = NULL;   // PIGraphic (Contexte graphique) associe a la fenetre}
                 // Doit etre cree par PIBaseWdgX/Mac/... 
+SetDefaultDrawRectangle(0., 0., 1., 1., true);
+SetDefaultDrawerLimits(0., 1., 0., 1., kAxeDirLtoR, kAxeDirUpDown);
 }
 
@@ -36,8 +38,14 @@
 }
 
+// On met une variable pour eviter des boucles infinies entre les deux methodes 
+// Draw(PIGraphic* g, int, int, int, int) et Draw(PIGraphic* g) 
+static int fgdrawloop = 0;
+
 /* --Methode-- */
 void PIBaseWdgGen::Draw(PIGraphic* g, int /*x0*/, int /*y0*/, int /*dx*/, int /*dy*/)
 {
-this->Draw(g);
+if (fgdrawloop == 0) 
+  { fgdrawloop=1;  Draw(g); }
+fgdrawloop = 0;
 return;
 }
@@ -49,5 +57,7 @@
 puts("Debug_PIBaseWdgGen::Draw() Efface la fenetre par defaut ! ");
 #endif
-this->EraseWindow();
+if (fgdrawloop == 0) 
+  { fgdrawloop=2;  Draw(g, 0, 0, XSize(), YSize()); }
+fgdrawloop = 0;
 return;
 }
@@ -169,13 +179,31 @@
 }
 
-
-/* --Methode-- */
-int PIBaseWdgGen::AddDrawer(PIDrawer* drw, int x0, int y0, int dx, int dy, bool ad)
+/* --Methode-- */
+void PIBaseWdgGen::SetDefaultDrawRectangle(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, bool psz)
+{
+mDrX1 = x1;  mDrY1 = y1;
+mDrX2 = x2;  mDrY2 = y2;   mDrElastic = psz;
+}
+
+/* --Methode-- */
+void PIBaseWdgGen::SetDefaultDrawerLimits(float xmin, float xmax, float ymin, float ymax,
+                                          int axrl, int ayud)
+{
+mDrXmin = xmin;   mDrXmax = xmax; 
+mDrYmin = ymin;   mDrYmax = ymax; 
+mDXdir = axrl;    mDYdir = ayud;
+}
+
+
+/* --Methode-- */
+int PIBaseWdgGen::AddDrawer(PIDrawer* drw, PIGrCoord x1, PIGrCoord y1,  
+                            PIGrCoord x2, PIGrCoord y2, bool psz, bool ad)
 {
 if (drw == NULL)   return(0);
 mDrwId++;
 BWDrwId did;
-did.x0 = x0;  did.y0 = y0;
-did.dx = dx;  did.dy = dy;
+did.x1 = x1;  did.y1 = y1;
+did.x2 = x2;  did.y2 = y2;
+did.autoszp = did.autolim = false;   did.elastic = psz;
 did.id = mDrwId;  did.ad = ad; 
 did.drw = drw;
@@ -186,11 +214,29 @@
 
 /* --Methode-- */
-void PIBaseWdgGen::MoveResizeDrawer(int id, int x0, int y0, int dx, int dy)
-{
-list<BWDrwId>::iterator it;
+int PIBaseWdgGen::AddDrawer(PIDrawer* drw, bool autolim, bool ad)
+{
+if (drw == NULL)   return(0);
+mDrwId++;
+BWDrwId did;
+did.x1 = 0.;  did.y1 = 0.;
+did.x2 = 1.;  did.y2 = 1.;
+did.autoszp = true;   did.autolim = autolim;   did.elastic = false;
+did.id = mDrwId;  did.ad = ad; 
+did.drw = drw;
+mDrwList.push_back(did);
+drw->Attach(this, mDrwId);
+return(mDrwId);
+}
+
+
+/* --Methode-- */
+void PIBaseWdgGen::MoveResizeDrawer(int id,  PIGrCoord x1, PIGrCoord y1,  PIGrCoord x2, PIGrCoord y2, bool psz)
+{
+vector<BWDrwId>::iterator it;
 for(it = mDrwList.begin(); it != mDrwList.end(); it++)  
   if ((*it).id == id) { 
-    (*it).x0 = x0;  (*it).y0 = y0;
-    (*it).dx = dx;  (*it).dy = dy;
+    (*it).x1 = x1;  (*it).y1 = y1;
+    (*it).x2 = x2;  (*it).y2 = y2;
+    (*it).elastic = psz;
     break;
   }
@@ -202,5 +248,5 @@
 {
 if (mAdfg)  return;
-list<BWDrwId>::iterator it;
+vector<BWDrwId>::iterator it;
 for(it = mDrwList.begin(); it != mDrwList.end(); it++)
   if ((*it).id == id) 
@@ -213,5 +259,5 @@
 {
 mAdfg = true;
-list<BWDrwId>::iterator it;
+vector<BWDrwId>::iterator it;
 for(it = mDrwList.begin(); it != mDrwList.end(); it++)  
   if ((*it).ad)  delete (*it).drw;
@@ -221,4 +267,27 @@
 }
 
+/* --Methode-- */
+int PIBaseWdgGen::NbDrawers()
+{
+return(mDrwList.size());
+}
+
+
+/* --Methode-- */
+PIDrawer* PIBaseWdgGen::GetDrawer(int n)
+{
+if ( (n < 0) || (n >= mDrwList.size()) ) return(NULL);
+return(mDrwList[n].drw);
+}
+
+/* --Methode-- */
+PIDrawer* PIBaseWdgGen::GetDrawerId(int id)
+{
+vector<BWDrwId>::iterator it;
+for(it = mDrwList.begin(); it != mDrwList.end(); it++)  
+  if ((*it).id == id)  return((*it).drw);
+return(NULL);
+}
+
 
 /* --Methode-- */
@@ -227,41 +296,113 @@
 float xmin,ymin, xmax, ymax;
 PIGraphicUC* guc;
+int drx0, dry0, drdx, drdy;
+int ddrx0, ddry0, ddrdx, ddrdy;
+
+if (mDrElastic) { 
+  ddrx0 = (int)((float) mDrX1 * (float)XSize());
+  ddry0 = (int)((float) mDrY1 * (float)YSize());
+  ddrdx = (int)((float) mDrX2 * (float)XSize()) - ddrx0 ;
+  ddrdy = (int)((float) mDrY2 * (float)YSize()) - ddry0 ;
+  }
+else {
+  ddrx0 = (int)mDrX1;   ddry0 = (int)mDrY1;  
+  ddrdx = (int)mDrX2-ddrx0;   ddrdy = (int)mDrY2-ddry0;  
+  }
 
 bool sxy = false;
 if ((dx > 0) && (dy > 0))  sxy = true;
 
-list<BWDrwId>::iterator it;
+vector<BWDrwId>::iterator it;
 bool fgc=false;
 for(it = mDrwList.begin(); it != mDrwList.end(); it++) {
   g->SaveGraphicAtt();
-  guc = (*it).drw->SetDrwWdg(this, (*it).x0, (*it).y0, (*it).dx, (*it).dy, g);
-  g->SetClipRectangle((*it).x0, (*it).y0, (*it).dx , (*it).dy);
+  if ( (*it).autoszp )   // Taille/position  par defaut impose par PIBaseWdg 
+    { drx0 = ddrx0;  dry0 = ddry0;   drdx = ddrdx;  drdy = ddrdy; } 
+  else {
+    if ( (*it).elastic  ) {   // Taille/position defin en fraction de la taille du PIBaseWdg
+      drx0 = (int)((float)(*it).x1 * (float)XSize());
+      dry0 = (int)((float)(*it).y1 * (float)YSize());
+      drdx = (int)((float)(*it).x2 * (float)XSize()) - drx0 ;
+      drdy = (int)((float)(*it).y2 * (float)YSize()) - dry0 ;
+      }
+    else {
+      drx0 = (int)(*it).x1 ;  dry0 = (int)(*it).y1 ; 
+      drdx = (int)(*it).x2-drx0 ;  drdy = (int)(*it).y2-dry0 ; 
+      }
+    }
+// L'ordre des operations ici est importante 
+  if ( (*it).autolim )  
+     (*it).drw->SetLimits(mDrXmin, mDrXmax, mDrYmin, mDrYmax, mDXdir, mDYdir);
+  guc = (*it).drw->SetDrwWdg(this, drx0, dry0, drdx, drdy, g);
+  g->SetClipRectangle(drx0, dry0, drdx , drdy);
+  (*it).drw->SelGraAtt(guc);
   fgc = true;
   if (sxy) {
     guc->GrC2UC(x0, y0, xmin, ymin);
     guc->GrC2UC(x0+dx, y0+dy, xmax, ymax);
+    }
+  else {
+    guc->GrC2UC(0, 0, xmin, ymin);
+    guc->GrC2UC(XSize(), YSize(), xmax, ymax);    
+    } 
+  if (xmin > xmax)  swap(xmin,xmax);
+  if (ymin > ymax)  swap(ymin,ymax);
+  (*it).drw->Draw(guc, xmin, ymin, xmax, ymax);
+  g->RestoreGraphicAtt();
+  }
+if (fgc)  g->ClearClipRectangle();
+
+return;
+}
+
+/* --Methode-- */
+void PIBaseWdgGen::CallDrawer(int id)
+{
+float xmin,ymin, xmax, ymax;
+PIGraphicUC* guc;
+int drx0, dry0, drdx, drdy;
+int ddrx0, ddry0, ddrdx, ddrdy;
+
+PIGraphic* g = WindowGraphic();
+
+if (mDrElastic) { 
+  ddrx0 = (int)((float) mDrX1 * (float)XSize());
+  ddry0 = (int)((float) mDrY1 * (float)YSize());
+  ddrdx = (int)((float) mDrX2 * (float)XSize()) - ddrx0 ;
+  ddrdy = (int)((float) mDrY2 * (float)YSize()) - ddry0 ;
+  }
+else {
+  ddrx0 = (int)mDrX1;   ddry0 = (int)mDrY1;  
+  ddrdx = (int)mDrX2-ddrx0;   ddrdy = (int)mDrY2-ddry0;  
+  }
+vector<BWDrwId>::iterator it;
+for(it = mDrwList.begin(); it != mDrwList.end(); it++) 
+  if ((*it).id == id) {
+    g->SaveGraphicAtt();
+    if ( (*it).autoszp )   // Taille/position  par defaut impose par PIBaseWdg 
+      { drx0 = ddrx0;  dry0 = ddry0;   drdx = ddrdx;  drdy = ddrdy; } 
+    else {
+      if ( (*it).elastic  ) {   // Taille/position defin en fraction de la taille du PIBaseWdg
+        drx0 = (int)((float)(*it).x1 * (float)XSize());
+        dry0 = (int)((float)(*it).y1 * (float)YSize());
+        drdx = (int)((float)(*it).x2 * (float)XSize()) - drx0 ;
+        drdy = (int)((float)(*it).y2 * (float)YSize()) - dry0 ;
+        }
+      else {
+        drx0 = (int)(*it).x1 ;  dry0 = (int)(*it).y1 ; 
+        drdx = (int)(*it).x2-drx0 ;  drdy = (int)(*it).y2-dry0 ; 
+        }
+      }
+// L'ordre des operations ici est importante 
+    if ( (*it).autolim )  
+       (*it).drw->SetLimits(mDrXmin, mDrXmax, mDrYmin, mDrYmax, mDXdir, mDYdir);
+    guc = (*it).drw->SetDrwWdg(this, drx0, dry0, drdx, drdy, g);
+    g->SetClipRectangle(drx0, dry0, drdx , drdy);
+    (*it).drw->SelGraAtt(guc);
+    guc->GrC2UC(0, 0, xmin, ymin);
+    guc->GrC2UC(XSize(), YSize(), xmax, ymax);     
     if (xmin > xmax)  swap(xmin,xmax);
     if (ymin > ymax)  swap(ymin,ymax);
     (*it).drw->Draw(guc, xmin, ymin, xmax, ymax);
-  }
-  else (*it).drw->Draw(guc);
-  g->RestoreGraphicAtt();
-  }
-if (fgc)  g->ClearClipRectangle();
-
-return;
-}
-
-/* --Methode-- */
-void PIBaseWdgGen::CallDrawer(PIGraphicGen* g, int id)
-{
-PIGraphicUC* guc;
-list<BWDrwId>::iterator it;
-for(it = mDrwList.begin(); it != mDrwList.end(); it++) 
-  if ((*it).id == id) {
-    g->SaveGraphicAtt();
-    guc = (*it).drw->SetDrwWdg(this, (*it).x0, (*it).y0, (*it).dx, (*it).dy, g);
-    g->SetClipRectangle((*it).x0, (*it).y0, (*it).dx , (*it).dy);
-    (*it).drw->Draw(guc);
     g->RestoreGraphicAtt();    
     g->ClearClipRectangle();
Index: trunk/SophyaPI/PI/pibwdggen.h
===================================================================
--- trunk/SophyaPI/PI/pibwdggen.h	(revision 106)
+++ trunk/SophyaPI/PI/pibwdggen.h	(revision 107)
@@ -7,8 +7,9 @@
 #include PICMAP_H
 #include PIGRAPHIC_H
+#include "pigraphuc.h"
 #include "psfile.h"
 
 // Mettre dans cet ordre, sinon g++ a des problemes   
-#include <list>   
+#include <vector>   
 
 enum PIKeyModifier { PIKM_Blank = 0, PIKM_Shift = 1, PIKM_Alt = 2, PIKM_Cntl = 4 } ; 
@@ -78,26 +79,43 @@
   virtual void       PSPrint(PSFile* psf, int ofx = 0, int ofy = 0);
 
-// Gestion des Drawers 
+// ------ Gestion des Drawers  ------
   friend class PIDrawer;
-          int        AddDrawer(PIDrawer* drw, int x0, int y0, int dx, int dy, 
-                               bool ad=false);
-          void       MoveResizeDrawer(int id, int x0, int y0, int dx, int dy);
+          void       SetDefaultDrawRectangle(PIGrCoord x1, PIGrCoord y1, 
+                                             PIGrCoord x2, PIGrCoord y2, bool psz=true); 
+          void       SetDefaultDrawerLimits(float xmin, float xmax, float ymin, float ymax,
+                                            int axrl=kAxeDirSame, int ayud=kAxeDirSame); 
+          int        AddDrawer(PIDrawer* drw, PIGrCoord x1, PIGrCoord y1, 
+                               PIGrCoord x2, PIGrCoord y2, 
+                               bool psz=true, bool ad=false);
+          int        AddDrawer(PIDrawer* drw, bool autolim=false, bool ad=false);
+          void       MoveResizeDrawer(int id, PIGrCoord x1, PIGrCoord y1, 
+                                      PIGrCoord x2, PIGrCoord y2, bool psz=true);
           void       RemoveDrawer(int id);       // Ote un drawer de la liste
           void       DeleteDrawers();            // Ote et detruit tous les drawers
+// Acces aux drawers 
+          int        NbDrawers();
+          PIDrawer*  GetDrawerId(int id);   
+          PIDrawer*  GetDrawer(int n);   
 
 //  Trace des Drawers ...          
   virtual void       CallDrawers(PIGraphicGen* g, int x0=0, int y0=0, int dx=0, int dy=0); 
-  virtual void       CallDrawer(PIGraphicGen* g, int id);
+  virtual void       CallDrawer(int id);
 
 // Devrait etre protected - mis ici a cause de cxx  11/07/97  Reza
-  struct BWDrwId { int x0, y0; int dx, dy; int id; bool ad; PIDrawer* drw; };
+  struct BWDrwId { int id; PIGrCoord x1, y1, x2, y2; bool autoszp, autolim, elastic, ad;  PIDrawer* drw; };
 
   virtual PIGraphic*  WindowGraphic();
 
+// -------------- Variables membre protegees -------------------
 protected:
   PIGraphicWin* mWGrC;  // PIGraphic (Contexte graphique) associe a la fenetre
-  bool mAdfg;
-  int mDrwId;
-  list<BWDrwId> mDrwList;
+  bool mAdfg;           // Pour la gestion de DeleteDrawers() quand appele par delete de PIBaseWdg
+  int mDrwId;           // Compteur pour DrawerId
+  vector<BWDrwId> mDrwList;
+//  Definition de la zone de trace et limites UC des drawers par defaut  
+  PIGrCoord mDrX1, mDrY1,  mDrX2,  mDrY2;  
+  bool mDrElastic;   // true --> Coord en fraction de la taille 
+  float mDrXmin, mDrXmax, mDrYmin, mDrYmax;   // Limites par defaut - UC
+  int  mDXdir, mDYdir;                        // Sens des axes par defaut
 
 };
Index: trunk/SophyaPI/PI/pidrawer.cc
===================================================================
--- trunk/SophyaPI/PI/pidrawer.cc	(revision 106)
+++ trunk/SophyaPI/PI/pidrawer.cc	(revision 107)
@@ -13,4 +13,11 @@
   SetAxesFlags(kAxesDflt);
   mDndfg = false;  // Pour controle de l'appel de Detach() si delete
+
+  mFCol = mBCol = PI_NotDefColor;
+  mLAtt = PI_NotDefLineAtt;
+  mFSz = PI_NotDefFontSize;
+  mFAtt = PI_NotDefFontAtt;
+  mMSz = -1;
+  mMrk = PI_NotDefMarker;
 }
 
@@ -44,4 +51,59 @@
 }
 
+
+void
+PIDrawer::UpdateSize()
+{
+// Ne fait rien !
+  return;
+}
+
+void
+PIDrawer::Refresh()
+{
+  list<DrwBWId>::iterator it;
+  for(it = mBWdgList.begin(); it != mBWdgList.end(); it++)
+         (*it).wdg->CallDrawer((*it).id);
+
+}
+
+void 
+PIDrawer::SetColAtt(PIColors fg, PIColors bg)
+{
+  if (fg != PI_NotDefColor) mFCol = fg;
+  if (bg != PI_NotDefColor) mBCol = bg;
+}
+
+void 
+PIDrawer::SetLineAtt(PILineAtt lat)
+{
+  if (lat != PI_NotDefLineAtt) mLAtt = lat;
+}
+
+void 
+PIDrawer::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
+{
+  if (fsz != PI_NotDefFontSize) mFSz = fsz;
+  if (fat != PI_NotDefFontAtt) mFAtt = fat;
+}
+
+void 
+PIDrawer::SetMarkerAtt(int sz, PIMarker mrk)
+{
+  if (sz >= 0)  mMSz = sz;
+  if (mrk != PI_NotDefMarker) mMrk = mrk;
+}
+
+void 
+PIDrawer::SelGraAtt(PIGraphicUC* g)
+{
+  if (mFCol != PI_NotDefColor)    g->SelForeground(mFCol);
+  if (mBCol != PI_NotDefColor)    g->SelBackground(mBCol);
+  if (mLAtt != PI_NotDefLineAtt)  g->SelLine(mLAtt);
+  if ( (mFSz != PI_NotDefFontSize) || (mFAtt != PI_NotDefFontAtt) )
+                                  g->SelFont(mFSz, mFAtt);
+  if ( (mMrk != PI_NotDefMarker) || (mMSz >= 0) )
+                                  g->SelMarker(mMSz, mMrk);
+}
 
 void
@@ -234,13 +296,8 @@
 
   
-void
-PIDrawer::Draw(PIGraphicUC*)
-{
-}
 
 void
 PIDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float /*ymin*/, float /*xmax*/, float /*ymax*/)
 {
-Draw(g);
 }
 
Index: trunk/SophyaPI/PI/pidrawer.h
===================================================================
--- trunk/SophyaPI/PI/pidrawer.h	(revision 106)
+++ trunk/SophyaPI/PI/pidrawer.h	(revision 107)
@@ -30,6 +30,8 @@
   virtual void       SetAxesFlags(int flags=kAxesDflt);
     
-  virtual void       Draw(PIGraphicUC* g);
-  virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);    
+  virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 
+   
+  virtual void       Refresh();      // Recalcule les limites et reaffiche
+  virtual void       UpdateSize();   // Calcule et change les limites si non fixees 
 
   float XMin() const {return xMin;}
@@ -42,4 +44,13 @@
   int    LimitsFixed() const {return limitsFixed;}
   void   FreeLimits() {limitsFixed = 0;}
+
+  void               SetColAtt(PIColors fg=PI_NotDefColor, 
+                               PIColors bg=PI_NotDefColor);
+  void               SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
+  void               SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
+                                PIFontAtt fat=PI_NotDefFontAtt);
+  void               SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
+
+  void               SelGraAtt(PIGraphicUC* g);
 
 //  Les objets/methodes suivants devraient etre protected     
@@ -83,4 +94,12 @@
   list<DrwBWId>  mBWdgList;
   bool mDndfg;
+
+//  Gestion d attributs graphiques associes a chaque drawer
+  PIColors           mFCol, mBCol;
+  PILineAtt          mLAtt;
+  PIFontSize         mFSz;
+  PIFontAtt          mFAtt;
+  int                mMSz;
+  PIMarker           mMrk;     
   
 };
Index: trunk/SophyaPI/PI/pidrawwin.cc
===================================================================
--- trunk/SophyaPI/PI/pidrawwin.cc	(revision 106)
+++ trunk/SophyaPI/PI/pidrawwin.cc	(revision 107)
@@ -16,5 +16,5 @@
 
 void
-PIDrawWindow::AddScDrawer(PIScDrawer* d, bool ad)
+PIDrawWindow::AddScDrawer(PIDrawer* d, bool ad)
 {
   mDrawWdg->AddScDrawer(d, ad);
Index: trunk/SophyaPI/PI/pidrawwin.h
===================================================================
--- trunk/SophyaPI/PI/pidrawwin.h	(revision 106)
+++ trunk/SophyaPI/PI/pidrawwin.h	(revision 107)
@@ -15,5 +15,5 @@
                 ~PIDrawWindow();
                 
- virtual void    AddScDrawer(PIScDrawer*, bool ad=false);                
+ virtual void    AddScDrawer(PIDrawer*, bool ad=false);                
  virtual void    SetAxesFlags(int flags=-1);
  inline PIScDrawWdg * DrawWdg() { return mDrawWdg; }
Index: trunk/SophyaPI/PI/pihisto.cc
===================================================================
--- trunk/SophyaPI/PI/pihisto.cc	(revision 106)
+++ trunk/SophyaPI/PI/pihisto.cc	(revision 107)
@@ -3,5 +3,5 @@
 
 PIHisto::PIHisto(Histo* histo, bool ad)
-: PIScDrawer(), mHisto(histo)
+: PIDrawer(), mHisto(histo)
 {
   mAdDO = ad;     // Flag pour suppression automatique de mHisto
@@ -19,20 +19,7 @@
 PIHisto::UpdateSize()
 {
-  if (!mDrawer) return;
-  if (mDrawer->LimitsFixed()) return;
-  // Commencer par trouver nos limites
-  
-  float xmin = mHisto->XMin();
-  float xmax = (mHisto->XMax());
-
-  float ymax = mHisto->VMax()*1.2;
-  float ymin = mHisto->VMin();
-  
-  if (mDrawWdg) 
-    mDrawWdg->SetLimits(xmin, xmax, ymin, ymax);
-  else 
-    mDrawer->SetLimits(xmin, xmax, ymin, ymax);
-
-  mDrawer->SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
+  if (!mHisto)  return;  
+  SetLimits(mHisto->XMin(), mHisto->XMax(), mHisto->VMin(), mHisto->VMax()*1.2);
+  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
 }
 
@@ -41,4 +28,5 @@
 PIHisto::Draw(PIGraphicUC* g, float /*xmin*/, float /*ymin*/, float /*xmax*/, float /*ymax*/)
 {
+  if (!mHisto)  return;  
   for (int i=0; i<mHisto->NBins(); i++) {
 		float left   = mHisto->BinLowEdge(i);
@@ -55,16 +43,15 @@
 PIHisto::DrawStats(PIGraphicUC* g)
 {
-  if (!mDrawWdg) return;
-  // Une boite dans le coin superieur droit
-  float cellHeight = (mDrawWdg->YMax() - mDrawWdg->YMin()) * 0.05;
-  float cellWidth  = (mDrawWdg->XMax() - mDrawWdg->XMin()) * 0.23;
-  g->DrawLine(mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax(),
-                       mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax() - cellHeight);
-  g->DrawLine(mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax() - cellHeight,
-                       mDrawWdg->XMax()            , mDrawWdg->YMax() - cellHeight);
+  if (!mHisto) return;
+  float cellHeight = (YMax() - YMin()) * 0.05;
+  float cellWidth  = (XMax() - XMin()) * 0.23;
+  g->DrawLine(XMax() - cellWidth, YMax(),
+                       XMax() - cellWidth, YMax() - cellHeight);
+  g->DrawLine(XMax() - cellWidth, YMax() - cellHeight,
+                       XMax()            , YMax() - cellHeight);
   char label[50];
   sprintf(label, "N = %.6g", mHisto->NData());
-  g->SelFontSz((mDrawWdg->YMax() - mDrawWdg->YMin())/30);
-  g->DrawString(mDrawWdg->XMax() - cellWidth*0.9, mDrawWdg->YMax() - cellHeight*0.8, label);
+  g->SelFontSz((YMax() - YMin())/30);
+  g->DrawString(XMax() - cellWidth*0.9, YMax() - cellHeight*0.8, label);
                        
 }
Index: trunk/SophyaPI/PI/pihisto.h
===================================================================
--- trunk/SophyaPI/PI/pihisto.h	(revision 106)
+++ trunk/SophyaPI/PI/pihisto.h	(revision 107)
@@ -3,7 +3,7 @@
 
 #include "histos.h"
-#include "piscdrawwdg.h"
+#include "pidrawer.h"
 
-class PIHisto : public PIScDrawer {
+class PIHisto : public PIDrawer {
 public:
                      PIHisto(Histo* histo, bool ad=false);
@@ -16,4 +16,5 @@
 protected:
   Histo* mHisto;
+  bool mAdDO;
 };
 
Index: trunk/SophyaPI/PI/pihisto2d.cc
===================================================================
--- trunk/SophyaPI/PI/pihisto2d.cc	(revision 106)
+++ trunk/SophyaPI/PI/pihisto2d.cc	(revision 107)
@@ -22,5 +22,5 @@
 //	Createur d'une classe de dessin pour l'histogramme 2D histo.
 //--
-: PIScDrawer(), mHisto(histo)
+: PIDrawer(), mHisto(histo)
 {
 mAdDO = ad;     // Flag pour suppression automatique de mHisto  
@@ -150,21 +150,7 @@
 //--
 {
-  if (!mDrawer) return;
-  if (mDrawer->LimitsFixed()) return;
   if(!mHisto) return;
-  // Commencer par trouver nos limites
-  
-  float xmin = mHisto->XMin();
-  float xmax = mHisto->XMax();
-
-  float ymax = mHisto->YMax();
-  float ymin = mHisto->YMin();
-  
-  if (mDrawWdg)
-    mDrawWdg->SetLimits(xmin, xmax, ymin, ymax);
-  else
-    mDrawer->SetLimits(xmin, xmax, ymin, ymax);
-
-  mDrawer->SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
+  SetLimits(mHisto->XMin(), mHisto->XMax(), mHisto->YMin() , mHisto->YMax());
+  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
 }
 
@@ -291,16 +277,15 @@
 //--
 {
-  if (!mDrawWdg) return;
   // Une boite dans le coin superieur droit
-  float cellHeight = (mDrawWdg->YMax() - mDrawWdg->YMin()) * 0.05;
-  float cellWidth  = (mDrawWdg->XMax() - mDrawWdg->XMin()) * 0.23;
-  g->DrawLine(mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax(),
-                       mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax() - cellHeight);
-  g->DrawLine(mDrawWdg->XMax() - cellWidth, mDrawWdg->YMax() - cellHeight,
-                       mDrawWdg->XMax()            , mDrawWdg->YMax() - cellHeight);
+  float cellHeight = (YMax() - YMin()) * 0.05;
+  float cellWidth  = (XMax() - XMin()) * 0.23;
+  g->DrawLine(XMax() - cellWidth, YMax(),
+                       XMax() - cellWidth, YMax() - cellHeight);
+  g->DrawLine(XMax() - cellWidth, YMax() - cellHeight,
+                       XMax()            , YMax() - cellHeight);
   char label[50];
   sprintf(label, "N = %.6g", mHisto->NData());
-  g->SelFontSz((mDrawWdg->YMax() - mDrawWdg->YMin())/30);
-  g->DrawString(mDrawWdg->XMax() - cellWidth*0.9, mDrawWdg->YMax() - cellHeight*0.8, label);
+  g->SelFontSz((YMax() - YMin())/30);
+  g->DrawString(XMax() - cellWidth*0.9, YMax() - cellHeight*0.8, label);
   printf("H[%d,%d] Dynamique: [%g,%g] Frac [%g,%g]\n"
         ,mHisto->NBinX(),mHisto->NBinY(),HMin(),HMax(),FMin(),FMax());
@@ -679,5 +664,5 @@
   mpih->UseDyn(mHMin,mHMax);
   mpih->UseFrac(mFracMin,mFracMax);
-  mpih->Refresh();  // On rafraichit le dessin
+  mH2Wdg->Refresh();  // On rafraichit le dessin (tout le PIScDrawWdg)
 }
 else if (opt==6002) {
Index: trunk/SophyaPI/PI/pihisto2d.h
===================================================================
--- trunk/SophyaPI/PI/pihisto2d.h	(revision 106)
+++ trunk/SophyaPI/PI/pihisto2d.h	(revision 107)
@@ -11,5 +11,5 @@
 
 ////////////////////////////////////////////////////////////////////
-class PIHisto2D : public PIScDrawer {
+class PIHisto2D : public PIDrawer {
 public:
                      PIHisto2D(Histo2D* histo, bool ad=false);
@@ -42,4 +42,5 @@
 
   Histo2D* mHisto;
+  bool mAdDO;
   bool mFgCol;
   CMapId mCmap;
Index: trunk/SophyaPI/PI/piimage.cc
===================================================================
--- trunk/SophyaPI/PI/piimage.cc	(revision 106)
+++ trunk/SophyaPI/PI/piimage.cc	(revision 107)
@@ -25,7 +25,4 @@
 winovis = true;     // $CHECK$ Reza A enlever si possible 17/6/96
 
-admrk = true;
-xpmrk = ypmrk = NULL;   nbmrk = 0;
-mrkt = PI_PlusMarker;   mrkbsz = 3;
 
 zow = NULL;
@@ -82,9 +79,4 @@
 if (lut) delete lut;
 if (aisup)  delete img;   // Suppression automatique d'image
-if (admrk) 
-  {
-  if (xpmrk)  delete xpmrk;
-  if (ypmrk)  delete ypmrk;
-  }
 if (trtw)  delete trtw;
 }
@@ -105,5 +97,5 @@
 
 /* --Methode-- */
-void PIImage::SetImage(P2DArrayAdapter *pim, bool refr)
+void PIImage::SetImage(P2DArrayAdapter *pim, bool ad, bool refr)
 {
 
@@ -117,6 +109,5 @@
 zmgv = 1;
 
-if (img)
-  {
+if (img)  {
 //  SetSize(img->XSize(), img->YSize());
   CenterPave();
@@ -125,33 +116,10 @@
   img->CheckDyn(min, max, moy, sig, nbnul, nbsat);
   SetLut(min, max, kLutType_Lin, 1, refr);
-  }
-return;
-}
-
-/* --Methode-- */
-void PIImage::AddMarks(int nm, float* px, float* py, bool refr, bool ad, PIMarker mrk, int msz)
-{
-if ( (nbmrk > 0) && admrk ) {
-  if (xpmrk)  delete xpmrk;
-  if (ypmrk)  delete ypmrk;
-}
-if (nm <= 0) { nbmrk = 0; xpmrk = ypmrk = NULL; }
-else { nbmrk = nm;  xpmrk = px, ypmrk = py; }
-admrk = ad;  mrkt = mrk;  mrkbsz = msz;
-if (refr)  DrawMarks(mWGrC, 0, XSize(), 0, YSize());
-return;
-}
-
-/* --Methode-- */
-void PIImage::RemoveMarks(bool refr)
-{
-if (nbmrk < 1)  return;
-if (admrk ) {
-  if (xpmrk)  delete xpmrk;
-  if (ypmrk)  delete ypmrk;
-}
-nbmrk = 0; xpmrk = ypmrk = NULL;
-if (refr)  Refresh();
-}
+  aisup = ad;
+  }
+else aisup = false;
+return;
+}
+
 
 /* --Methode-- */
@@ -173,5 +141,4 @@
 return;
 }
-
 
 
@@ -197,12 +164,4 @@
 }
 
-
-/* --Methode-- */
-void PIImage::SetAutoDelImage(bool ad)
-{
-aisup = ad;
-return;
-}
-
 /* --Methode-- */
 void PIImage::ShowCursor(bool sc)
@@ -380,5 +339,4 @@
   }
 
-DrawMarks(g, x0, x0+dx, y0, y0+dy);
 return;
 }
@@ -689,30 +647,4 @@
 }
 
-/* --Methode-- */
-void PIImage::DrawMarks(PIGraphicGen* g, int x1, int x2, int y1, int y2)
-{
-float fz;
-float tofx, tofy;
-int i,x,y;
-
-if ( (winovis || (nbmrk < 1) ) ) return;
-tofx = tofy = 0;
-if ( img ) { tofx = tofy = 0; }  /* img->XOrg(); tofy = img->YOrg(); $CHECK$  REZA 5/04/98 */  
-tofx += offx;  tofy += offy; 
-fz = GetZoomF();
-g->SelGOMode(PI_GOCopy);
-g->SelMarker((int)(fz*mrkbsz), mrkt);
-if ( (GetColMapId() == CMAP_GREY32) || (GetColMapId() == CMAP_GREYINV32) )
-  g->SelForeground(PI_Red);
-else g->SelForeground(PI_White);
-for(i=0; i<nbmrk; i++)
-  { 
-  x = (int) ((xpmrk[i]-tofx)*fz);
-  y = (int) ((ypmrk[i]-tofy)*fz);
-  if ((x < x1) || (x > x2) || (y < y1) || (y > y2))  continue;
-  g->DrawMarker(x,y);
-  }
-return;
-}
 
 /* --Methode-- */
Index: trunk/SophyaPI/PI/piimage.h
===================================================================
--- trunk/SophyaPI/PI/piimage.h	(revision 106)
+++ trunk/SophyaPI/PI/piimage.h	(revision 107)
@@ -29,10 +29,5 @@
   virtual void    Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
 
-  void SetImage(P2DArrayAdapter* pim, bool refr=true);
-  void SetAutoDelImage(bool ad = false);
-
-  void AddMarks(int nm, float* px, float* py, bool refr=true, 
-                bool ad=true, PIMarker mrk=PI_PlusMarker, int msz=3);
-  void RemoveMarks(bool refr=true);                
+  void SetImage(P2DArrayAdapter* pim, bool ad = true, bool refr=true);
 
   void SetZoomWin(PIPixmap * zw, bool refr=true);
@@ -86,5 +81,4 @@
   void DrawCursor(PIGraphicGen* g);
   void DrawCursor(PIGraphicGen* g, int xc, int yc);
-  void DrawMarks(PIGraphicGen* g, int x1, int x2, int y1, int y2);
 
   void ShowTrTxW();
@@ -97,15 +91,8 @@
 
 // Les donnees 
-
   P2DArrayAdapter * img;
-  bool aisup;
+  bool aisup;     // Flag de suppression automatique de img
   bool curshow;
   bool winovis;   // $CHECK$ Reza A enlever si possible 17/6/96
-
-// Pour gerer les marques ajoutees
-  bool admrk;
-  int nbmrk, mrkbsz;
-  float * xpmrk, * ypmrk;
-  PIMarker mrkt;
 // Tableau des pixels principal  
   unsigned char * pixm;
Index: trunk/SophyaPI/PI/pintuple.cc
===================================================================
--- trunk/SophyaPI/PI/pintuple.cc	(revision 106)
+++ trunk/SophyaPI/PI/pintuple.cc	(revision 107)
@@ -5,5 +5,5 @@
 /* --Methode-- */
 PINTuple::PINTuple(NTuple* nt, bool ad)
-: PIScDrawer()
+: PIDrawer()
 {
   mNT = nt;
@@ -45,6 +45,4 @@
   if (mNT->NEntry() <= 0)  return;
   if ( (xK < 0) || (yK < 0) )   return;
-  if (!mDrawer) return;
-  if (mDrawer->LimitsFixed()) return;
 
   // Commencer par trouver nos limites
@@ -59,12 +57,6 @@
   dy = 0.02*(ymax-ymin);
   
-  if (mDrawWdg) 
-    mDrawWdg->SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy, 
-                        kAxeDirLtoR, kAxeDirDownUp); 
-  else 
-    mDrawer->SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy, 
-                        kAxeDirLtoR, kAxeDirDownUp); 
-  
-  mDrawer->SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
+  SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy);
+  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
 }
 
@@ -78,5 +70,4 @@
 
 if (!mNT) return;
-if (!mDrawer) return;
 if ( (xK < 0) || (yK < 0) )  return;
 
@@ -98,8 +89,8 @@
 }
 
-if (!mDrawWdg)  return;
-if (!MainScDrawer())  return;
+/*
 sprintf(buff, "NTuple:  NEntry= %d  NDisp= %d", (int)mNT->NEntry(), nok);
 g->BaseGraphic()->DrawString(15,15,buff);
+*/
 return;
 }
Index: trunk/SophyaPI/PI/pintuple.h
===================================================================
--- trunk/SophyaPI/PI/pintuple.h	(revision 106)
+++ trunk/SophyaPI/PI/pintuple.h	(revision 107)
@@ -5,5 +5,5 @@
 #include "piscdrawwdg.h"
 
-class PINTuple : public PIScDrawer {
+class PINTuple : public PIDrawer {
 public:
                      PINTuple(NTuple* nt, bool ad);
@@ -19,4 +19,5 @@
 protected:
   NTuple* mNT;
+  bool mAdDO;
   int xK, yK;          // Index du nom de variable en X/Y ds le ntuple
   int xebK, yebK;      // Index du nom de variable en ErrBarX/Y ds le ntuple
Index: trunk/SophyaPI/PI/piscdrawwdg.cc
===================================================================
--- trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 106)
+++ trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 107)
@@ -7,9 +7,10 @@
 {
   mBDrw = new PIDrawer;
-  SetLimits(-1.,1.,-1.,1.);
+  SetLimits(-1.,1.,-1.,1.,kAxeDirLtoR,kAxeDirDownUp);
+  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);  
   FreeLimits();
   xEndDrag = yEndDrag = xBegDrag = yBegDrag = 0;
-
-  padsup = false;
+  SetDefaultDrawRectangle(0.12, 0.12, 0.88, 0.88, true);
+
   mTrlb = mTxw = NULL;
   mTrW = NULL;
@@ -24,5 +25,4 @@
 PIScDrawWdg::~PIScDrawWdg()
 {
-  DeleteScDrawers();
   delete mBDrw;
   if (mTrW)  delete mTrW;
@@ -37,4 +37,5 @@
     return; // $CHECK$ exception ?
   mBDrw->SetLimits(xmin, xmax, ymin, ymax, axrl, ayud);
+  SetDefaultDrawerLimits(xmin, xmax, ymin, ymax, axrl, ayud);
   mPPos[0] = 0.5*(XMin()+XMax());
   mPPos[1] = 0.5*(YMin()+YMax());
@@ -79,60 +80,10 @@
   
 
-void
-PIScDrawWdg::AddScDrawer(PIScDrawer* d, bool ad)
-{
-  bool pd=false;
-  if (mScDrawers.size() == 0)  pd = true;
-  mScDrawers.push_back(d);
-  d->AttachTo(this, ad, pd);
-}
-
-void
-PIScDrawWdg::RemoveScDrawer(PIScDrawer* d)
-{
-  if (padsup)  return;
-  vector<PIScDrawer*>::iterator drw;
-  for(drw = mScDrawers.begin(); drw != mScDrawers.end(); drw++) 
-    if (d == (*drw)) { mScDrawers.erase(drw);  break; }
-  d->mDrawWdg = NULL;  d->mDrawer = NULL;
-}
-
 int 
-PIScDrawWdg::NbScDrawers()
-{
-  return(mScDrawers.size());
-}
-
-PIScDrawer*
-PIScDrawWdg::ScDrawer(int i)
-{
- if ( (i<0) || (i>mScDrawers.size()) )  return(NULL);
- return(mScDrawers[i]);
-}
-
-
-void
-PIScDrawWdg::DeleteScDrawers()
-{
-  padsup = true;
-  vector<PIScDrawer*>::iterator i;
-  for(i = mScDrawers.begin(); i != mScDrawers.end(); i++) {
-    if ( (*i)->ADelByDrwWdg() )  delete *i;
-  }
-  mScDrawers.erase(mScDrawers.begin(),mScDrawers.end());
-  padsup = false;
-}
-
-void
-PIScDrawWdg::CallScDrawers(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
-{
-  vector<PIScDrawer*>::iterator drw;
-  for(drw = mScDrawers.begin(); drw != mScDrawers.end(); drw++) {
-    g->SaveGraphicAtt();
-    (*drw)->SelGraAtt(g);
-    (*drw)->Draw(g, xmin, ymin, xmax, ymax);
-    g->RestoreGraphicAtt();
-  }
-}
+PIScDrawWdg::AddScDrawer(PIDrawer* d, bool ad)
+{
+  return(AddDrawer(d, true, ad));
+}
+
 
 void
@@ -161,8 +112,15 @@
 {
   EraseWindow();
+  if (! LimitsFixed() ) {  //  On met a jour les limites a partir du premier Drawer
+    PIDrawer* drw = GetDrawer(0);
+    if (drw != NULL)   {    
+      drw->UpdateSize();
+      SetLimits(drw->XMin(), drw->XMax(), drw->YMin(), drw->YMax());
+      }
+    else SetLimits(0., 1., 0., 1.);
+    }
   PIGraphicUC* guc = SetSpan(g);
   DrawAxes(guc);
   DrawSelf(guc, -9.e19, -9.e19, 9.e19, 9.e19);
-  CallScDrawers(guc, -9.e19, -9.e19, 9.e19, 9.e19);
 }
 
@@ -170,4 +128,13 @@
 PIScDrawWdg::Draw(PIGraphic* g, int x0, int y0, int dx, int dy)
 {
+  EraseWindow();
+  if (! LimitsFixed() ) {  //  On met a jour les limites a partir du premier Drawer
+    PIDrawer* drw = GetDrawer(0);
+    if (drw != NULL)   {    
+      drw->UpdateSize();
+      SetLimits(drw->XMin(), drw->XMax(), drw->YMin(), drw->YMax());
+      }
+    else SetLimits(0., 1., 0., 1.);
+    }
   float xmin,xmax,ymin,ymax;
   PIGraphicUC* guc = SetSpan(g);
@@ -178,5 +145,4 @@
   DrawAxes(guc);
   DrawSelf(guc, xmin, ymin, xmax, ymax);
-  CallScDrawers(guc, xmin, ymin, xmax, ymax);  
 }
 
@@ -304,155 +270,19 @@
 }
 
+
 //================================================================
-// PIScDrawer
+// PIFuncDrawer
 //================================================================
 
-
-
-PIScDrawer::PIScDrawer()
-: mDrawWdg(NULL), mDrawer(NULL)
-{
-  mADbW = mAdDO = mPrDw = false;
-  mFCol = mBCol = PI_NotDefColor;
-  mLAtt = PI_NotDefLineAtt;
-  mFSz = PI_NotDefFontSize;
-  mFAtt = PI_NotDefFontAtt;
-  mMSz = -1;
-  mMrk = PI_NotDefMarker;
-}
-
-PIScDrawer::~PIScDrawer()
-{
-  if (mDrawWdg)
-    mDrawWdg->RemoveScDrawer(this);
-}
-
-void
-PIScDrawer::UpdateSize()
-{
-// Ne fait rien !
-  return;
-}
-
-void
-PIScDrawer::Refresh()
-{
-// Recalcule les limites, et reaffiche
-  if (!mDrawWdg) return;
-  mDrawWdg->FreeLimits();
-  UpdateSize();
-  if (mDrawWdg) mDrawWdg->Refresh();
-}
-
-void
-PIScDrawer::AttachTo(PIScDrawWdg* wdg, bool ad, bool prd)
-{
-  if (mDrawWdg)
-    mDrawWdg->RemoveScDrawer(this);
-  mDrawWdg = wdg;  mDrawer = wdg->BaseDrawer(); 
-  UpdateSize();
-  mADbW = ad;
-  mPrDw = prd;
-}
-
-// Classe PIDrawer special pour enrober un PIScDrawer en PIDrawer
-class PIScContDrw : public PIDrawer {
-public :
-                     PIScContDrw(PIScDrawer* d, bool ad=false);
-  virtual            ~PIScContDrw();
-  virtual  void      Draw(PIGraphicUC* g);
-  virtual  void      Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
-private:
-  PIScDrawer* mScDrw;
-  bool mAD;
-};
-
-PIScContDrw::PIScContDrw(PIScDrawer* d, bool ad)  
-{ 
-  mScDrw = d; 
-  mAD=ad; 
-}
-
-PIScContDrw::~PIScContDrw() 
-{ 
-  if (mAD)  delete mScDrw; 
-}
-
-void PIScContDrw::Draw(PIGraphicUC* g) 
-{ 
-  mScDrw->SelGraAtt(g); 
-  mScDrw->Draw(g, -9.e19, -9.e19, 9.e19, 9.e19); 
-}
-
-void PIScContDrw::Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax)
-{ 
-  mScDrw->SelGraAtt(g); 
-  mScDrw->Draw(g, xmin, ymin, xmax, ymax); 
-}
-
-PIDrawer*
-PIScDrawer::Convert()
-{
-  PIScContDrw* rd;
-  if (mDrawWdg) mDrawWdg->RemoveScDrawer(this);
-  rd = new PIScContDrw(this);
-  mDrawWdg = NULL;    mDrawer = rd;
-  UpdateSize();
-  return((PIDrawer*)rd);
-}
-
-void 
-PIScDrawer::SetColAtt(PIColors fg, PIColors bg)
-{
-  if (fg != PI_NotDefColor) mFCol = fg;
-  if (bg != PI_NotDefColor) mBCol = bg;
-}
-
-void 
-PIScDrawer::SetLineAtt(PILineAtt lat)
-{
-  if (lat != PI_NotDefLineAtt) mLAtt = lat;
-}
-
-void 
-PIScDrawer::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
-{
-  if (fsz != PI_NotDefFontSize) mFSz = fsz;
-  if (fat != PI_NotDefFontAtt) mFAtt = fat;
-}
-
-void 
-PIScDrawer::SetMarkerAtt(int sz, PIMarker mrk)
-{
-  if (sz >= 0)  mMSz = sz;
-  if (mrk != PI_NotDefMarker) mMrk = mrk;
-}
-
-void 
-PIScDrawer::SelGraAtt(PIGraphicUC* g)
-{
-  if (mFCol != PI_NotDefColor)    g->SelForeground(mFCol);
-  if (mBCol != PI_NotDefColor)    g->SelBackground(mBCol);
-  if (mLAtt != PI_NotDefLineAtt)  g->SelLine(mLAtt);
-  if ( (mFSz != PI_NotDefFontSize) || (mFAtt != PI_NotDefFontAtt) )
-                                  g->SelFont(mFSz, mFAtt);
-  if ( (mMrk != PI_NotDefMarker) || (mMSz >= 0) )
-                                  g->SelMarker(mMSz, mMrk);
-}
-
-//================================================================
-// PIScFuncDrawer
-//================================================================
-
-PIScFuncDrawer::PIScFuncDrawer(PIScFuncDrawer::FUNC f)
+PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)
 : mFunc(f)
 {}
 
-PIScFuncDrawer::~PIScFuncDrawer()
-{
-}
-
-void
-PIScFuncDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
+PIFuncDrawer::~PIFuncDrawer()
+{
+}
+
+void
+PIFuncDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
 {
   PIGrCoord x1, x2, y1, y2;
@@ -476,8 +306,8 @@
 
 //================================================================
-// PIScGFFDrawer
+// PIGFFDrawer
 //================================================================
 
-PIScGFFDrawer::PIScGFFDrawer(GeneralFunction* f)
+PIGFFDrawer::PIGFFDrawer(GeneralFunction* f)
 : mFunc(f), mNParms(f->NPar()), mParms(new double[mNParms])
 {
@@ -485,5 +315,5 @@
 }
 
-PIScGFFDrawer::~PIScGFFDrawer()
+PIGFFDrawer::~PIGFFDrawer()
 {
   delete[] mParms;
@@ -491,5 +321,5 @@
 
 void
-PIScGFFDrawer::SetParms(double const* p)
+PIGFFDrawer::SetParms(double const* p)
 {
   for (int i=0; i<mNParms; i++)
@@ -499,5 +329,5 @@
 
 void
-PIScGFFDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
+PIGFFDrawer::Draw(PIGraphicUC* g, float /*xmin*/, float/*ymin*/, float/*xmax*/, float/*ymax*/)
 {
   PIGrCoord x1, x2, y1, y2;
Index: trunk/SophyaPI/PI/piscdrawwdg.h
===================================================================
--- trunk/SophyaPI/PI/piscdrawwdg.h	(revision 106)
+++ trunk/SophyaPI/PI/piscdrawwdg.h	(revision 107)
@@ -12,5 +12,4 @@
 
 
-class PIScDrawer;
 
 class PIScDrawWdg : public PIBaseWdg {
@@ -36,8 +35,5 @@
   void               DrawAxes(PIGraphicUC* g, int flags = -1);
 
-  void               AddScDrawer(PIScDrawer*, bool ad=false);   // Ajoute un ScDrawer
-  void               RemoveScDrawer(PIScDrawer*);  // Ote un ScDrawer sans le detruire
-  int                NbScDrawers();
-  PIScDrawer*        ScDrawer(int i);          
+  int                AddScDrawer(PIDrawer*, bool ad=false);   // Ajoute un Drawer en auto 
 
   PIDrawer*          BaseDrawer() { return mBDrw; };
@@ -66,6 +62,4 @@
   
 protected:
-          void       DeleteScDrawers();    // Ote et detruit tous les ScDrawers
-          void       CallScDrawers(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
        PIGraphicUC*  SetSpan(PIGraphicGen* g);
 
@@ -74,6 +68,4 @@
 
   PIDrawer* mBDrw;
-  vector<PIScDrawer*>   mScDrawers;
-  bool padsup;
   
   int xBegDrag, yBegDrag;
@@ -93,48 +85,10 @@
 
 
-class PIScDrawer {
-public:
-                     PIScDrawer();
-  virtual           ~PIScDrawer();
 
-  virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax) = 0; 
-  virtual void       UpdateSize();   // Calcule et change les limites si non fixees 
-  virtual void       Refresh();      // Recalcule les limites et reaffiche
-
-  PIDrawer*          Convert();
-
-  void               SetColAtt(PIColors fg=PI_NotDefColor, 
-                                PIColors bg=PI_NotDefColor);
-  void               SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
-  void               SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
-                                PIFontAtt fat=PI_NotDefFontAtt);
-  void               SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker);
-
-  void               SelGraAtt(PIGraphicUC* g);
-
-  inline void        SetAutoDelDataObj(bool ad=false) { mAdDO = ad; }
-  inline bool        ADelByDrwWdg() { return mADbW; }
-  inline bool        MainScDrawer() { return mPrDw; }
-
-protected:
-  friend class       PIScDrawWdg;
-  virtual void       AttachTo(PIScDrawWdg*, bool, bool);
-
-  PIScDrawWdg*       mDrawWdg;
-  PIDrawer*          mDrawer;
-  bool               mADbW, mAdDO, mPrDw;
-  PIColors           mFCol, mBCol;
-  PILineAtt          mLAtt;
-  PIFontSize         mFSz;
-  PIFontAtt          mFAtt;
-  int                mMSz;
-  PIMarker           mMrk;     
-};
-
-class PIScFuncDrawer : public PIScDrawer {
+class PIFuncDrawer : public PIDrawer {
 public:
   typedef double(*FUNC)(double);
-                     PIScFuncDrawer(FUNC);
-  virtual           ~PIScFuncDrawer();
+                     PIFuncDrawer(FUNC);
+  virtual           ~PIFuncDrawer();
   
   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
@@ -144,8 +98,8 @@
 
 class GeneralFunction;
-class PIScGFFDrawer : public PIScDrawer {
+class PIGFFDrawer : public PIDrawer {
 public:
-                     PIScGFFDrawer(GeneralFunction*);
-  virtual           ~PIScGFFDrawer();
+                     PIGFFDrawer(GeneralFunction*);
+  virtual           ~PIGFFDrawer();
   
   virtual void       Draw(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
Index: trunk/SophyaPI/PI/pistlist.cc
===================================================================
--- trunk/SophyaPI/PI/pistlist.cc	(revision 106)
+++ trunk/SophyaPI/PI/pistlist.cc	(revision 107)
@@ -5,5 +5,5 @@
 /* --Methode-- */
 PIStarList::PIStarList(StarList* stl, bool ad, int ayud)
-: PIScDrawer(), mStL(stl)
+: PIDrawer(), mStL(stl)
 {
   mAdDO = ad;   
@@ -61,6 +61,4 @@
 {
   if (!mStL) return;
-  if (!mDrawer) return;
-  if (mDrawer->LimitsFixed()) return;
 
   // Commencer par trouver nos limites
@@ -70,10 +68,6 @@
   dy = 0.02*(mYMax-mYMin);
   
-  if (mDrawWdg) 
-    mDrawWdg->SetLimits(mXMin-dx, mXMax+dx, mYMin-dy, mYMax+dy, kAxeDirLtoR, mAYdir); 
-  else 
-    mDrawer->SetLimits(mXMin-dx, mXMax+dx, mYMin-dy, mYMax+dy, false, mAYdir); 
-
-  mDrawer->SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
+  SetLimits(mXMin-dx, mXMax+dx, mYMin-dy, mYMax+dy, kAxeDirLtoR, mAYdir); 
+  SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
 }
 
@@ -89,5 +83,4 @@
 
 if (!mStL) return;
-if (!mDrawer) return;
 
 g->SelFont();
@@ -114,11 +107,10 @@
   }
 
-if (!mDrawWdg)  return;
-if (!MainScDrawer()) return;
-
+/*
 sprintf(buff, "StarList:  NbStars= %d  NDisp= %d", (int)mStL->NbStars(), nok);
 g->BaseGraphic()->DrawString(15,15,buff);
 sprintf(buff, "FMin= %g  FMax= %g Nl= %d Sz0= %d", mFmin, mFmax, mNLev, mMSz0);
 g->BaseGraphic()->DrawString(15,30,buff);
+*/
 
 }
Index: trunk/SophyaPI/PI/pistlist.h
===================================================================
--- trunk/SophyaPI/PI/pistlist.h	(revision 106)
+++ trunk/SophyaPI/PI/pistlist.h	(revision 107)
@@ -3,7 +3,7 @@
 
 #include "stlist.h"
-#include "piscdrawwdg.h"
+#include "pidrawer.h"
 
-class PIStarList : public PIScDrawer {
+class PIStarList : public PIDrawer {
 public:
                      PIStarList(StarList* stl, bool ad, int ayud=kAxeDirUpDown);
@@ -28,4 +28,5 @@
 protected:
   StarList* mStL;
+  bool mAdDO;
   float mFmin, mFmax;
   int mNLev, mMSz0;
Index: trunk/SophyaPI/PI/sc_sample.cc
===================================================================
--- trunk/SophyaPI/PI/sc_sample.cc	(revision 106)
+++ trunk/SophyaPI/PI/sc_sample.cc	(revision 107)
@@ -1,6 +1,2 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <string>
-
 #include "sc_sample.h"
 
@@ -12,6 +8,6 @@
 
 {
-PIScFuncDrawer * mfd;
-mfd = new PIScFuncDrawer(f);
+PIFuncDrawer * mfd;
+mfd = new PIFuncDrawer(f);
   SetLimits(-3,3,-4,4);
 AddScDrawer(mfd);
@@ -26,5 +22,5 @@
 
 void
-ScSample::DrawSelf(PIGraphicUC* g, float, float, float, float)
+ScSample::DrawSelf(PIGraphicUC* g)
 {
 PIGrCoord x[5] = {-2, -1., 1., 1.7, 2.2};
@@ -36,5 +32,4 @@
 g->DrawMarkers(x, y, 5);
 g->SelForeground(PI_Magenta);
-printf(" +DBG+ ScSample::DrawSelf - Marker(%g) \n", 0.3);
 g->SelMarkerSz(0.3, PI_FCircleMarker);
 for(i=0; i<5; i++)
Index: trunk/SophyaPI/PI/sc_sample.h
===================================================================
--- trunk/SophyaPI/PI/sc_sample.h	(revision 106)
+++ trunk/SophyaPI/PI/sc_sample.h	(revision 107)
@@ -1,3 +1,3 @@
-// #include "pisysdep.h"
+#include "pisysdep.h"
 
 #include "piscdrawwdg.h"
@@ -10,5 +10,5 @@
 
   
-  virtual void DrawSelf(PIGraphicUC* g, float, float, float, float);
+  virtual void DrawSelf(PIGraphicUC* g);
 
 };
