Index: trunk/SophyaPI/PI/pibwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/pibwdggen.cc	(revision 117)
+++ trunk/SophyaPI/PI/pibwdggen.cc	(revision 118)
@@ -57,5 +57,5 @@
 puts("Debug_PIBaseWdgGen::Draw() Efface la fenetre par defaut ! ");
 #endif
-EraseWindow(0, 0, XSize(), YSize());
+if (g->kind() != PI_PSFileGraphics) EraseWindow(0, 0, XSize(), YSize());
 if (fgdrawloop == 0) 
   { fgdrawloop=2;  Draw(g, 0, 0, XSize(), YSize()); }
Index: trunk/SophyaPI/PI/piimage.h
===================================================================
--- trunk/SophyaPI/PI/piimage.h	(revision 117)
+++ trunk/SophyaPI/PI/piimage.h	(revision 118)
@@ -62,4 +62,6 @@
   inline int XSzPave() { return(xszpav); }
   inline int YSzPave() { return(yszpav); }
+
+  inline PIElDrawer* MyElDrawer() { return (mdrw); }
 
   void Apply(bool mw=true);
Index: trunk/SophyaPI/PI/piimgtools.cc
===================================================================
--- trunk/SophyaPI/PI/piimgtools.cc	(revision 117)
+++ trunk/SophyaPI/PI/piimgtools.cc	(revision 118)
@@ -33,5 +33,5 @@
 
 int wszx = 8*spx+3*bsx+2*bsy; 
-int wszy = 10*spy+9*bsy;
+int wszy = 9*spy+9*bsy;
 SetSize(wszx, wszy);
 
@@ -84,14 +84,14 @@
 cpy += 2*spy+bsy; 
 cpx = bsx/2;
-mBut[0] = new PIButton(this, "Apply", 2500, bsx*1.5, bsy, cpx, cpy);
+mBut[0] = new PIButton(this, "Apply", 2500, bsx*1.75, bsy, cpx, cpy);
 cpx += bsx*2;
-mBut[1] = new PIButton(this, "Dismiss", 2600,  bsx*1.5, bsy, cpx, cpy);
+mBut[1] = new PIButton(this, "Dismiss", 2600,  bsx*1.75, bsy, cpx, cpy);
 mBut[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 mBut[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-int offy = cpy+bsy+spy*3;
-printf("-DBG- PIImgLutWind()  SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy);
-
-cpx = 6*spx+2.75*bsx;
+int offy = cpy+bsy+spy*2;
+// printf("-DBG- PIImgLutWind()  SzX,Y= %d %d , ButPos= %d %d (off=%d)\n", wszx, wszy, cpx, cpy, offy);
+
+cpx = 4*spx+2.75*bsx;
 cpy = 2*spy;
 mSc[0] = new PIScale(this, "sc-offset-lut", 2700, false, bsy*0.75, 4.5*bsy, cpx, cpy); 
@@ -106,7 +106,7 @@
 
 //  Option-Menu  Couleur/Zoom
-cpx = 3*spx;
+cpx = bsx/2;
 cpy = offy;
-mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", 1.5*bsx, bsy, cpx, cpy);
+mOptzc[0] = new PIOptMenu(this, "imglut-opt-3", bsx*1.75, bsy, cpx, cpy);
 mOptzc[0]->AppendItem("Grey32", 201);
 mOptzc[0]->AppendItem("GreyInv32", 202);
@@ -122,6 +122,6 @@
 mOptzc[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-cpx += 1.5*bsx+3*spx;
-mOptzc[1] = new PIOptMenu(this, "imglut-opt-4", 1.5*bsx, bsy, cpx, cpy);
+cpx += bsx*2;
+mOptzc[1] = new PIOptMenu(this, "imglut-opt-4", bsx*1.75, bsy, cpx, cpy);
 mOptzc[1]->AppendItem("Agr. x10", 110);
 mOptzc[1]->AppendItem("Agr. x 8", 108);
@@ -142,31 +142,54 @@
 mOptzc[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-cpx = 2*spx;
-cpy += bsy+spy;
-mButsz[0] = new PIButton(this, "1x1", 3201,  bsx/2, bsy, cpx, cpy);
+int pbsx = bsy;
+int pbsy = bsy;
+int pspx = spy/2;
+int pspy = spy;
+
+cpx = 2*pspx;
+cpy += pbsy+2*spy;
+mButsz[0] = new PIButton(this, "1x1", 3201,  pbsx, pbsy, cpx, cpy);
 mButsz[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButsz[1] = new PIButton(this, "1x2", 3202,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButsz[1] = new PIButton(this, "1x2", 3202,  pbsx, pbsy, cpx, cpy);
 mButsz[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButsz[2] = new PIButton(this, "1x4", 3204,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButsz[2] = new PIButton(this, "1x4", 3204,  pbsx, pbsy, cpx, cpy);
 mButsz[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButsz[3] = new PIButton(this, "1/2", 3198,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButsz[3] = new PIButton(this, "1/2", 3198,  pbsx, pbsy, cpx, cpy);
 mButsz[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButsz[4] = new PIButton(this, "1/4", 3196,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButsz[4] = new PIButton(this, "1/4", 3196,  pbsx, pbsy, cpx, cpy);
 mButsz[4]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
-cpx = 2*spx;
-cpy += bsy+spy;
-mButcax[0] = new PIButton(this, "- X", 5201,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+10*pspx;
+mButoa[0] = new PIButton(this, "+Info", 5311,  1.5*pbsx, pbsy, cpx, cpy);
+mButoa[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+cpx += 1.5*pbsx+pspx;
+mButoa[1] = new PIButton(this, "-Info", 5312,  1.5*pbsx, pbsy, cpx, cpy);
+mButoa[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+
+
+cpx = 2*pspx;
+cpy += pbsy+pspy;
+mButcax[0] = new PIButton(this, "-X", 5201,  pbsx, pbsy, cpx, cpy);
 mButcax[0]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButcax[1] = new PIButton(this, "- Y", 5202,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButcax[1] = new PIButton(this, "-Y", 5202,  pbsx, pbsy, cpx, cpy);
 mButcax[1]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
-cpx += bsx/2+spx;
-mButcax[2] = new PIButton(this, "X<>Y", 5203,  bsx/2, bsy, cpx, cpy);
+cpx += pbsx+pspx;
+mButcax[2] = new PIButton(this, "X-Y", 5203, pbsx, pbsy, cpx, cpy);
 mButcax[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+
+cpx += 1.5*pbsx+pspx+10*pspx;
+mButoa[2] = new PIButton(this, "-All", 5300,  1.5*pbsx, pbsy, cpx, cpy);
+mButoa[2]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+cpx += 1.5*pbsx+pspx;
+mButoa[3] = new PIButton(this, "+Curs", 5321,  1.5*pbsx, pbsy, cpx, cpy);
+mButoa[3]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
+cpx += 1.5*pbsx+pspx;
+mButoa[4] = new PIButton(this, "+Axe", 5331,  1.5*pbsx, pbsy, cpx, cpy);
+mButoa[4]->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
 
 curlutw = this;
@@ -190,4 +213,5 @@
 for(int i=0; i<5; i++)  delete mButsz[i];
 for(int i=0; i<3; i++)  delete mButcax[i];
+for(int i=0; i<5; i++)  delete mButoa[i];
 
 }
@@ -201,7 +225,9 @@
 mpii = PIImage::CurrentPIImage();
 if (mpii == NULL)  return;
-sprintf(buff,"%g", (mpii->Lut())->Min());
+min_lut = mpii->Lut()->Min();
+max_lut = mpii->Lut()->Max();
+sprintf(buff,"%g", min_lut);
 mText[0]->SetText(buff);
-sprintf(buff,"%g", (mpii->Lut())->Max());
+sprintf(buff,"%g", max_lut);
 mText[1]->SetText(buff);
 if ( (mpii->Lut())->Type() == kLutType_Lin ) 
@@ -212,4 +238,6 @@
 mSc[0]->SetValue(0);
 mSc[1]->SetValue(0);
+mOptzc[0]->SetValue(203);
+mOptzc[1]->SetValue(101);
 return;
 }
@@ -238,12 +266,12 @@
     max = atof(mText[1]->GetText().c_str());
     if (msg == 2700) {
-      del = max-min;
-      min += (float)mSc[0]->GetValue()/100*del;
-      max += (float)mSc[0]->GetValue()/100*del;
+      del = max_lut-min_lut;
+      min = min_lut+(float)mSc[0]->GetValue()/100*del;
+      max = max_lut+(float)mSc[0]->GetValue()/100*del;
     }
     if (msg == 2800) {
-      del = max-min;
-      min -= (float)mSc[1]->GetValue()/100.*del*0.5;
-      max += (float)mSc[1]->GetValue()/100.*del*0.5;
+      del = max_lut-min_lut;
+      min = min_lut-(float)mSc[1]->GetValue()/100.*del*0.5;
+      max = max_lut+(float)mSc[1]->GetValue()/100.*del*0.5;
     }
     if ( (msg == 2700) || (msg == 2800) ) {
@@ -253,11 +281,15 @@
       sprintf(buff,"%g", max);
       mText[1]->SetText(buff);
-    }
-    lauto = mOpt[1]->GetValue() - 1200;
+      lauto = 0;
+    }
+    else lauto = mOpt[1]->GetValue() - 1200;
     typ = mOpt[0]->GetValue() - 1100;
     if ( (typ < 0) || (typ > 1) )  typ = 0;
     (PIImage::CurrentPIImage())->SetLut(min, max, typlut[typ], lauto);
-    mSc[0]->SetValue(0);
-    mSc[1]->SetValue(0);
+    if (msg == 2500) { 
+      min_lut = min;   max_lut = max;
+      mSc[0]->SetValue(0);
+      mSc[1]->SetValue(0);
+      }
 //    ((PIImage::CurrentPIImage())->Lut())->Print();
     }
@@ -271,5 +303,4 @@
     {
     PIImage* pimg = PIImage::CurrentPIImage();
-    printf(" --DBG-- msg= %ld  pimg= %lx \n", (long)msg, (long)pimg);
     int zm = msg-3200;
     pimg->SetZoom(zm, false);
@@ -289,7 +320,8 @@
     if ((snx != sx) || (sny != sy))
       {
+      int szinc[2];
       pimg->SetOffset(0, 0, false);
-      if (((PIContainer*)(pimg-Parent()))->NbChilds() == 1)  
-        ((PIContainer*)(pimg-Parent()))->SetSize(snx, sny);
+      szinc[0] = snx-sx;   szinc[1] = sny-sy;
+      pimg->Send(pimg->Msg(), PIMsg_ResizeRequest, szinc);  
       }
     else   pimg->SetOffset(0, 0);
@@ -306,4 +338,20 @@
   case 5203 :
     mpii->ChangeAxesConfiguration(false, false, true);
+    break;
+
+
+  case 5300 :
+    mpii->SetDrawAxesFlags(kAxesNone);
+    mpii->ShowCursor(false);
+    mpii->MyElDrawer()->ElDelAll();
+    mpii->Refresh();
+    break;
+
+  case 5321 :
+    mpii->ShowCursor(true);
+    break;
+
+  case 5331 :
+    mpii->SetDrawAxesFlags();
     break;
 
@@ -324,144 +372,5 @@
   PIImage::CurrentPIImage()->SetColMap(cmap[msg-201]);
 
-}
-
-// --------------------------------------------------------------
-
-/* --Methode-- */
-PIImgMenu::PIImgMenu(PIApplication* par) 
-        : PIMenu(par->Menubar(), "ImgTools")
-{
-pdm[0] = new PIMenu(this, "AutoLut");
-pdm[0]->AppendItem("+3 Sig", 303);
-pdm[0]->AppendItem("+2 Sig", 302);
-pdm[0]->AppendItem("+1 Sig", 301);
-pdm[0]->AppendItem("-1 Sig", 299);
-pdm[0]->AppendItem("-2 Sig", 298);
-AppendPDMenu(pdm[0]);
-
-pdm[1] = new PIMenu(this, "Zoom");
-pdm[1]->AppendItem("Agr. x10", 110);
-pdm[1]->AppendItem("Agr. x 8", 108);
-pdm[1]->AppendItem("Agr. x 6", 106);
-pdm[1]->AppendItem("Agr. x 5", 105);
-pdm[1]->AppendItem("Agr. x 4", 104);
-pdm[1]->AppendItem("Agr. x 3", 103);
-pdm[1]->AppendItem("Agr. x 2", 102);
-pdm[1]->AppendItem("Zoom x1", 101);
-pdm[1]->AppendItem("Red. / 2", 98);
-pdm[1]->AppendItem("Red. / 3", 97);
-pdm[1]->AppendItem("Red. / 4", 96);
-pdm[1]->AppendItem("Red. / 5", 95);
-pdm[1]->AppendItem("Red. / 6", 94);
-pdm[1]->AppendItem("Red. / 8", 92);
-pdm[1]->AppendItem("Red. /10", 90);
-AppendPDMenu(pdm[1]);
-
-pdm[2] = new PIMenu(this, "ColMap");
-pdm[2]->AppendItem("Grey32", 201);
-pdm[2]->AppendItem("GreyInv32", 202);
-pdm[2]->AppendItem("ColRJ32", 203);
-pdm[2]->AppendItem("ColBR32", 204);
-pdm[2]->AppendItem("ColRV32", 205);
-AppendPDMenu(pdm[2]);
-
-AppendItem("Sz x 1", 5101);
-AppendCheckItem("Show Cursor", 5102);
-AppendCheckItem("Show Axes", 5103);
-pdm[3] = new PIMenu(this, "Conf. Axes");
-pdm[3]->AppendItem("Invert-X",  5201);
-pdm[3]->AppendItem("Invert-Y",  5202);
-pdm[3]->AppendItem("Exchange X-Y",  5203);
-AppendPDMenu(pdm[3]);
-
-AppendItem("Lut...", 5300);
-
-mLW = new PIImgLutWind(par);
-}
-
-/* --Methode-- */
-PIImgMenu::~PIImgMenu()
-{
-int i;
-for(i=0; i<4; i++)  delete pdm[i];
-delete mLW;
-}
-
-/* --Methode-- */
-void PIImgMenu::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
-{
-CMapId cmap[5] = { CMAP_GREY32, CMAP_GREYINV32, CMAP_COLRJ32, 
-                   CMAP_COLBR32, CMAP_COLRV32 } ;
-if (PIImage::CurrentPIImage() == NULL)  return;
-msg = UserMsg(msg);
-if ((msg <= 110) && (msg >= 90))  // Zoom
-  PIImage::CurrentPIImage()->SetZoom((int)(msg-100));
-else if ((msg > 200) && (msg < 206)) // Changement de couleur 
-  PIImage::CurrentPIImage()->SetColMap(cmap[msg-201]);
-else if ((msg > 290) && (msg < 310))
-  PIImage::CurrentPIImage()->SetLut( PIImage::CurrentPIImage()->Lut()->Min(), PIImage::CurrentPIImage()->Lut()->Max(), 
-                                 kLutType_Lin, msg-300);
-else if ((msg > 500) && (msg < 505)) {
-  PIImage* mpii = PIImage::CurrentPIImage();
-  float x1 = (mpii->Lut())->Min(); 
-  float x2 = (mpii->Lut())->Max(); 
-  float dx = 0.1*(x2-x1);
-  int typ  = (mpii->Lut())->Type();
-  switch (msg)
-    {
-    case 501 :
-      mpii->SetLut(x1-dx, x2, typ);
-      break;
-    case 502 :
-      mpii->SetLut(x1+dx, x2, typ);
-      break;
-    case 503 :
-      mpii->SetLut(x1, x2-dx, typ);
-      break;
-    case 504 :
-      mpii->SetLut(x1, x2+dx, typ);
-      break;
-    default :
-      break;
-    }
-
-}
-else {
-  PIImage* mpii = PIImage::CurrentPIImage();
-  switch (msg)
-    {
-  case 5101 :
-    mpii->SetOffset(0, 0, false);
-    mpii->SetZoom(1, true);
-    break;
-
-  case 5102 :
-    if (*((bool *)data))  mpii->ShowCursor(true);
-    else  mpii->ShowCursor(false);
-    break;
-
-  case 5103 :
-    if (*((bool *)data))  mpii->SetDrawAxesFlags();
-    else  mpii->SetDrawAxesFlags(kAxesNone);
-    break;
-
-  case 5201 :
-    mpii->ChangeAxesConfiguration(true, false, false);
-    break;
-  case 5202 :
-    mpii->ChangeAxesConfiguration(false, true, false);
-    break;
-  case 5203 :
-    mpii->ChangeAxesConfiguration(false, false, true);
-    break;
-
-  case 5300 :
-    mLW->Show();
-    break;
-
-  default :
-    break;
-  }
-}
 return;
 }
+
Index: trunk/SophyaPI/PI/piimgtools.h
===================================================================
--- trunk/SophyaPI/PI/piimgtools.h	(revision 117)
+++ trunk/SophyaPI/PI/piimgtools.h	(revision 118)
@@ -8,12 +8,11 @@
 #include "pisysdep.h"
 #include PISTDWDG_H
-#include PIMENU_H
 #include PIOPTMENU_H
 #include PIWIN_H
 #include PIAPP_H
 
-// ------ Menu des options et fenetre de dialogue pour changement de LUT --------
+// ------ fenetre de dialogue pour changement de LUT et options de PIImage --------
+// --------------------------------------------------------------------------------
 
-// --------------------------------------------------------------
 class PIImgLutWind : public PIWindow {
 public :
@@ -35,26 +34,16 @@
   PILabel* mOlb[2];
   PIScale* mSc[2];
+  float min_lut,max_lut;
 // Pour la couleur et le zoom
   PIOptMenu* mOptzc[2];
 // Pour expand et compress
   PIButton* mButsz[5];
-// Pour options d'affichage
-  PIButton* mButoa[6];
 // Config axes 
   PIButton* mButcax[3];
+// Options show/hide
+  PIButton* mButoa[5];
 };
 
 
-class PIImgMenu : public PIMenu 
-{
-public :
-			PIImgMenu(PIApplication* app);
- virtual		~PIImgMenu();
-protected:
-  virtual void		Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
-PIMenu* pdm[4];
-PIImgLutWind* mLW;
-};
-
 
 #endif
Index: trunk/SophyaPI/PI/pioptmenux.cc
===================================================================
--- trunk/SophyaPI/PI/pioptmenux.cc	(revision 117)
+++ trunk/SophyaPI/PI/pioptmenux.cc	(revision 118)
@@ -45,4 +45,5 @@
 int n = 0;
 CreateXtWdg(nom, xmPushButtonWidgetClass, NULL, sx, sy, px, py);
+XtSetArg(warg[n],XmNhighlightThickness, 0);  n++;
 XtSetArg(warg[n], XmNrecomputeSize, FALSE); n++;
 XtSetArg(warg[n],XmNnavigationType,XmNONE);  n++;
Index: trunk/SophyaPI/PI/pisurfdr.cc
===================================================================
--- trunk/SophyaPI/PI/pisurfdr.cc	(revision 117)
+++ trunk/SophyaPI/PI/pisurfdr.cc	(revision 118)
@@ -54,5 +54,5 @@
   D *= 1.5;
   
-  Set3DView((xmin+xmax)/2., (ymin+ymax)/2, (zmin+zmax)*0.4, 
+  Set3DView((xmin+xmax)/2., (ymin+ymax)/2, zmin+(zmax-zmin)*0.4, 
             (xmin+xmax)/2.+D , (ymin+ymax)/2.+2.*D , zmin+(zmax-zmin)*0.1, 0.3, 0.3);  
 //  printf("PISurfaceDrawer::UpdateSize() : %g-%g  %g-%g  %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
