Index: /trunk/SophyaPI/PI/pi3dwdg.cc
===================================================================
--- /trunk/SophyaPI/PI/pi3dwdg.cc	(revision 2538)
+++ /trunk/SophyaPI/PI/pi3dwdg.cc	(revision 2539)
@@ -35,4 +35,5 @@
 //	* <Alt>G : Affichage d'une fenêtre de changement des attributs graphiques
 //	* <Alt>O : Action identique a <Alt>G
+//	* <Alt>D : Affichage du menu de manipulation des traceurs (drawers)
 //	* <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller
 //	sur l'objet à la position courante de la souris
@@ -89,4 +90,7 @@
   cTeta = cPhi = 0.;  cUlen = 1.;
 
+// Menu pour la manipulation des drawers 
+  mDrwMen = NULL;
+
   ActivateKeyboard();
   ActivateButton(2);    //  Pour pouvoir tourner la camera
@@ -106,4 +110,5 @@
   delete mBDrw;
   delete mGr3d;
+  if (mDrwMen) delete mDrwMen;
 }
 
@@ -256,4 +261,9 @@
   else if (key == 'G' || key == 'g') // Fenetre des options graphiques de trace
     PIDrwTools::ShowPIDrwTools(this);   
+  else if (key == 'D' || key == 'd') { // Menu de manipulation des drawers
+    if (mDrwMen) delete mDrwMen;
+    mDrwMen = new PIDrwMgrMenu(this, true);
+    mDrwMen->Show();
+  }  
 
   else if (key == 'A' || key == 'a')  {    // On affiche ou on enleve les axes
Index: /trunk/SophyaPI/PI/pi3dwdg.h
===================================================================
--- /trunk/SophyaPI/PI/pi3dwdg.h	(revision 2538)
+++ /trunk/SophyaPI/PI/pi3dwdg.h	(revision 2539)
@@ -16,4 +16,5 @@
 
 //------------------------------ Classe PIDrawer3D --------------------
+class PIDrwMgrMenu;
 
 class PIDraw3DWdg : public PIBaseWdg {
@@ -84,4 +85,7 @@
   bool  axfg;                  // si Vrai on trace les axes
   bool  skcfg;                 // si Vrai click-2 au centre -> rotation objet
+
+// Menu pour la manipulation des drawers 
+  PIDrwMgrMenu* mDrwMen;
 };
 
Index: /trunk/SophyaPI/PI/pidrwtools.cc
===================================================================
--- /trunk/SophyaPI/PI/pidrwtools.cc	(revision 2538)
+++ /trunk/SophyaPI/PI/pidrwtools.cc	(revision 2539)
@@ -947,5 +947,5 @@
 
   PIGraphic* gr = mBWdg->WindowGraphic();
-  
+  mBWdg->GetActiveDrawer()->HighLight(true);
   PIGOMode gmod =  gr->GetGOMode();
   PILineAtt gline = gr->GetLineAtt();
@@ -976,6 +976,9 @@
 void PIDrwPosSizeEvH::CheckBeforeDelete()
 {
-  if (!_rmok) 
+  if (!_rmok) {
+    PIDrawer* adrw = mBWdg->GetActiveDrawer();
+    if (adrw) adrw->HighLight(true);
     mBWdg->RemoveEventHandler(this);	
+  }
   _rmok = true; 
 }
@@ -1120,4 +1123,6 @@
   // On enleve le handler 
 //	cout << " DBG- 	mBWdg->RemoveEventHandler(this); " << endl;
+        PIDrawer* adrw = mBWdg->GetActiveDrawer();
+        if (adrw) adrw->HighLight(false);
 	mBWdg->RemoveEventHandler(this);
         _rmok = true;
@@ -1181,4 +1186,188 @@
 }
 
+//-----------------------------------------------------------------
+//------- Classe Event handler pour Mouse Select de l'active Drawer 
+class PIDrwSelectEvH : public PIEventHandler {
+public: 
+  PIDrwSelectEvH(PIBaseWdg* bwdg);
+          void    CheckBeforeDelete();
+  virtual void    ProcessEvent(); 
+
+protected:
+//  void ComputeResizeZone();
+  void ComputeOKZone();
+//  inline void ComputeDrawerZone() 
+//    { x1 = _x1;  y1 = _y1; x2 = _x2-_x1;  y2 = _y2-_y1; }
+
+
+  PIBaseWdg* mBWdg;
+  int _caid;
+  int _x1, _y1, _x2, _y2;
+  PIGrCoord x1, y1, x2, y2;
+  PIGrCoord xc, yc, rc;
+  bool _okend;
+  bool _rmok;
+};
+
+/* --Methode-- */
+PIDrwSelectEvH::PIDrwSelectEvH(PIBaseWdg* bwdg)
+{
+  mBWdg = bwdg;
+  _x1 = _y1 = _x2 = _y2 = -1;
+  x1 = y1 = x2 = y2 = xc = yc = rc = -1;
+  _okend = false;
+  _rmok = false;
+  if (bwdg == NULL) return;
+
+  int aid = bwdg->GetActiveDrawerId();
+  if (aid < 0) return;
+  
+  mBWdg->GetActiveDrawer()->HighLight(true);
+  _caid = aid;
+
+  PIGraphic* gr = mBWdg->WindowGraphic();
+  
+  PIGOMode gmod =  gr->GetGOMode();
+  PILineAtt gline = gr->GetLineAtt();
+  PIColors gcol = gr->GetForeground();
+
+  gr->SelForeground(PI_Magenta);
+  gr->SelGOMode(PI_GOXOR);
+  gr->SelLine(PI_ThinLine);
+
+  ComputeOKZone();
+  gr->DrawBox(x1,y1, x2, y2);
+  gr->DrawFCircle(xc,yc,rc);
+
+  gr->SelGOMode(gmod);
+  gr->SelLine(gline);
+  gr->SelForeground(gcol);
+
+//  cout << "DBG- Adding Event-Handler " << endl;
+  mBWdg->AddEventHandler(this, PIEvent_But1Press);
+}
+/* --Methode-- */
+void PIDrwSelectEvH::CheckBeforeDelete()
+{
+  if (!_rmok) {
+    PIDrawer* adrw = mBWdg->GetActiveDrawer();
+    if (adrw) adrw->HighLight(true);
+    mBWdg->RemoveEventHandler(this);	
+  }
+  _rmok = true; 
+}
+
+
+/* --Methode-- */
+void PIDrwSelectEvH::ComputeOKZone()
+{
+  bool _elastic = false;
+  int aid = mBWdg->GetActiveDrawerId();
+  if (mBWdg->IsDrawerAutoSizePos(aid)) {
+    mBWdg->GetDefaultDrawRectangle(x1, y1, x2, y2, _elastic);
+  }
+  else { 
+    mBWdg->GetDrawerPosition(aid, x1, y1, x2, y2, _elastic);
+  }
+    
+  if (_elastic) {
+    _x1 = (double)x1*(double)mBWdg->XSize();
+    _x2 = (double)x2*(double)mBWdg->XSize();
+    _y1 = (double)y1*(double)mBWdg->YSize();
+    _y2 = (double)y2*(double)mBWdg->YSize();
+  }
+  else {
+    _x1 = x1; _x2 = x2;
+    _y1 = y1; _y2 = y2;
+  }
+
+  int dx = (int)(0.06*(_x2-_x1));
+  int dy = (int)(0.06*(_y2-_y1));
+  if (dx < 20)  dx = 20;
+  if (dy < 20)  dx = 20;
+  int dxy = (dx < dy) ? dx : dy ;
+  if (dxy%2 != 0) dxy++;
+  _x1 = _x2-dxy;
+  _y1 = _y2-dxy;
+  x1 = _x1;  
+  y1 = _y1;    
+  x2 = y2 = dxy;
+  xc = _x1+dxy/2;
+  yc = _y1+dxy/2;
+  rc = dxy/2-2;
+}
+
+/* --Methode-- */
+void PIDrwSelectEvH::ProcessEvent()
+{
+
+  bool chgadrw = false;
+  int nid = -1;
+
+  PIGraphic* gr = mBWdg->WindowGraphic();
+
+  PIGOMode gmod =  gr->GetGOMode();
+  PILineAtt gline = gr->GetLineAtt();
+  PIColors gcol = gr->GetForeground();
+
+
+  switch (EventType()) {
+    case PIEvent_But1Press :
+      // Zone OK=Fin
+      if ( (GetPosX() >= _x1) && (GetPosX() <= _x2) && 
+	   (GetPosY() >= _y1) && ((GetPosY() <= _y2) ) ) _okend = true;
+      else {
+        nid = mBWdg->FindNearestDrawerId(GetPosX(), GetPosY());
+        if (nid != _caid)  chgadrw = true;
+      }
+      break;
+
+    default :
+      break;
+  }
+  if ( _okend || chgadrw ) {
+    gr->SelForeground(PI_Magenta);
+    gr->SelGOMode(PI_GOXOR);
+    gr->SelLine(PI_ThinLine);
+
+    gr->DrawBox(x1,y1, x2, y2);
+    gr->DrawFCircle(xc,yc,rc);
+
+    gr->SelGOMode(gmod);
+    gr->SelLine(gline);
+    gr->SelForeground(gcol);
+
+    PIDrawer* adrw = mBWdg->GetActiveDrawer();
+    if (adrw) adrw->HighLight(false);
+    
+    if (_okend) {
+      mBWdg->RemoveEventHandler(this);
+      _rmok = true;
+      return;
+    }		 
+    else { 
+      mBWdg->SetActiveDrawerId(nid);
+      _caid = nid;
+      adrw = mBWdg->GetActiveDrawer();
+      if (adrw) adrw->HighLight(true);
+    
+      gr->SelForeground(PI_Magenta);
+      gr->SelGOMode(PI_GOXOR);
+      gr->SelLine(PI_ThinLine);
+
+      ComputeOKZone();
+
+      gr->DrawBox(x1,y1, x2, y2);
+      gr->DrawFCircle(xc,yc,rc);
+
+      gr->SelGOMode(gmod);
+      gr->SelLine(gline);
+      gr->SelForeground(gcol);
+    }
+  }  
+}
+
+
+
 //------------------------------------------------------------
 /* --Methode-- */
@@ -1190,4 +1379,5 @@
   mFgxor = fgxor;
   mEvH = NULL;
+  mSEvH = NULL;
 
   if (bwdg == NULL) return;
@@ -1199,5 +1389,5 @@
   AppendSeparator();
   AppendItem("Detach", 405);
-  AppendItem("Highlight", 406);
+  AppendItem("MouseSelect", 406);
   AppendItem("Refresh", 407);
   int aid = bwdg->GetActiveDrawerId();
@@ -1221,9 +1411,11 @@
       mit += bwdg->GetDrawer(k)->Name();
       mListDrw->AppendItem(mit.c_str(), 1000+k);
+      if (bwdg->GetDrawerIdFromNum(k) == aid)  
+	mListDrw->SetSensitivityMsg(1000+k, false);
     }
     AppendPDMenu(mListDrw);
   }
-  PIDrawer*  actdr = mBWdg->GetActiveDrawer();
-  if (actdr)  actdr->HighLight(true);
+//SUP  PIDrawer*  actdr = mBWdg->GetActiveDrawer();
+//SUP  if (actdr)  actdr->HighLight(true);
 }
 
@@ -1235,4 +1427,8 @@
     mEvH->CheckBeforeDelete();
     delete mEvH;
+  }
+  if (mSEvH) { 
+    mSEvH->CheckBeforeDelete();
+    delete mSEvH;
   }
 }
@@ -1249,5 +1445,4 @@
     case 401 :
       if (aid >= 0)  PIDrwTools::ShowPIDrwTools(mBWdg);
-      if (actdrw != NULL) actdrw->HighLight(false);
       break;
     case 402 :
@@ -1260,10 +1455,11 @@
       if (actdrw != NULL) { 
 	actdrw->ShowControlWindow(mBWdg);
-	actdrw->HighLight(false);
       }
       break;
     case 404 :
-      if (mEvH) delete mEvH;
-      if (actdrw != NULL) actdrw->HighLight(false);
+      if (mEvH) { 
+	mEvH->CheckBeforeDelete();	
+	delete mEvH;
+      }
       mEvH = new PIDrwPosSizeEvH(mBWdg, mFgxor);
       break;
@@ -1275,5 +1471,9 @@
       break;
     case 406 :
-      if (actdrw != NULL)  actdrw->HighLight(true);
+      if (mSEvH) { 
+	mSEvH->CheckBeforeDelete();	
+	delete mSEvH;
+      }
+      mSEvH = new PIDrwSelectEvH(mBWdg);
       break;
     case 407 :
Index: /trunk/SophyaPI/PI/pidrwtools.h
===================================================================
--- /trunk/SophyaPI/PI/pidrwtools.h	(revision 2538)
+++ /trunk/SophyaPI/PI/pidrwtools.h	(revision 2539)
@@ -85,4 +85,5 @@
 //-------------------------------------------------------------------------------------------
 class PIDrwPosSizeEvH;  // Event Handler pour le deplacement/resize des drawers 
+class PIDrwSelectEvH;   // Event Handler pour la selection interactive des drawers 
 
 class PIDrwMgrMenu : public PIMenu {
@@ -96,4 +97,5 @@
   bool mFgxor;
   PIDrwPosSizeEvH* mEvH;
+  PIDrwSelectEvH* mSEvH;
 };
 
Index: /trunk/SophyaPI/PI/piimage.cc
===================================================================
--- /trunk/SophyaPI/PI/piimage.cc	(revision 2538)
+++ /trunk/SophyaPI/PI/piimage.cc	(revision 2539)
@@ -41,4 +41,5 @@
 //	* <Alt>O : Affichage de la fenêtre de contrôle des paramètres de visualisation.
 //	* <Alt>G : Affichage de la fenêtre de changement des attributs graphiques
+//	* <Alt>D : Affichage du menu de manipulation des traceurs (drawers)
 //	* <Alt>R : Rafraîchit l'affichage.
 //	* <Alt>V : Copier/*Coller* Ajout du texte du buffer copier/coller
@@ -151,4 +152,7 @@
 cpbuflen = 0;
 
+// Menu pour la manipulation des drawers 
+mDrwMen = NULL;
+
 SetBackgroundColor(PI_Black);
 
@@ -190,4 +194,5 @@
 delete trtw;
 if (cpbuffer)  delete[] cpbuffer;
+if (mDrwMen) delete mDrwMen;
 if (this == cur_piimage)  cur_piimage = NULL;
 }
@@ -738,4 +743,9 @@
     PIDrwTools::ShowPIDrwTools();   // Fentre axes et options de trace
     }
+  else if (key == 'D' || key == 'd') {  // Menu de manipulation des drawers
+    if (mDrwMen) delete mDrwMen;
+    mDrwMen = new PIDrwMgrMenu(this, true);
+    mDrwMen->Show();
+  }  
   else if (key == 'P' || key == 'p') {   // Activation/desactivation affichage curseur
     bool sc = !curshow;
Index: /trunk/SophyaPI/PI/piimage.h
===================================================================
--- /trunk/SophyaPI/PI/piimage.h	(revision 2538)
+++ /trunk/SophyaPI/PI/piimage.h	(revision 2539)
@@ -18,4 +18,5 @@
 
 class PIScDrawWdg;
+class PIDrwMgrMenu;
 
 class PIImage : public PIPixmap
@@ -198,4 +199,7 @@
 //  PIImage courante 
   static PIImage* cur_piimage;
+
+// Menu pour la manipulation des drawers 
+  PIDrwMgrMenu* mDrwMen;
 };
 
Index: /trunk/SophyaPI/PI/piscdrawwdg.cc
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 2538)
+++ /trunk/SophyaPI/PI/piscdrawwdg.cc	(revision 2539)
@@ -32,4 +32,5 @@
 //	(Par défaut, action identique à <Alt>G)
 //	* <Alt>G : Affichage de la fenêtre de changement des attributs graphiques
+//	* <Alt>D : Affichage du menu de manipulation des traceurs (drawers)
 //	* <Alt>R : Rafraîchit l'affichage.
 //	* <Alt>M : Active/Désactive l'affichage d'une réticule de mesure (Bouton-1)
@@ -80,5 +81,4 @@
 {
   mFgReticule = false;
-  mFgShiftBut = false;
   mCPosX = mCPosY = 0;
   mPPos[0] = mPPos[1] = 0.;
@@ -156,5 +156,5 @@
     PIAxesTools::ShowPIAxesTools();  // Fenetre de gestion des axes
   }
-  else if (key == 'D' || key == 'd') {
+  else if (key == 'D' || key == 'd') {  // Menu de manipulation des drawers
     if (mDrwMen) delete mDrwMen;
     mDrwMen = new PIDrwMgrMenu(this, true);
@@ -424,17 +424,4 @@
   unsigned long tm;
   GetLastEventInfo(kmod, tm);
-  if (kmod == PIKM_Shift) {   //SetActive Drawer on Shift-Button-1
-    mFgShiftBut = true; 
-    int nid = FindNearestDrawerId(x,y);
-    SetActiveDrawerId(nid);
-    PIDrawer*  actdr = GetActiveDrawer();
-    if (actdr) { 
-      actdr->HighLight(true);
-      if (mDrwMen) delete mDrwMen;
-      mDrwMen = new PIDrwMgrMenu(this);
-      mDrwMen->Show(this, x, y);
-    }
-    return;
-  }
   UpdateText(x, y);
   if (mTrW)
@@ -467,5 +454,4 @@
 PIScDrawWdg::Ptr1Move(int x, int y)
 {
-  if (mFgShiftBut) return;  //SetActive Drawer on Shift-Button-1
   UpdateText(x, y);  // Met a jour mPPos
   if (mFgReticule)  DrawReticule(x,y,1);
@@ -474,19 +460,5 @@
 void
 PIScDrawWdg::But1Release(int x, int y)
-{
-  if (mFgShiftBut) {  //SetActive Drawer on Shift-Button-1
-    mFgShiftBut = false; 
-    /*
-    PIDrawer*  actdr = GetActiveDrawer();
-    if (actdr) { 
-//      actdr->HighLight(false);
-      if (mDrwMen) delete mDrwMen;
-      mDrwMen = new PIDrwMgrMenu(this);
-      mDrwMen->Show();
-    }
-    */
-    return;
-  }
-  
+{  
   UpdateText(x, y);
   if (mFgReticule)  DrawReticule(x,y,2);
Index: /trunk/SophyaPI/PI/piscdrawwdg.h
===================================================================
--- /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 2538)
+++ /trunk/SophyaPI/PI/piscdrawwdg.h	(revision 2539)
@@ -102,5 +102,4 @@
   int mPosFDX, mPosFDY;       // Position (coord fenetre memorise)
   bool mFgReticule;       // Controle l'affiche d'une réticule (Bouton-1)
-  bool mFgShiftBut;       // true -> shift-Button
   string mFormatOpt[2];   // Format optimal d'impression des textes
 
