Index: /trunk/SophyaPI/PI/piscdrawwdg.cc
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 1881)
+++ /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 1882)
@@ -82,5 +82,5 @@
   mFgDeltaPos = false;
   mPosForDelta[0] = mPosForDelta[1] = 0.;
-  mPosForDeltaX = mPosForDeltaY = 0;
+  mPosFDX = mPosFDY = 0;
 
   mBDrw = new PIElDrawer;
@@ -186,4 +186,5 @@
   mFormatOpt[0] = SetFormatOpt(xmin,xmax);
   mFormatOpt[1] = SetFormatOpt(ymin,ymax);
+  UpdatePosForDeltaMarker(false, true);
 }
   
@@ -320,5 +321,4 @@
 PIScDrawWdg::But1Press(int x, int y)
 {
-  int pos = (x>XSize()/2) ? PI_HorizontalRight: PI_HorizontalLeft;
   UpdateText(x, y);
   if (mTrW)
@@ -331,5 +331,5 @@
     mTrW->Show();
     }
-  if (mFgReticule) { // On trace une reticule
+  if (mFgReticule || mFgDeltaPos) { // On trace une reticule
     cForCol = mWGrC->GetForeground();
     cGOmod  = mWGrC->GetGOMode();
@@ -338,16 +338,8 @@
     mWGrC->SelGOMode(PI_GOXOR);
     mWGrC->SelLine(PI_ThinLine);
-    mWGrC->DrawLine(x, 0, x, YSize());
-    mWGrC->DrawLine(0, y, XSize(), y);
-    mCPosX = x;   mCPosY = y;
-    char buff[128];
-    string format1 = "X= "; format1 += mFormatOpt[0].c_str();
-    string format2 = "Y= "; format2 += mFormatOpt[1].c_str();
-    sprintf(buff,format1.c_str(), mPPos[0], pos);
-    mWGrC->DrawString(x+10, y-10, buff); 
-    sprintf(buff,format2.c_str(), mPPos[1], pos);
-    mWGrC->DrawString(x+10, y+20, buff); 
-    }
+  }
+  if (mFgReticule)  DrawReticule(x,y,0);
   else SelPointerShape(PI_CrossPointer);
+  if (mFgDeltaPos)  DrawDeltaPosMarker();
 
   Send(Msg(), PIMsg_Active);
@@ -359,26 +351,6 @@
 PIScDrawWdg::Ptr1Move(int x, int y)
 {
-  int pos = (x>XSize()/2) ? PI_HorizontalRight: PI_HorizontalLeft;
-  char buff[128];
-  string format1 = "X= "; format1 += mFormatOpt[0].c_str();
-  string format2 = "Y= "; format2 += mFormatOpt[1].c_str();
-  if (mFgReticule) { // On trace une reticule
-    mWGrC->DrawLine(mCPosX, 0, mCPosX, YSize());
-    mWGrC->DrawLine(0, mCPosY, XSize(), mCPosY);
-    sprintf(buff,format1.c_str(), mPPos[0]);
-    mWGrC->DrawString(mCPosX+10, mCPosY-10, buff, pos); 
-    sprintf(buff,format2.c_str(), mPPos[1]);
-    mWGrC->DrawString(mCPosX+10, mCPosY+20, buff, pos); 
-    mWGrC->DrawLine(x, 0, x, YSize());
-    mWGrC->DrawLine(0, y, XSize(), y);
-    mCPosX = x;   mCPosY = y;
-    }  
   UpdateText(x, y);  // Met a jour mPPos
-  if (mFgReticule) {
-    sprintf(buff,format1.c_str(), mPPos[0]);
-    mWGrC->DrawString(mCPosX+10, mCPosY-10, buff, pos); 
-    sprintf(buff,format2.c_str(), mPPos[1]);
-    mWGrC->DrawString(mCPosX+10, mCPosY+20, buff, pos); 
-    }
+  if (mFgReticule)  DrawReticule(x,y,1);
 }
 
@@ -386,22 +358,8 @@
 PIScDrawWdg::But1Release(int x, int y)
 {
-  int pos = (x>XSize()/2) ? PI_HorizontalRight: PI_HorizontalLeft;
   UpdateText(x, y);
-  if (mFgReticule) { // On efface la reticule
-    mWGrC->DrawLine(mCPosX, 0, mCPosX, YSize());
-    mWGrC->DrawLine(0, mCPosY, XSize(), mCPosY);
-    char buff[128];
-    string format1 = "X= "; format1 += mFormatOpt[0].c_str();
-    string format2 = "Y= "; format2 += mFormatOpt[1].c_str();
-    sprintf(buff,format1.c_str(), mPPos[0]);
-    mWGrC->DrawString(mCPosX+10, mCPosY-10, buff, pos); 
-    sprintf(buff,format2.c_str(), mPPos[1]);
-    mWGrC->DrawString(mCPosX+10, mCPosY+20, buff, pos); 
-    mWGrC->SelForeground(cForCol);
-    mWGrC->SelGOMode(cGOmod);
-    mWGrC->SelLine(cLatt); 
-    mCPosX = mCPosY = 0;
-    }
+  if (mFgReticule)  DrawReticule(x,y,2);
   else SelPointerShape(PI_ArrowPointer);
+  if (mFgDeltaPos)  DrawDeltaPosMarker();
   if (mTrW)  mTrW->Hide();
 }
@@ -410,5 +368,4 @@
 PIScDrawWdg::UpdateText(int xp, int yp)
 {
-
   double dx, dy;
   mBDrw->GetGraphicUC()->GrC2UC(xp, yp, dx, dy); 
@@ -427,32 +384,50 @@
 
 void
-PIScDrawWdg::UpdatePosForDeltaMarker(bool fg)
-{
-  if (!mFgDeltaPos && !fg ) return;
-  cForCol = mWGrC->GetForeground();
-  cGOmod  = mWGrC->GetGOMode();
-  cLatt = mWGrC->GetLineAtt();
-  mWGrC->SelForeground(PI_Magenta);
-  mWGrC->SelGOMode(PI_GOXOR);
-  mWGrC->SelLine(PI_NormalLine);
-  if (mFgDeltaPos) {
-    mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY);
-    mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7);
-  }
-  mFgDeltaPos = fg;
+PIScDrawWdg::UpdatePosForDeltaMarker(bool fg, bool fgupd)
+{
+  if (!fgupd)   mFgDeltaPos = fg;
   if (mFgDeltaPos) {
     mPosForDelta[0] = mPPos[0];  
     mPosForDelta[1] = mPPos[1];  
-    mPosForDeltaX = mCPosX;
-    mPosForDeltaY = mCPosY;
-    mWGrC->DrawLine(mPosForDeltaX-7, mPosForDeltaY, mPosForDeltaX+7, mPosForDeltaY);
-    mWGrC->DrawLine(mPosForDeltaX, mPosForDeltaY-7, mPosForDeltaX, mPosForDeltaY+7);
-  }
-  mWGrC->SelForeground(cForCol);
-  mWGrC->SelGOMode(cGOmod);
-  mWGrC->SelLine(cLatt);
+    double pfdx, pfdy;
+    mBDrw->GetGraphicUC()->UC2GrC(mPosForDelta[0], mPosForDelta[1], 
+				 pfdx, pfdy); 
+    mPosFDX = (int)pfdx;  mPosFDY = (int)pfdy;
+  }
   return;
 }
 
+
+void
+PIScDrawWdg::DrawReticule(int x, int y, int op)
+{
+  if (!mFgReticule) return;
+  //  int pos = (x>XSize()/2) ? PI_HorizontalRight: PI_HorizontalLeft;
+  //  char buff[128];
+  //  string format1 = "X= "; format1 += mFormatOpt[0].c_str();
+  //  string format2 = "Y= "; format2 += mFormatOpt[1].c_str();
+  if (op > 0) { // on efface le precedent 
+    mWGrC->DrawLine(mCPosX, 0, mCPosX, YSize());
+    mWGrC->DrawLine(0, mCPosY, XSize(), mCPosY);
+    //    sprintf(buff,format1.c_str(), mPPos[0]);
+    //    mWGrC->DrawString(mCPosX+10, mCPosY-10, buff, pos); 
+    //    sprintf(buff,format2.c_str(), mPPos[1]);
+    //    mWGrC->DrawString(mCPosX+10, mCPosY+20, buff, pos); 
+  }
+  if (op < 2) {
+    mWGrC->DrawLine(x, 0, x, YSize());
+    mWGrC->DrawLine(0, y, XSize(), y);
+    mCPosX = x;   mCPosY = y;
+  }  
+}
+
+void
+PIScDrawWdg::DrawDeltaPosMarker()
+{
+  if (mFgDeltaPos) {
+    mWGrC->DrawLine(mPosFDX-14., mPosFDY, mPosFDX+14, mPosFDY);
+    mWGrC->DrawLine(mPosFDX, mPosFDY-14, mPosFDX, mPosFDY+14);
+  }  
+}
 
 // .............................
Index: /trunk/SophyaPI/PI/piscdrawwdg.h
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 1881)
+++ /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 1882)
@@ -90,8 +90,8 @@
   double mPPos[2];        // Position courante (user coordinates)
   double mPSz[2];         // Taille courant du pave info 
-  int mCPosX, mCPosY;     // Position click souris X,Y
+  int mCPosX, mCPosY;     // Position click souris X,Y (pour trace de reticule)
   bool mFgDeltaPos;       // affichage de l'ecart par rapport a la position memorisee
   double mPosForDelta[2];     // Position memorisee - Pour affichage d'ecart
-  int mPosForDeltaX, mPosForDeltaY; // Position click memorisee - Pour affichage d'ecart
+  int mPosFDX, mPosFDY;       // Position (coord fenetre memorise)
   bool mFgReticule;       // Controle l'affiche d'une réticule (Bouton-1)
   string mFormatOpt[2];   // Format optimal d'impression des textes
@@ -115,5 +115,7 @@
 private:
   void  UpdateText(int xp, int yp);
-  void  UpdatePosForDeltaMarker(bool fg);
+  void  UpdatePosForDeltaMarker(bool fg, bool fgupd=false);
+  void  DrawReticule(int x, int y, int op);
+  void  DrawDeltaPosMarker();
 };
 
