Index: trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/basexecut.cc	(revision 553)
+++ trunk/SophyaPI/PIext/basexecut.cc	(revision 558)
@@ -83,4 +83,10 @@
   mImgApp->SetInsetLimits(xmin, xmax, ymin, ymax);
   }
+else if (kw == "setimgcenter") {
+  if (tokens.size() < 2) { cout << "Usage: setimgcenter xc yc" << endl;  return(0); }
+  int xc = atoi(tokens[0].c_str());
+  int yc = atoi(tokens[1].c_str());
+  mImgApp->SetImageCenterPosition(xc, yc);
+  }
 else if (kw == "addtext") {
   if (tokens.size() < 4) { cout << "Usage: addtext x y colfontatt txt" << endl;  return(0); }
@@ -689,4 +695,5 @@
 usage += ">> ZoomFactors: defzoom zoomx1 zoomx2 zoomx3 zoomx4 zoomx5 \n";
 usage += "                               zoom/2 zoom/3 zoom/4 zoom/5 \n";
+usage += ">> Image centering: centerimg -> Position the image in widget \n";
 usage += ">> Axes:  stdaxes=defaxes=boxaxes  simpleaxes boxaxesgrid \n";
 usage += "          fineaxes  grid=fineaxesgrid \n"; 
@@ -695,10 +702,10 @@
 usage += ">> stat/nostat or stats/nostats -> Toggle statistic display flag \n";
 usage += ">> DisplayWindow: next same win stack inset \n";
-usage += "   Related commands: setxylimits setinsetlimits";  
+usage += "   Related commands: setxylimits setinsetlimits setimgcenter";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
 kw = "setxylimits";
 usage = "Define 2-D plot limits \n Usage: setxylimits xmin xmax ymin ymax";
-usage += "\n  Related commands: graphicatt";  
+usage += "\n  Related commands: graphicatt /xylimits";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
@@ -708,5 +715,10 @@
 usage += " graphic object size (0. .. 1.) Xmax at right, YMax top. ";
 usage += " Usage: setinsetlimits xmin xmax ymin ymax";
-usage += "\n  Related commands: graphicatt";  
+usage += "\n  Related commands: graphicatt /inset";  
+mpiac->RegisterCommand(kw, usage, this, "Graphics");
+
+kw = "setimgcenter";
+usage = "Define image center postion \n Usage: setimgcenter xc yc";
+usage += "\n  Related commands: graphicatt /centerimg";  
 mpiac->RegisterCommand(kw, usage, this, "Graphics");
 
Index: trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 553)
+++ trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 558)
@@ -85,4 +85,5 @@
 m[3]->AppendItem("Window 3x1", 10431);
 m[3]->AppendItem("Window 3x3", 10433);
+m[3]->AppendItem("Cur->LastWdg", 10441);
 
 m[4] = new PIMenu(Menubar(),"PostScript");
@@ -202,5 +203,8 @@
 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;
 SaveGraphicAtt();
@@ -215,4 +219,8 @@
 {
 int i;
+
+// Destrucion de tous les objets de NameObjMgr
+string patt = "/*/*";
+mObjMgr->DelObjects(patt, true);
 
 delete mc;
@@ -430,4 +438,7 @@
 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
 pii->SetZoomWin(zoom, false);
+// Centrage eventuel du pave
+if (mFImgCenter && (mXImgCenter > 0) && (mYImgCenter > 0))
+   pii->SetPave(mXImgCenter, mYImgCenter, false, true);
 pii->SetGloVWin(gimv, false);
 pii->SetCMapWin(cmapv, false);
@@ -1115,5 +1126,11 @@
     CreateGraphWin(3,3);
     break;
-
+  case 10441 :
+    if (mCurWdg)  { 
+      mLastWdg = mCurWdg;
+      cout << " Using current widget as last-widget (display same) " << endl;
+      }
+    else  cout << " No current widget - select widget with mouse " << endl;
+    break;
   default:
     cerr << "PIStdImgApp::MBProcess4() BUG?? Msg= " <<  msg << endl;    
@@ -1325,5 +1342,4 @@
   mYmin = ymin;  mYmax= ymax;
 }
-
 /* --Methode-- */
 void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)
@@ -1331,4 +1347,9 @@
   mIXmin = xmin;  mIXmax= xmax;
   mIYmin = ymin;  mIYmax= ymax;
+}
+/* --Methode-- */
+void PIStdImgApp::SetImageCenterPosition(int x, int y)
+{
+  mXImgCenter = x;  mYImgCenter = y;
 }
 
@@ -1351,4 +1372,7 @@
   mSIYmin = mIYmin;  mSIYmax = mIYmax;
   mSFXYlim = mFXYlim;
+  mSXImgCenter = mXImgCenter;
+  mSYImgCenter = mYImgCenter;
+  mSFImgCenter = mFImgCenter;
   mSaXlog = maXlog;
   mSaYlog = maYlog;
@@ -1373,4 +1397,7 @@
   mIYmin = mSIYmin;  mIYmax = mSIYmax;
   mFXYlim = mSFXYlim;
+  mXImgCenter = mSXImgCenter;
+  mYImgCenter = mSYImgCenter;
+  mFImgCenter = mSFImgCenter;
   maXlog = mSaXlog;
   maYlog = mSaYlog;
Index: trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- trunk/SophyaPI/PIext/pistdimgapp.h	(revision 553)
+++ trunk/SophyaPI/PIext/pistdimgapp.h	(revision 558)
@@ -102,5 +102,7 @@
      void  SetXYLimits(double xmin=-1., double xmax=1., double ymin=-1., double ymax=1.);
      void  SetInsetLimits(double xmin=0.4, double xmax=0.6, double ymin=0.4, double ymax=0.6);
+     void  SetImageCenterPosition(int x=-1, int y=-1);
      inline void  UseXYLimits(bool fg=false) {  mFXYlim=fg; }
+     inline void  UseImageCenter(bool fg=false) { mFImgCenter=fg; }
      inline void  SetXLogScale(bool logx=false) { maXlog = logx; }
      inline void  SetYLogScale(bool logy=false) { maYlog = logy; }
@@ -174,5 +176,8 @@
     double	 mIXmin, mIXmax, mIYmin, mIYmax;
     double	 mSIXmin, mSIXmax, mSIYmin, mSIYmax;
+    int		 mXImgCenter, mYImgCenter;
+    int		 mSXImgCenter, mSYImgCenter;
     bool	 mFXYlim, mSFXYlim;
+    bool	 mFImgCenter, mSFImgCenter;
     bool	 maXlog, mSaXlog;
     bool	 maYlog, mSaYlog;
Index: trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.cc	(revision 553)
+++ trunk/SophyaPI/PIext/servnobjm.cc	(revision 558)
@@ -1277,4 +1277,6 @@
   mImgapp->SetXYLimits();
   mImgapp->UseXYLimits();
+  mImgapp->SetImageCenterPosition();
+  mImgapp->UseImageCenter();
   mImgapp->SetXLogScale();
   mImgapp->SetYLogScale();
@@ -1321,4 +1323,5 @@
   // Utilisation limites X-Y
   if ( grt[k] == "xylimits" ) { mImgapp->UseXYLimits(true);  fgsrgr = true;  continue; }
+  if ( grt[k] == "centerimg" ) { mImgapp->UseImageCenter(true);  fgsrgr = true;  continue; }
   // Echelle logarithmique d'axe
   if ( grt[k] == "logx" )  { mImgapp->SetXLogScale(true); fgsrgr = true;  continue; }
