Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1905)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 1971)
@@ -93,10 +93,12 @@
 m[3]->AppendItem("Window", 10411);
 m[3]->AppendItem("Window 2x1", 10421);
-m[3]->AppendItem("Window 1x2", 10412);
+// m[3]->AppendItem("Window 1x2", 10412);
 m[3]->AppendItem("Window 2x2", 10422);
-m[3]->AppendItem("Window 3x1", 10431);
+// m[3]->AppendItem("Window 3x1", 10431);
 m[3]->AppendItem("Window 3x3", 10433);
 m[3]->AppendItem("Cur->LastWdg", 10441);
 m[3]->AppendItem("Close CurWin", 10460);
+m[3]->AppendCheckItem("StatZoomWin", 10470);
+m[3]->SetStateMsg(10470, true);
 
 m[4] = new PIMenu(Menubar(),"PostScript");
@@ -138,18 +140,39 @@
 MainWin()->SetSize(msx, msy);
 
+//------------------------------------------------------
+// On cree un container intermediaire permettant de gerer 
+// le widget zoom, colormap, stats, ...
+
 int bss = 100+mFgScSz*15;
-gimv = new PIPixmap(MainWin(), "GloV", bss, bss, 5, 5);
+
+int statc_szy = bss+10+14+mFgScSz*2+5; 
+statcont = new PIContainer(MainWin(), "ZGCSCont", msx, statc_szy, 0, 0);
+statcont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
+
+gimv = new PIPixmap(statcont, "GloV", bss, bss, 5, 5);
 gimv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free); 
-zoom = new PIPixmap(MainWin(), "Zoom", bss, bss, bss+10, 5);
+zoom = new PIPixmap(statcont, "Zoom", bss, bss, bss+10, 5);
 zoom->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free); 
-cmapv = new PICMapView(MainWin(), "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10); 
+cmapv = new PICMapView(statcont, "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10); 
 cmapv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
-
-int cpy = bss+10+14+mFgScSz*2+5;
+labstat = new PILabel(statcont, "statlabel", msx-2*(bss+20), 20, 2*bss+20, 10);
+labstat->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free); 
+labstat->SetLabel("Stat-Zoom-ColMap Window");
+labstat->SetForegroundColor(PI_Red);
+labstat->SetBorderWidth(1);
+statcont->Show();
+// StatZoomWindowSetVisible(true);
+//------------------------------------------------------
+
+//int cpy = bss+10+14+mFgScSz*2+5;
+int cpy = statc_szy;
 
 // Creation d'une console avec gestion des commandes  
-mCons = new PIConsole(MainWin(), "Console", 30200, 512, 132, msx, msy-cpy, 0, cpy );
+consolecont = new PIContainer(MainWin(), "ConsoleCont", msx, msy-cpy, 0, cpy );
+consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 
+mCons = new PIConsole(consolecont, "Console", 30200, 512, 132, msx, msy-cpy, 0, 0 );
 mCons->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 
 mCons->AcceptCmd(true, 50);
+consolecont->Show();
 redirecout = false;
 // RedirectStdOutErr(true);  pas par defaut 
@@ -200,23 +223,7 @@
 
 // Attributs graphiques courants
-mFCol = mBCol = PI_NotDefColor;
-mLAtt = PI_NotDefLineAtt;
-mFName = PI_DefaultFont;   
-mFSz = PI_NotDefFontSize;
-mFAtt = PI_NotDefFontAtt;
-mMSz = -1;
-mMrk = PI_NotDefMarker;
-mCmapid = CMAP_OTHER;
-mRevCmap = false; 
-mZoom = 0;
 mAxesFlags = kBoxAxes | kExtTicks | kLabels;
-SetXYLimits(-1, 1., -1., 1.);
-mFXYlim = false;
 SetInsetLimits(0.4, 0.6, 0.4, 0.6);
-SetImageCenterPosition(-1,-1);
-mFImgCenter = false;
-maXlog = maYlog = false;
 mAddTitle = true;
-SaveGraphicAtt();
 
 // Initialisation 
@@ -269,4 +276,7 @@
 delete gimv;
 delete cmapv;
+delete labstat;
+
+delete statcont;
 
 delete pfc_fits;
@@ -275,4 +285,5 @@
 
 delete mCons;
+ delete consolecont;
 
 delete mObjmgrw;
@@ -449,5 +460,5 @@
 
 /* --Methode-- */
-int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, int opt, int oid)
+int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, int oid)
 {
 PIImage* pii;
@@ -468,24 +479,19 @@
   }
 
-int zm = 1;
-if (mZoom == 0) {  // Facteur de zoom auto 
-  zm = (nouv->XSize() > nouv->YSize()) ? nouv->XSize() :  nouv->YSize();
-  zm = (zm >= 250) ? 250/zm : 1;
-  }
-else zm = mZoom;
-
-if (zm == 0)  zm = 1;
-if (zm < -10)  zm = -10; 
-if (zm > 10)  zm = 10;
-
-if (zm > 0)  { sx = nouv->XSize()*zm;  sy = nouv->YSize()*zm; }
-else  { 
-  sx = (int)((float)nouv->XSize()*(-1./float(zm)));  
-  sy = (int)((float)nouv->YSize()*(-1./float(zm))); 
-  } 
+// On decode les options graphiques
+vector<string> opts;
+DispWinEnum dwopt = ParseDisplayOption(sop, opts);
+
+// Pas de same ou inset pour DispImage
+if ((dwopt == Disp_Same) || (dwopt == Disp_Inset) ) dwopt = Disp_Next;
+
+// Choix de la taille de fenetre
+#define MINPIIMGSIZE 100
+sx = (nouv->XSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE;
+sy = (nouv->YSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE;
 if (sx > 400+mFgScSz*100) sx = 400+mFgScSz*100;
 if (sy > 400+mFgScSz*100) sy = 400+mFgScSz*100;
 px = py = 0;
-win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
+win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py);
 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
@@ -493,14 +499,26 @@
 pii->SetGloVWin(gimv, false);
 pii->SetCMapWin(cmapv, false);
-pii->SetZoom(zm, false);
-if ( mCmapid != CMAP_OTHER ) pii->SetColMapId(mCmapid, mRevCmap, false);
 pii->ShowCursor(true);
 pii->SetUserData(NULL, oid);
-// Centrage eventuel du pave
-if (mFImgCenter && (mXImgCenter > 0) && (mYImgCenter > 0)) {
-  pii->SetImage(nouv, false);
-  pii->SetPave(mXImgCenter, mYImgCenter, true, true);
-  }
-else pii->SetImage(nouv, true);
+
+// decode des options en chaine de caracteres
+pii->DecodeOptionString(mDefaultAtt, false);  // d'abord les options par defaut
+pii->DecodeOptionString(opts);      // ensuite, les options specifies en argument
+
+
+// On recalcule la taille de la fenetre si Disp_Win
+if (dwopt == Disp_Win) {
+  int sx2 = (int)((float)nouv->XSize()*pii->GetZoomF());
+  int sy2 = (int)((float)nouv->YSize()*pii->GetZoomF());
+  
+  if (sx2 > 400+mFgScSz*100) sx2 = 400+mFgScSz*100;
+  if (sy2 > 400+mFgScSz*100) sy2 = 400+mFgScSz*100;
+  if (sx2 < MINPIIMGSIZE) sx = MINPIIMGSIZE;
+  if (sy2 < MINPIIMGSIZE) sy = MINPIIMGSIZE;
+  if ((sx2 != sx) || (sy2 != sy))  win->SetSize(sx2, sy2);
+}
+
+pii->SetImage(nouv, false);
+
 // printf("!!DBG!! PIImage Pos= %d %d  Size= %d %d \n", pii->XPos(), pii->YPos(), pii->XSize(), pii->YSize()   );
 mCurWin = win;
@@ -509,4 +527,5 @@
 mBWId++;
 mBWList[mBWId] = pii;
+pii->Refresh();
 return(mBWId); 
 }
@@ -514,5 +533,6 @@
 
 /* --Methode-- */
-int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, int opt, string title, int oid)
+int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, string const& sop, 
+			      string title, int oid)
 {
 if (scd == NULL)
@@ -522,20 +542,14 @@
   }
 
-// Changement d'attributs graphiques courants du drawer
-if (mFCol != PI_NotDefColor) scd->GetGraphicAtt().SetColAtt(mFCol, mBCol);
-if (mLAtt != PI_NotDefLineAtt) scd->GetGraphicAtt().SetLineAtt(mLAtt);
-if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
-  scd->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 
-if ( mFName != PI_DefaultFont ) 
-  scd->GetGraphicAtt().SetFontAtt(mFName, scd->GetGraphicAtt().GetFontSz(), 
-			       scd->GetGraphicAtt().GetFontAtt());
-if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) 
-  scd->GetGraphicAtt().SetMarkerAtt(mMSz, mMrk);
-if ( mCmapid != CMAP_OTHER ) scd->GetGraphicAtt().SetColMapId(mCmapid);
-
-
-if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) )  opt = Disp_Next;
+// On decode les options graphiques
+vector<string> opts;
+DispWinEnum dwopt = ParseDisplayOption(sop, opts);
+if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) )  dwopt = Disp_Next;
 // Trace en superpoistion
-if ( (opt == Disp_Same) && (mLastWdg) ) {  
+if ( (dwopt == Disp_Same) && (mLastWdg) ) {  
+  // Les options 
+  scd->DecodeOptionString(mDefaultAtt, false);
+  scd->DecodeOptionString(opts, true);
+
   if (mLastWdg->kind() == PIScDrawWdg::ClassId)  ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true);
   else mLastWdg->AddDrawer(scd, true, true, true);
@@ -546,13 +560,14 @@
 }
 // Trace en medaillon
-else if ( (opt == Disp_Inset) && (mLastWdg) ) {
+else if ( (dwopt == Disp_Inset) && (mLastWdg) ) {
   PIGrCoord x1, x2, y1, y2;
   x1 = mIXmin;  x2 = mIXmax;
   y2 = 1.-mIYmin;  y1 = 1.-mIYmax;
+  // Les options 
+  scd->DecodeOptionString(mDefaultAtt, false);
+  scd->DecodeOptionString(opts, true);
+
   scd->SetAxesFlags(mAxesFlags);
-  if (maXlog || maYlog)  scd->SetLogScale(maXlog, maYlog);  // Echelle log
-  if (mFXYlim)  // Forcage limites XY 
-    scd->SetLimits(mXmin, mXmax, mYmin, mYmax);  
-  else scd->UpdateLimits();
+  scd->UpdateLimits();
   mLastWdg->AddDrawer(scd, x1, y1, x2, y2, true, false, true);
   scd->Refresh();
@@ -562,4 +577,5 @@
 }
 
+// Creation d'un nouveau PIScDrawWdg
 PIWindow* win;
 PIScDrawWdg* scw;
@@ -567,23 +583,26 @@
 sx = 200+mFgScSz*100;
 sy = 200+mFgScSz*100;
-win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
-/*
-if (typeid(*scd) != typeid(PIHisto2D)) 
-else scw = new PIH2DWdg(win, (char *)name.c_str(), sx, sy, px, py);
-*/
+win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
+
 scw = new PIScDrawWdg(win, (char *)name.c_str(), sx, sy, px, py);
 scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
 scw->SetUserData(NULL, oid);
-if (maXlog || maYlog)  scw->SetLogScale(maXlog, maYlog);  // Echelle log
-if (mFXYlim)  // Forcage limites XY 
-  scw->SetLimits(mXmin, mXmax, mYmin, mYmax);
+
+// Decodage des options :
+vector<string> scwatt;
 scw->SetAxesFlags(mAxesFlags);
-// Fonte de trace d'axe
-scw->BaseDrawer()->GetGraphicAtt().SetFontAtt(mFName, mFSz, mFAtt);
-/*
-if (typeid(*scd) != typeid(PIHisto2D)) 
-else ((PIH2DWdg*)scw)->SetPIHisto((PIHisto2D*)scd);
-*/
-scw->AddScDrawer(scd, true);
+if ( mDefaultAtt.size() > 0) { 
+  scwatt = mDefaultAtt;
+  scw->DecodeOptionString(scwatt, true);
+}
+if ( mAxesAtt.size() > 0) { 
+  scwatt = mAxesAtt;
+  scw->DecodeOptionString(scwatt, true);
+}
+if (opts.size() > 0) 
+  scd->DecodeOptionString(opts, true);
+if (opts.size() > 0) 
+  scw->DecodeOptionString(opts, false);
+
 //   Titre du plot
 if (mAddTitle) {
@@ -592,5 +611,7 @@
 }
 
+scw->AddScDrawer(scd, true);
 // scw->Refresh();   ? Pas necessaire  Reza 19/08/98, 05/05/99 $CHECK$ 
+
 mCurWin = win;
 mCurWdg = scw;
@@ -602,5 +623,6 @@
 
 /* --Methode-- */
-int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, int opt, string title, int oid)
+int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, string const& sop, 
+			      string title, int oid)
 {
 if (dr3 == NULL)
@@ -610,19 +632,15 @@
   }
 
-// Changement d'attributs graphiques courants du drawer
-if (mFCol != PI_NotDefColor) dr3->GetGraphicAtt().SetColAtt(mFCol, mBCol);
-if (mLAtt != PI_NotDefLineAtt) dr3->GetGraphicAtt().SetLineAtt(mLAtt);
-if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
-  dr3->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 
-if ( mFName != PI_DefaultFont ) 
-  dr3->GetGraphicAtt().SetFontAtt(mFName, dr3->GetGraphicAtt().GetFontSz(), 
-				  dr3->GetGraphicAtt().GetFontAtt());
-if ( (mMrk != PI_NotDefMarker) && (mMSz >= 0) ) 
-  dr3->GetGraphicAtt().SetMarkerAtt(mMSz, mMrk);
-if ( mCmapid != CMAP_OTHER ) dr3->GetGraphicAtt().SetColMapId(mCmapid);
-
-if ( (!mLastWdg) && ( (opt == Disp_Same) || (opt == Disp_Inset) ) )  opt = Disp_Next;
+// On decode les options graphiques
+vector<string> opts;
+DispWinEnum dwopt = ParseDisplayOption(sop, opts);
+
+if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) )  dwopt = Disp_Next;
 // Trace en superpoistion
-if ( (opt == Disp_Same) && (mLastWdg) ) {
+if ( (dwopt == Disp_Same) && (mLastWdg) ) {
+  // Les options 
+  dr3->DecodeOptionString(mDefaultAtt, false);
+  dr3->DecodeOptionString(opts, true);
+
   if (mLastWdg->kind() == PIDraw3DWdg::ClassId)  ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true);
   else mLastWdg->AddDrawer(dr3, true, true, true);
@@ -633,8 +651,12 @@
 }
 // Trace en medaillon
-else if ( (opt == Disp_Inset) && (mLastWdg) ) {
+else if ( (dwopt == Disp_Inset) && (mLastWdg) ) {
   PIGrCoord x1, x2, y1, y2;
   x1 = mIXmin;  x2 = mIXmax;
   y2 = 1.-mIYmin;  y1 = 1.-mIYmax;
+  // Les options 
+  dr3->DecodeOptionString(mDefaultAtt, false);
+  dr3->DecodeOptionString(opts, true);
+
   dr3->SetAxesFlags(mAxesFlags);
   dr3->UpdateLimits();
@@ -651,9 +673,25 @@
 sx = 200+mFgScSz*100;
 sy = 200+mFgScSz*100;
-win = GetWindow(opt, sx, sy, px, py, flag, (char *)name.c_str());
+win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
 PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)name.c_str(), sx, sy, px, py);
 wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
 wd3->SetUserData(NULL, oid);
-wd3->AddDrawer3D(dr3, true);
+
+// Decodage des options :
+vector<string> scwatt;
+// wd3->SetAxesFlags(mAxesFlags);  Attributs d'axes 3D a faire 
+if ( mDefaultAtt.size() > 0) { 
+  scwatt = mDefaultAtt;
+  wd3->DecodeOptionString(scwatt, true);
+}
+if ( mAxesAtt.size() > 0) { 
+  scwatt = mAxesAtt;
+  wd3->DecodeOptionString(scwatt, true);
+}
+if (opts.size() > 0)  
+  dr3->DecodeOptionString(opts, true);
+if (opts.size() > 0)  
+  wd3->DecodeOptionString(opts, false);
+
 //   Titre du plot
 if (mAddTitle) {
@@ -661,5 +699,8 @@
   wd3->SetTitles(title, t2);    
 }
+
+wd3->AddDrawer3D(dr3, true);
 // wd3->Refresh();   ?Pas necessaire   $CHECK$ 05/05/99
+
 mCurWin = win;
 mCurWdg = wd3;
@@ -671,30 +712,32 @@
 
 /* --Methode-- */
-void PIStdImgApp::AddText(string const & txt, double xp, double yp)
+void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop)
 {
 PIElDrawer *eld=CurrentElDrawer();
 if (eld == NULL) return;
 
-if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
-  eld->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 
-if ( mFName != PI_DefaultFont ) 
-  eld->GetGraphicAtt().SetFontAtt(mFName, eld->GetGraphicAtt().GetFontSz(), 
-				  eld->GetGraphicAtt().GetFontAtt());
-eld->ElAddText(xp,yp,txt.c_str(),mFCol);
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+eld->ElAddText(xp,yp,txt.c_str(), gratt.GetColor());
 eld->Refresh();
 }
 
 /* --Methode-- */
-void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2)
+void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, string const& sop)
 {
 PIElDrawer *eld=CurrentElDrawer();
 if (eld == NULL) return;
 
-eld->ElAddLine(xp1, yp1, xp2, yp2, mFCol);
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+eld->ElAddLine(xp1, yp1, xp2, yp2, gratt.GetColor());
 eld->Refresh();
 }
 
 /* --Methode-- */
-void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, bool fgfill)
+void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, 
+			       string const& sop, bool fgfill)
 {
 PIElDrawer *eld=CurrentElDrawer();
@@ -715,17 +758,26 @@
   yp = yp2; dy = yp1-yp2;
 }
-if (fgfill) eld->ElAddFRect(xp, yp, dx, dy, mFCol);
-else eld->ElAddRect(xp, yp, dx, dy, mFCol);
+
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+
+if (fgfill) eld->ElAddFRect(xp, yp, dx, dy, gratt.GetColor());
+else eld->ElAddRect(xp, yp, dx, dy, gratt.GetColor());
 eld->Refresh();
 }
 
 /* --Methode-- */
-void PIStdImgApp::AddCircle(double xc, double yc, double r, bool fgfill)
+void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, bool fgfill)
 {
 PIElDrawer *eld=CurrentElDrawer();
 if (eld == NULL) return;
 
-if (fgfill) eld->ElAddFCirc(xc, yc, r, mFCol);
-else eld->ElAddCirc(xc, yc, r, mFCol);
+vector<string> opts;
+ParseDisplayOption(sop, opts);
+PIGraphicAtt gratt(opts);
+
+if (fgfill) eld->ElAddFCirc(xc, yc, r, gratt.GetColor());
+else eld->ElAddCirc(xc, yc, r, gratt.GetColor());
 eld->Refresh();
 }
@@ -737,9 +789,4 @@
 if (eld == NULL) return;
 
-if ( (mFSz != PI_NotDefFontSize) && (mFAtt != PI_NotDefFontAtt) ) 
-  eld->GetGraphicAtt().SetFontAtt(mFSz, mFAtt); 
-if ( mFName != PI_DefaultFont ) 
-  eld->GetGraphicAtt().SetFontAtt(mFName, eld->GetGraphicAtt().GetFontSz(), 
-				  eld->GetGraphicAtt().GetFontAtt());
 eld->SetTitles(titletop, titlebottom);
 eld->Refresh();
@@ -815,5 +862,5 @@
 
 /* --Methode-- */
-PIWindow* PIStdImgApp::GetWindow(int typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom)
+PIWindow* PIStdImgApp::GetWindow(DispWinEnum typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom)
 {
 PIWindow* rw;
@@ -821,4 +868,5 @@
 switch (typ) {
   case Disp_Next :  // Fenetre graphique courante
+  case Disp_Default :
     {
     if (mGrW == NULL) CreateGraphWin();
@@ -993,4 +1041,29 @@
 }
 
+/* --Methode-- */
+void PIStdImgApp::StatZoomWindowSetVisible(bool fg)
+{
+
+  if (fg) {
+    consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free); 
+    int szy = MainWin()->YSize();
+    MainWin()->SetSize(MainWin()->XSize(), szy+statcont->YSize());
+    consolecont->SetPos(0, statcont->YSize());
+    consolecont->SetSize(MainWin()->XSize(), szy);
+    consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 
+    statcont->Show();
+    m[3]->SetStateMsg(10470, true);
+  }
+  else {
+    statcont->Hide();
+    consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free); 
+    MainWin()->SetSize(MainWin()->XSize(), MainWin()->YSize()-statcont->YSize());
+    consolecont->SetPos(0, 0);
+    consolecont->SetSize(MainWin()->XSize(), MainWin()->YSize());
+    consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed); 
+    m[3]->SetStateMsg(10470, false);    
+  }
+  
+}
 
 /* --Methode-- */
@@ -1040,4 +1113,64 @@
 m[4]->SetSensitivityMsg(10516, false);
 }
+
+//---------------------------------------------------------------------------
+//--------- Gestion des attributs graphiques et autres options de trace -----
+
+/* --Methode-- */
+void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)
+{
+  mIXmin = xmin;  mIXmax= xmax;
+  mIYmin = ymin;  mIYmax= ymax;
+}
+
+/* --Methode-- */
+void PIStdImgApp::SetDefaultGraphicAttributes(string const & opt)
+{
+  ParseDisplayOption(opt, mDefaultAtt);
+}
+
+/* --Methode-- */
+void PIStdImgApp::SetDefaultAxesAttributes(string const & opt)
+{
+  ParseDisplayOption(opt, mAxesAtt);
+}
+
+/* --Methode-- */
+DispWinEnum PIStdImgApp::ParseDisplayOption(string const & sop, vector<string>& opts)
+{
+  DispWinEnum rc = Disp_Next;
+  //DBG  cerr << " DBG-Parse-A sop=" << sop << " sop.length()= " << sop.length() << endl;
+  if (opts.size() > 0)  opts.erase(opts.begin(), opts.end());
+  if (sop.length() < 1) return(rc);
+  string gratt = sop;
+  for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
+  if ( (gratt == "def") || (gratt == "default") ) return(rc);
+// On separe en mots espaces par des blancs ou tabulation 
+  size_t p = 0;
+  size_t q = 0;
+  size_t l = gratt.length();
+  string token;
+  while (q < l)  {
+    p = gratt.find_first_not_of(" \t",q);   // au debut d'un token
+    if (p >= l) break;
+    q = gratt.find_first_of(" \t",p);       // Premier blanc ou tab suivant
+    if (q<l) token = gratt.substr(p,q-p);
+    else token = gratt.substr(p);
+    if (token == "") continue;
+    // Decodage option fenetre d'affichage (win, next, ...)
+    if (token == "win")   rc =  Disp_Win;
+    else if (token == "same")  rc = Disp_Same;
+    else if (token == "inset")   rc = Disp_Inset;
+    else  if (token == "stack")   rc = Disp_Stack;
+    // Option a etre decode par les drawers, etc ...
+    else  opts.push_back(token); 
+  }
+
+  //DBG  cerr << " DBG-Parse-B opts.size()=" << opts.size() << endl;
+  return (rc);
+}
+
+//---------------------------------------------------------------------------
+//------------       Methodes privees (MBProcessx, ...)    ----------
 
 /* --Methode-- */
@@ -1295,4 +1428,7 @@
       DeleteWindow(mCurWin);
       break;
+    case 10470 :
+      StatZoomWindowSetVisible(m[3]->GetStateMsg(10470));
+      break;
   default:
     cerr << "PIStdImgApp::MBProcess4() BUG?? Msg= " <<  msg << endl;    
@@ -1461,119 +1597,4 @@
 
 
-/* --Methode-- */
-void PIStdImgApp::SetColAtt(PIColors fg, PIColors bg)
-{
-  mFCol = fg;
-  mBCol = bg;
-}
-/* --Methode-- */
-void PIStdImgApp::SetLineAtt(PILineAtt lat)
-{
-  mLAtt = lat;
-}
-
-/* --Methode-- */
-void PIStdImgApp::SetFontName(PIFontName fn)
-{
-  mFName = fn;
-}
-
-/* --Methode-- */
-void PIStdImgApp::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
-{
-  mFSz = fsz;
-  mFAtt = fat;
-}
-/* --Methode-- */
-void PIStdImgApp::SetMarkerAtt(int sz, PIMarker mrk)
-{
-  mMSz = sz;
-  mMrk = mrk;
-}
-
-/* --Methode-- */
-void PIStdImgApp::SetZoomAtt(int zoom)
-{
-  if ( (zoom > 10) || (zoom < -10) ) zoom = 0;
-  mZoom = zoom;
-}
-/* --Methode-- */
-void PIStdImgApp::SetAxesAtt(unsigned int axfl)
-{
-  mAxesFlags = axfl; 
-}
-/* --Methode-- */
-void PIStdImgApp::SetXYLimits(double xmin, double xmax, double ymin, double ymax)
-{
-  mXmin = xmin;  mXmax= xmax;
-  mYmin = ymin;  mYmax= ymax;
-}
-/* --Methode-- */
-void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)
-{
-  mIXmin = xmin;  mIXmax= xmax;
-  mIYmin = ymin;  mIYmax= ymax;
-}
-/* --Methode-- */
-void PIStdImgApp::SetImageCenterPosition(int x, int y)
-{
-  mXImgCenter = x;  mYImgCenter = y;
-}
-
-/* --Methode-- */
-void PIStdImgApp::SaveGraphicAtt()
-{
-  mSFCol = mFCol;
-  mSBCol = mBCol;
-  mSLAtt = mLAtt;
-  mSFName = mFName;
-  mSFSz = mFSz;
-  mSFAtt = mFAtt;
-  mSMSz = mMSz;
-  mSMrk = mMrk;
-  mSCmapid = mCmapid;
-  mSRevCmap = mRevCmap;
-  mSZoom = mZoom;
-  mSAxesFlags = mAxesFlags;
-  mSXmin = mXmin;  mSXmax = mXmax;
-  mSYmin = mYmin;  mSYmax = mYmax;
-  mSIXmin = mIXmin;  mSIXmax = mIXmax;
-  mSIYmin = mIYmin;  mSIYmax = mIYmax;
-  mSFXYlim = mFXYlim;
-  mSXImgCenter = mXImgCenter;
-  mSYImgCenter = mYImgCenter;
-  mSFImgCenter = mFImgCenter;
-  mSaXlog = maXlog;
-  mSaYlog = maYlog;
-  mSAddTitle = mAddTitle;
-}
-
-/* --Methode-- */
-void PIStdImgApp::RestoreGraphicAtt()
-{
-  mFCol = mSFCol;
-  mBCol = mSBCol;
-  mLAtt = mSLAtt;
-  mFName = mSFName;
-  mFSz = mSFSz;
-  mFAtt = mSFAtt;
-  mMSz = mSMSz;
-  mMrk = mSMrk;
-  mCmapid = mSCmapid;
-  mRevCmap = mSRevCmap;
-  mZoom = mSZoom;
-  mAxesFlags = mSAxesFlags;
-  mXmin = mSXmin;  mXmax = mSXmax;
-  mYmin = mSYmin;  mYmax = mSYmax;
-  mIXmin = mSIXmin;  mIXmax = mSIXmax;
-  mIYmin = mSIYmin;  mIYmax = mSIYmax;
-  mFXYlim = mSFXYlim;
-  mXImgCenter = mSXImgCenter;
-  mYImgCenter = mSYImgCenter;
-  mFImgCenter = mSFImgCenter;
-  maXlog = mSaXlog;
-  maYlog = mSaYlog;
-  mAddTitle = mSAddTitle;
-}
 
 //  -------------------------------------------------
@@ -1620,6 +1641,6 @@
 string info = "piapp : Interactive analysis program\n";
 info += buff;
-info += "(C) LAL-IN2P3/CNRS  1996-2000\n";
-info += "(C) SPP-DAPNIA/CEA  1996-2000\n";
+info += "(C) LAL-IN2P3/CNRS  1996-2002\n";
+info += "(C) SPP-DAPNIA/CEA  1996-2002\n";
 infow_txt->SetText(info);
 }
