Index: /trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- /trunk/SophyaPI/PIext/basexecut.cc	(revision 2650)
+++ /trunk/SophyaPI/PIext/basexecut.cc	(revision 2651)
@@ -714,11 +714,12 @@
 
 // >>>>>>>>>>>  Affichage des objets 
-else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {
-  if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }
+else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") || (kw == "imagnav") ) {
+  if (tokens.size() < 1) { cout << "Usage: disp/surf/imag/imagnav nameobj [opt]" << endl; return(0); }
   string opt = "next";
   if (tokens.size() > 1)  opt = tokens[1];
   if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt);
   else if (kw == "surf")  mObjMgr->DisplaySurf3D(tokens[0], opt);
-  else if (kw == "imag")  mObjMgr->DisplayImage(tokens[0], opt);
+  else if (kw == "imag")  mObjMgr->DisplayImage(tokens[0], opt, false);
+  else if (kw == "imagnav")  mObjMgr->DisplayImage(tokens[0], opt, true);
   }
 
@@ -1638,5 +1639,10 @@
 kw = "imag";
 usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]";
-usage += "\n  Related commands: disp surf nt2d nt3d vecplot";  
+usage += "\n  Related commands: disp imagnav surf nt2d nt3d vecplot";  
+mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
+kw = "imagnav";
+usage = "Displays an object as an image with the ImageNavigator viewer \n";
+usage += "Usage: imagnav nameobj [graphic_attributes]";
+usage += "\n  Related commands: disp imag surf nt2d nt3d vecplot";  
 mpiac->RegisterCommand(kw, usage, this, "Obj. Display");
 kw = "surf";
Index: /trunk/SophyaPI/PIext/nobjmgr.cc
===================================================================
--- /trunk/SophyaPI/PIext/nobjmgr.cc	(revision 2650)
+++ /trunk/SophyaPI/PIext/nobjmgr.cc	(revision 2651)
@@ -1311,5 +1311,5 @@
   else wrsid = myImgApp->DispScDrawer( dr, n1, dopt, "", 0, fglock); 
   }
-else if (arr) wrsid = myImgApp->DispImage(arr, n1, dopt, 0, fglock);
+else if (arr) wrsid = myImgApp->DispImage(arr, n1, dopt, false, 0, fglock);
 
 AddWRsId(nom, wrsid);
@@ -1318,5 +1318,5 @@
 
 /* --Methode-- */
-void NamedObjMgr::DisplayImage(string& nom, string dopt)
+void NamedObjMgr::DisplayImage(string& nom, string dopt, bool fgimagnav)
 {
 ZSync(*myMutex);
@@ -1349,5 +1349,5 @@
 
 int wrsid = 0;
-wrsid = myImgApp->DispImage(arr, n1, dopt, 0, fglock);
+wrsid = myImgApp->DispImage(arr, n1, dopt, fgimagnav, 0, fglock);
 
 AddWRsId(nom, wrsid);
Index: /trunk/SophyaPI/PIext/nobjmgr.h
===================================================================
--- /trunk/SophyaPI/PIext/nobjmgr.h	(revision 2650)
+++ /trunk/SophyaPI/PIext/nobjmgr.h	(revision 2651)
@@ -83,5 +83,5 @@
 //  Affichage des objets 
   virtual void          DisplayObj(string & nom, string dopt="");
-  virtual void          DisplayImage(string & nom, string dopt="");
+  virtual void          DisplayImage(string & nom, string dopt="", bool fgimagnav=false);
   virtual void          DisplaySurf3D(string & nom, string dopt="");
   virtual void          DisplayNT(string & nom, string& nmx, string& nmy, string& nmz,  
Index: /trunk/SophyaPI/PIext/piaversion.h
===================================================================
--- /trunk/SophyaPI/PIext/piaversion.h	(revision 2650)
+++ /trunk/SophyaPI/PIext/piaversion.h	(revision 2651)
@@ -2,5 +2,5 @@
 #define PIAPPVERSION_H_SEEN
 
-#define PIAPP_VERSIONNUMBER  3.97
+#define PIAPP_VERSIONNUMBER  3.972
 
 #endif
Index: /trunk/SophyaPI/PIext/pistdimgapp.cc
===================================================================
--- /trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2650)
+++ /trunk/SophyaPI/PIext/pistdimgapp.cc	(revision 2651)
@@ -661,5 +661,5 @@
 PIApplication::SetBusy();
 // Attention : Appel XSync specifique X11 -  en attendant multi-thread
-XSync(PIXDisplay(), False);  
+// XSync(PIXDisplay(), False);  RZDEL
 }
 
@@ -671,5 +671,5 @@
 PIApplication::SetBlocked();
 // Attention : Appel XSync specifique X11 -  en attendant multi-thread
-XSync(PIXDisplay(), False);  
+// XSync(PIXDisplay(), False);  RZDEL
 }
 
@@ -701,7 +701,8 @@
 /* --Methode-- */
 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, 
-			   int oid, bool fglock)
-{
-PIImage* pii;
+			   bool fgimagnav, int oid, bool fglock)
+{
+PIImage* pii=NULL;
+PIImageNavigator* piin=NULL; 
 PIWindow* win;
 int sx, sy, px, py, flag;
@@ -738,12 +739,23 @@
 px = py = 0;
 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);
-pii->SetZoomWin(zoom, false);
-pii->SetGloVWin(gimv, false);
-pii->SetCMapWin(cmapv, false);
-pii->ShowCursor(true);
-pii->SetUserData(NULL, oid);
-
+if (fgimagnav) {  // Creation de naviguateur d'image 
+  piin = new PIImageNavigator(win, (char *)name.c_str(), sx, sy, px,py);
+  piin->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
+  piin->ImageWdg()->ShowCursor(true);
+  pii = piin->ImageWdg();
+  pii->SetUserData(NULL, oid);
+  //  XSync(PIXDisplay(), False);  
+  // cout << " DBG-ImagNav-BBB-BBB Apres XSync() " << endl;  
+  
+}
+else { // Creation de widget PIImage normal
+  pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py);
+  pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
+  pii->SetZoomWin(zoom, false);
+  pii->SetGloVWin(gimv, false);
+  pii->SetCMapWin(cmapv, false);
+  pii->ShowCursor(true);
+  pii->SetUserData(NULL, oid);
+}
 
 // On recalcule la taille de la fenetre si Disp_Win
@@ -776,6 +788,6 @@
 mBWList[mBWId] = pii;
 // pii->Refresh();
-pii->Apply();
-cmapv->Refresh();
+  pii->Apply(true);
+  //  cmapv->Refresh();  Pas besoin ? , Reza Fev 2005 
 return(mBWId); 
 }
@@ -1380,5 +1392,5 @@
     PIWdg* nw = mGrW->NextChildPosSize(px, py, sx, sy);
 //    cerr << "**DBG** PIStdImgApp::GetWindow() DispNext : nw = " << (long)nw << endl;
-    if (nw) DeleteBaseWidget((PIBaseWdg*)nw, false, false);
+    if (nw) DeleteWidget(nw, false, false);
     flag = mGrIdx;
     mGrIdx = (mGrIdx+1)%(nx*ny);
@@ -1430,5 +1442,5 @@
   for(k=0; k<mGrW->NbChilds(); k++) {
     if ((cwd = mGrW->GetChild(k)) == NULL)  continue; 
-    DeleteBaseWidget((PIBaseWdg*)cwd, false, false);
+    DeleteWidget(cwd, false, false);
     }
   mGrW->SetZone(nzx, nzy);
@@ -1461,5 +1473,5 @@
 for(k=0; k<w->NbChilds(); k++) {
   if ((cwd = w->GetChild(k)) == NULL)  continue; 
-  DeleteBaseWidget((PIBaseWdg*)cwd,false,false);
+  DeleteWidget(cwd,false,false);
   }
 delete w;
@@ -1468,5 +1480,5 @@
 
 /* --Methode-- */
-void PIStdImgApp::DeleteBaseWidget(PIBaseWdg* w, bool dw, bool dwin)
+void PIStdImgApp::DeleteWidget(PIWdg* w, bool dw, bool dwin)
 {
 if (w == NULL)  return;
@@ -1474,14 +1486,20 @@
 for(it = mBWList.begin(); it != mBWList.end(); it++) 
   if ((*it).second == w)  { mBWList.erase(it);  break; }
-int k;
-PIDrawer* drw;
-for(k=0; k<w->NbDrawers(); k++) {
-  if ((drw = w->GetDrawer(k)) == NULL)  continue; 
-  DrwMList::iterator itt;
-  for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 
-    if ((*itt).second == drw)  { mDrwList.erase(itt);  break; }
-  }
-
-if (w == mCurWdg) {  
+PIBaseWdg* bw = dynamic_cast<PIBaseWdg *>(w);
+if (bw != NULL) {
+  PIDrawer* drw;
+  int k;
+  for(k=0; k<bw->NbDrawers(); k++) {
+    if ((drw = bw->GetDrawer(k)) == NULL)  continue; 
+    DrwMList::iterator itt;
+    for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 
+      if ((*itt).second == drw)  { mDrwList.erase(itt);  break; }
+  }
+}
+
+// Reza Fev 2005 - On met systematiquement mCurWdg et mLastWdg a NULL
+// Il peuvent en effet etre un des fils du widget qui est supprime
+// if (w == mCurWdg) {  
+if (true) {    // Reza Fev 2005 - mCurWdg = NULL systematique
   mCurWdg = NULL;
   if (mFgCWImg) {
@@ -1492,13 +1510,20 @@
   }
 
-if (w == mLastWdg)  mLastWdg = NULL;
+// if (w == mLastWdg)  mLastWdg = NULL;
+mLastWdg = NULL; // Reza Fev 2005 - mLastWdg = NULL systematique
 
 PIWdg* pw=NULL;
-if (dwin)  pw = (PIWdg*)(w->Parent());
-//DBG printf("DeleteBaseWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 
-if (dw) delete w;
-if (pw && (pw->kind() == PIWindow::ClassId )) {
- PIWindow* pww = (PIWindow*) pw;
- if ((pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 
+pw = (PIWdg*)(w->Parent());
+//DBG printf("DeleteWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 
+if (dw) { 
+  if (pw && (pw->kind() == PIImageNavigator::ClassId) )  { 
+    delete pw;
+    pw = NULL;
+  }
+  else delete w;
+}
+if (dwin && pw && (pw->kind() == PIWindow::ClassId )) {
+ PIWindow* pww = dynamic_cast<PIWindow *>(pw);
+ if (pww && (pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 
     DeleteWindow((PIWindow*)pw);
  } 
@@ -1516,7 +1541,7 @@
   it  = mBWList.find(k);
   if (it == mBWList.end())  return;
-  PIBaseWdg* wd = (*it).second;
+  PIWdg* wd = (*it).second;
 //DBG cerr << "-DBG- PIStdImgApp::DelWRsId Deleting BaseWidget " << (long)(wd) << endl ; 
-  DeleteBaseWidget(wd, true, true);
+  DeleteWidget(wd, true, true);
   }
 else {  // C'est un drawer
@@ -1867,5 +1892,5 @@
     if (mCurWdg) {
       int oid = mCurWdg->UserFlag();
-      DeleteBaseWidget(mCurWdg);
+      DeleteWidget(mCurWdg);
       mObjMgr->DelObj_Id(oid);
       }
@@ -1964,5 +1989,5 @@
     if (mStW) {
       PIWdg* cw =  mStW->CurrentWdg();
-      if (cw) DeleteBaseWidget((PIBaseWdg*)cw);
+      if (cw) DeleteWidget(cw);
       }
     break;
Index: /trunk/SophyaPI/PIext/pistdimgapp.h
===================================================================
--- /trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2650)
+++ /trunk/SophyaPI/PIext/pistdimgapp.h	(revision 2651)
@@ -41,5 +41,5 @@
 
 typedef map<long, PIWindow*, less<long> > WindMList;
-typedef map<long, PIBaseWdg*, less<long> > BWMList;
+typedef map<long, PIWdg*, less<long> > BWMList;
 typedef map<long, PIDrawer*, less<long> > DrwMList;
 
@@ -66,5 +66,5 @@
   // Methodes d'Affichage generique
      int  DispImage(P2DArrayAdapter* nouv, string const & name, string const & opt, 
-		    int oid=0, bool fglock=true);
+		    bool fgimagnav=false, int oid=0, bool fglock=true);
      int  DispScDrawer(PIDrawer* scd, string const & name, string const & opt, 
 		       string title="", int oid=0, bool fglock=true);
@@ -114,5 +114,5 @@
 
      void DeleteWindow(PIWindow* w);
-     void DeleteBaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);
+     void DeleteWidget(PIWdg* w, bool dw=true, bool dwin=true);
      void DelWRsId(int k);
      bool CheckWRsId(int k);
