Index: trunk/SophyaPI/PI/lut.cc
===================================================================
--- trunk/SophyaPI/PI/lut.cc	(revision 105)
+++ trunk/SophyaPI/PI/lut.cc	(revision 106)
@@ -14,5 +14,5 @@
 /* --Methode-- */
 
-LUT::LUT(float min, float max, int ncol, int typ) 
+LUT::LUT(float min, float max, unsigned short ncol, int typ, int ntable) 
 {
 int nlev;
@@ -20,5 +20,5 @@
 bornes=NULL;  
 nlev = ncol-2;
-if (nlev < 0)  nlev = 0;
+if (nlev < 1)  nlev = 1;
 bornes = new float[nlev+1];
 
@@ -26,4 +26,6 @@
 type = typ;  nLevel = nlev;
 SetLut(min, max, typ);
+table = NULL;  
+ComputeTable(ntable);
 return;
 }
@@ -34,4 +36,5 @@
 if (type<0)  return;
 delete[] bornes;
+delete[] table;
 }
 
@@ -84,5 +87,5 @@
 
 /* --Methode-- */
-int LUT::Apply(float x)
+unsigned short LUT::Apply(float x)
 {
 int i;
@@ -91,2 +94,13 @@
 return(nLevel+1);
 }
+
+/* --Methode-- */
+void LUT::ComputeTable(int nt)
+{
+if (nt < 0) nt = 16*(nLevel+2);
+else if (nt < (nLevel+2))  nt = (nLevel+2);
+table = new unsigned short [nt-2];
+tablebinwidth = (Max()-Min())/(nt-2);
+float x = Min()+0.5*tablebinwidth;
+for(int i=0; i<nt-2; i++)  { table[i] = Apply(x); x += tablebinwidth; }
+}
Index: trunk/SophyaPI/PI/lut.h
===================================================================
--- trunk/SophyaPI/PI/lut.h	(revision 105)
+++ trunk/SophyaPI/PI/lut.h	(revision 106)
@@ -18,14 +18,17 @@
 {
 public:
-
-  int type;
-  int nLevel;
-  float * bornes;
   
-  LUT(float min, float max, int ncol=16, int typ=kLutType_Lin);
+  LUT(float min, float max, unsigned short ncol=16, int typ=kLutType_Lin, int ntable=-1);
   ~LUT();
   void SetLut(float min, float max, int typ=0);
   void Print();
-  int Apply(float x);
+  unsigned short Apply(float x);
+  inline unsigned short ApplyFast(float x)
+    { 
+    if (x < Min())  return(0);
+    if (x >= Max() )  return(nLevel+1);  
+    int k = (x-Min())/tablebinwidth;
+    return(table[k]); 
+    } 
 
   inline float Min() { return(bornes[0]); };
@@ -33,4 +36,14 @@
   inline int Type() { return(type); };
   inline int NCol() { return(nLevel+2); };
+
+protected:
+  void ComputeTable(int nt);
+
+  int type;
+  int nLevel;
+  float * bornes;
+  unsigned short * table;
+  float tablebinwidth;
+
 };
 
Index: trunk/SophyaPI/PI/parradapter.cc
===================================================================
--- trunk/SophyaPI/PI/parradapter.cc	(revision 105)
+++ trunk/SophyaPI/PI/parradapter.cc	(revision 106)
@@ -273,5 +273,5 @@
     for(j=ofy; j<ofy+npy; j++)
       for(i=ofx; i<ofx+npx; i++) 
-        { *pp = (unsigned char) lut->Apply( 
+        { *pp = (unsigned char) lut->ApplyFast( 
                 this->Value(j*sgnX+offX, i*sgnY+offY));  
            pp++; }
@@ -285,5 +285,5 @@
           for(k=0; k<zmm; k++)
             vpx += this->Value( (j+l)*sgnX+offX, (i+k)*sgnY+offY);
-        *pp = (unsigned char) lut->Apply(vpx/fv); 
+        *pp = (unsigned char) lut->ApplyFast(vpx/fv); 
         pp++;
         }
@@ -292,5 +292,5 @@
     for(j=ofy; j<ofy+npy; j++)
       for(i=ofx; i<ofx+npx; i++)  {
-        ucp = (unsigned char) lut->Apply(this->Value(j*sgnX+offX, i*sgnY+offY));
+        ucp = (unsigned char) lut->ApplyFast(this->Value(j*sgnX+offX, i*sgnY+offY));
         for(l=0; l<zm; l++)  {
           pp = pix+((j-ofy)*zm+l)*nppx+((i-ofx)*zm);
@@ -304,5 +304,5 @@
     for(j=ofy; j<ofy+npy; j++)
       for(i=ofx; i<ofx+npx; i++) 
-        { *pp = (unsigned char) lut->Apply( 
+        { *pp = (unsigned char) lut->ApplyFast( 
                 this->Value(i*sgnX+offX, j*sgnY+offY));  
            pp++; }
@@ -316,5 +316,5 @@
           for(k=0; k<zmm; k++)
             vpx += this->Value( (i+k)*sgnX+offX, (j+l)*sgnY+offY);
-        *pp = (unsigned char) lut->Apply(vpx/fv); 
+        *pp = (unsigned char) lut->ApplyFast(vpx/fv); 
         pp++;
         }
@@ -323,5 +323,5 @@
     for(j=ofy; j<ofy+npy; j++)
       for(i=ofx; i<ofx+npx; i++)  {
-        ucp = (unsigned char) lut->Apply(this->Value(i*sgnX+offX, j*sgnY+offY));
+        ucp = (unsigned char) lut->ApplyFast(this->Value(i*sgnX+offX, j*sgnY+offY));
         for(l=0; l<zm; l++)  {
           pp = pix+((j-ofy)*zm+l)*nppx+((i-ofx)*zm);
Index: trunk/SophyaPI/PI/piapplgen.cc
===================================================================
--- trunk/SophyaPI/PI/piapplgen.cc	(revision 105)
+++ trunk/SophyaPI/PI/piapplgen.cc	(revision 106)
@@ -75,4 +75,16 @@
 }
 
+//++
+// void SetReady()
+//	Modifie l'état global de l'application - Pssage à l'état normal,
+//	prêt à traiter les actions utilisateur.
+// void SetBusy()
+//	Passage en mode de calcul - La souris prend la forme de la montre
+//	pour la fenêtre principale
+// void SetBlocked()
+//	Passge en mode bloqué. La barre de menu devient insensible
+// int GetState()
+//	Renvoie l'état global de l'application "(kReadyState, kBusyState, kBlockedState)".
+//--
 void PIApplicationGen::SetReady()
 {
Index: trunk/SophyaPI/PI/piapplx.cc
===================================================================
--- trunk/SophyaPI/PI/piapplx.cc	(revision 105)
+++ trunk/SophyaPI/PI/piapplx.cc	(revision 106)
@@ -115,4 +115,5 @@
   Display * mdsp;
   mState = kReadyState;
+  Menubar()->SetSensitive();
   mdsp = XtDisplay (topwdg->XtWdg());
   XDefineCursor(mdsp, XtWindow(topwdg->XtWdg()), a_curs[0]);
@@ -128,4 +129,5 @@
   Display * mdsp;
   mState = kBusyState;
+  Menubar()->SetSensitive();
   mdsp = XtDisplay (topwdg->XtWdg());
 //  if ( XtIsRealized(topwdg->XtWdg()) )
@@ -143,4 +145,5 @@
   Display * mdsp;
   mState = kBlockedState;
+  Menubar()->SetUnSensitive();
   mdsp = XtDisplay (topwdg->XtWdg());
   XDefineCursor(mdsp, XtWindow(topwdg->XtWdg()), a_curs[1]);
Index: trunk/SophyaPI/PI/picons.cc
===================================================================
--- trunk/SophyaPI/PI/picons.cc	(revision 105)
+++ trunk/SophyaPI/PI/picons.cc	(revision 106)
@@ -877,5 +877,5 @@
 // Le traitement du scroll-bar
 else if ((ModMsg(msg) == PIMsg_DataChanged) && (UserMsg(msg) == msgScb) ) {
-  off = (int)data;
+  off = * ((int *)data);
 //  printf(" PIConsole::Process() From ScrollBar : Off=%d \n ", off);
   SetDispOffset(off);
Index: trunk/SophyaPI/PI/piimage.cc
===================================================================
--- trunk/SophyaPI/PI/piimage.cc	(revision 105)
+++ trunk/SophyaPI/PI/piimage.cc	(revision 106)
@@ -618,6 +618,7 @@
 if (zmx < 1)  zmx = 1;
 zmgv = zmx;
-if (zmx > 1)  zmx = -zmx; 
+if (zmx > 1)  zmx = -zmx;
 gpixm = img->ComputePixmap(lut, 0, 0, zmx, xwsz, ywsz, gpixm, &xsgpxm, &ysgpxm);
+printf("DEBUG-ComputeGloVPixmap()  %d-%d , (%d,%d) , %d-%d \n", xwsz, ywsz, zmx, zmy, xsgpxm, ysgpxm);
 return;
 }
Index: trunk/SophyaPI/PI/pimenubargen.h
===================================================================
--- trunk/SophyaPI/PI/pimenubargen.h	(revision 105)
+++ trunk/SophyaPI/PI/pimenubargen.h	(revision 106)
@@ -15,4 +15,7 @@
 				   
   virtual void      AppendMenu(PIPDMenu *pdm)=0;
+  virtual void      RemoveMenu(PIPDMenu *pdm)=0;
+  virtual void      SetSensitivity(PIPDMenu *pdm, bool sens=true)=0;
+  virtual bool      IsSensitive(PIPDMenu *pdm)=0;
 
   virtual long      kind() {return ClassId; }
Index: trunk/SophyaPI/PI/pimenubarx.cc
===================================================================
--- trunk/SophyaPI/PI/pimenubarx.cc	(revision 105)
+++ trunk/SophyaPI/PI/pimenubarx.cc	(revision 106)
@@ -66,2 +66,40 @@
 }
 
+/* --Methode-- */
+void PIMenubarX::RemoveMenu(PIPDMenu *pdm)
+{
+int i,j;
+for(i=0; i<mNItem; i++) 
+  if ( mMbb[i].pdm == pdm ) { 
+    XtDestroyWidget(mMbb[i].itb);
+    for(j=i; j<mNItem-1; j++) mMbb[j] = mMbb[j+1]; 
+    mNItem--;  break;  
+    }
+return;
+}
+
+/* --Methode-- */
+void PIMenubarX::SetSensitivity(PIPDMenu *pdm, bool sens)
+{
+int i;
+for(i=0; i<mNItem; i++) 
+  if ( mMbb[i].pdm == pdm ) { 
+    if (sens) XtSetSensitive(mMbb[i].itb, TRUE);
+    else XtSetSensitive(mMbb[i].itb, FALSE);
+    break;  
+    }
+return;
+}
+
+/* --Methode-- */
+bool PIMenubarX::IsSensitive(PIPDMenu *pdm)
+{
+int i;
+for(i=0; i<mNItem; i++) 
+  if ( mMbb[i].pdm == pdm ) { 
+    if (XtIsSensitive(mMbb[i].itb) == TRUE)  return(true);
+    else return(false);
+    break; 
+    }
+return(false);
+}
Index: trunk/SophyaPI/PI/pimenubarx.h
===================================================================
--- trunk/SophyaPI/PI/pimenubarx.h	(revision 105)
+++ trunk/SophyaPI/PI/pimenubarx.h	(revision 106)
@@ -12,7 +12,11 @@
 class PIMenubarX : public PIMenubarGen {
  public:
-	        PIMenubarX(PIApplicationGen* par, char* nom);
-	        ~PIMenubarX();
-virtual void	AppendMenu(PIPDMenu *pdm);
+	            PIMenubarX(PIApplicationGen* par, char* nom);
+	            ~PIMenubarX();
+
+  virtual void	    AppendMenu(PIPDMenu *pdm);
+  virtual void      RemoveMenu(PIPDMenu *pdm);
+  virtual void      SetSensitivity(PIPDMenu *pdm, bool sens=true);
+  virtual bool      IsSensitive(PIPDMenu *pdm);
 
  protected:
Index: trunk/SophyaPI/PI/pimenugen.h
===================================================================
--- trunk/SophyaPI/PI/pimenugen.h	(revision 105)
+++ trunk/SophyaPI/PI/pimenugen.h	(revision 106)
@@ -6,4 +6,5 @@
 
 enum PIMenuType { k_PopupMenu = 1, k_PulldownMenu = 2 };
+
 
 class PIMenuGen : public PIWdg {
@@ -15,4 +16,6 @@
 				   
   virtual void	  AppendItem(char* nom, PIMessage msg, char* sc=NULL)=0;
+  virtual void	  AppendCheckItem(char* nom, PIMessage msg, char* sc=NULL)=0;
+  virtual void	  AppendPDMenu(PIMenuGen *pdm, char* sc=NULL)=0;
 
   virtual void    DeleteItem(char *nom)=0;
@@ -20,7 +23,19 @@
   virtual void    DeleteItemNum(int n)=0;
 
-  virtual void    CheckItem(char *nom, bool st=false)=0; 
-  virtual void    CheckItemMsg(PIMessage msg, bool st=false)=0; 
-  virtual void    CheckItemNum(int n, bool st=false)=0; 
+  virtual void    SetSensitivity(char *nom, bool sens=true)=0; 
+  virtual void    SetSensitivityMsg(PIMessage msg, bool sens=true)=0; 
+  virtual void    SetSensitivityNum(int n, bool sens=true)=0;
+
+  virtual bool    IsSensitive(char *nom)=0;
+  virtual bool    IsSensitiveMsg(PIMessage msg)=0;
+  virtual bool    IsSensitiveNum(int n)=0;
+
+  virtual void    SetState(char *nom, bool st=false)=0; 
+  virtual void    SetStateMsg(PIMessage msg, bool st=false)=0; 
+  virtual void    SetStateNum(int n, bool st=false)=0;
+ 
+  virtual bool    GetState(char *nom)=0; 
+  virtual bool    GetStateMsg(PIMessage msg)=0; 
+  virtual bool    GetStateNum(int n)=0; 
 
   virtual void    Show()=0;
@@ -29,4 +44,5 @@
 
   virtual long    kind() {return ClassId; }
+  virtual PIMenuType MType() { return  mMTyp; }
 
 protected:
Index: trunk/SophyaPI/PI/pimenux.cc
===================================================================
--- trunk/SophyaPI/PI/pimenux.cc	(revision 105)
+++ trunk/SophyaPI/PI/pimenux.cc	(revision 106)
@@ -1,3 +1,4 @@
 #include<stdio.h>
+#include<iostream.h>
 
 #include "pimenux.h"
@@ -15,5 +16,5 @@
 // La fonction suivante permet de bypasser ce probleme- Le createur d'application
 // X doit donc appeler la fonction ci-dessous pour initialiser menuXTopWdg
-//                                               Reza /411/97
+//                                               Reza 4/11/97
 static SysDWdg menuXTopWdg = NULL;
 void SetTopWdgForMenuX(SysDWdg mtw) {
@@ -26,8 +27,9 @@
 
 // Fonction prive (CallBack)
-static void menub_action(Widget w, XtPointer *usd, XtPointer *calld);
+static void menu_action(Widget w, XtPointer usd, XtPointer calld);
+static void menu_toggle_action(Widget w, XtPointer usd, XmToggleButtonCallbackStruct* calld);
 
 /* Nouvelle-Fonction */
-void  menub_action(Widget /*w*/, XtPointer *usd, XtPointer* /*calld*/)
+void  menu_action(Widget /*w*/, XtPointer usd, XtPointer /*calld*/)
 {
 PIMenuX *pim;
@@ -36,12 +38,30 @@
 cusd = ( _pimxit_ *)usd ;
 pim = (PIMenuX *) (cusd->pmen);
-
 // pim->Hide();
-pim->Send(cusd->msg, PIMsg_Click, (void *)pim->ItemNameWdg(cusd->itb));
+pim->Send(cusd->msg, PIMsg_Click );
 #ifdef DEBUG_PIMenuX
-printf("%%%Debug_menub_action: Msg= %d  %lx\n", (int)cusd->msg, (long)pim);
+printf("%%%Debug_menu_action: Msg= %d  %lx\n", (int)cusd->msg, (long)pim);
 #endif
 return;
 }
+
+// Variable globale pour Toggle Item's  Send(..., ..., data); 
+static bool toggmenbut = false;
+
+/* Nouvelle-Fonction */
+void  menu_toggle_action(Widget /*w*/, XtPointer usd, XmToggleButtonCallbackStruct* calld)
+{
+PIMenuX *pim;
+_pimxit_ *cusd;
+
+cusd = ( _pimxit_ *)usd ;
+pim = (PIMenuX *) (cusd->pmen);
+if (calld->set == True)  cusd->togstate = toggmenbut = true;
+else  cusd->togstate = toggmenbut = false;
+pim->Send(cusd->msg, PIMsg_DataChanged, (void *)(&toggmenbut));
+return;
+}
+
+
 
 #define NBITEMB  10
@@ -78,5 +98,21 @@
 void PIMenuX::AppendItem(char* nom, PIMessage msg, char* sc)
 {
-AddItem(nom, msg, false, sc);
+AddItem(nom, msg, 0, sc, NULL);
+}
+
+/* --Methode-- */
+void PIMenuX::AppendCheckItem(char* nom, PIMessage msg, char* sc)
+{
+AddItem(nom, msg, 1, sc, NULL);
+}
+
+/* --Methode-- */
+void PIMenuX::AppendPDMenu(PIMenuGen *pdm, char* sc)
+{
+if (pdm->MType() !=  k_PulldownMenu) {
+  cerr << "PIMenuX::AppendPDMenu()/Erreur: PullDownMenu PIPDMenu seulement ... " << endl;
+  return;
+  }
+AddItem(NULL, pdm->Msg(), 2, sc, (PIMenuX*)pdm);
 }
 
@@ -84,10 +120,5 @@
 void PIMenuX::DeleteItem(char *nom)
 {
-
-for(int i=0; i<mNItem; i++)
-  if (strcmp(ItemName(i), nom) == 0)  
-    { DeleteItemNum(i);  break; }
-
-return;
+DeleteItemNum(GetNumItem(nom));
 }
 
@@ -95,11 +126,46 @@
 void PIMenuX::DeleteItemMsg(PIMessage msg)
 {
-for(int i=0; i<mNItem; i++)
-  if (mBut[i].msg == msg)  
-    { DeleteItemNum(i);  break; }
-
-return;
-}
-
+DeleteItemNum(GetNumItemMsg(msg));
+}
+
+/* --Methode-- */
+void PIMenuX::SetSensitivity(char *nom, bool sens)
+{
+SetSensitivityNum(GetNumItem(nom), sens);
+}
+
+/* --Methode-- */
+void PIMenuX::SetSensitivityMsg(PIMessage msg, bool sens)
+{
+SetSensitivityNum(GetNumItemMsg(msg), sens);
+}
+
+/* --Methode-- */
+bool PIMenuX::IsSensitive(char *nom)
+{
+return(IsSensitiveNum(GetNumItem(nom)) );
+}
+
+/* --Methode-- */
+bool PIMenuX::IsSensitiveMsg(PIMessage msg)
+{
+return(IsSensitiveNum(GetNumItemMsg(msg)) ); 
+}
+
+/* --Methode-- */
+bool PIMenuX::IsSensitiveNum(int n)
+{
+if ((n < 0) || (n >= mNItem))  return(false);
+if (XtIsSensitive(mBut[n].itb) == TRUE)  return(true);
+else return(false);
+}
+
+/* --Methode-- */
+void PIMenuX::SetSensitivityNum(int n, bool sens)
+{
+if ((n < 0) || (n >= mNItem))  return;
+if (sens) XtSetSensitive(mBut[n].itb, TRUE);
+else XtSetSensitive(mBut[n].itb, FALSE);
+}
 
 /* --Methode-- */
@@ -108,14 +174,18 @@
 if ((n < 0) || (n >= mNItem))  return;
 XtDestroyWidget(mBut[n].itb);
-for(int i=n; i<mNItem-1; i++)  
-  { 
+for(int i=n; i<mNItem-1; i++)
+  {
   String cbckn;
-  if (mBut[i+1].togg)  cbckn = XmNvalueChangedCallback;
-  else cbckn = XmNactivateCallback;
-  XtRemoveCallback(mBut[i+1].itb, cbckn, 
-                   (XtCallbackProc)menub_action, (XtPointer)(mBut+i+1));
-  mBut[i] = mBut[i+1];
-  XtAddCallback(mBut[i].itb, cbckn, 
-                (XtCallbackProc)menub_action, (XtPointer)(mBut+i));
+  XtCallbackProc cbproc;
+  if (mBut[i+1].toggpdm < 2) {
+    if (mBut[i+1].toggpdm == 1)    // ToggleItem 
+      { cbckn = XmNvalueChangedCallback;  cbproc = (XtCallbackProc)menu_toggle_action; }
+    else { cbckn = XmNactivateCallback;  cbproc = menu_action; }
+
+    XtRemoveCallback(mBut[i+1].itb, cbckn, cbproc, (XtPointer)(mBut+i+1));
+    mBut[i] = mBut[i+1];
+    XtAddCallback(mBut[i].itb, cbckn, cbproc, (XtPointer)(mBut+i));
+    }
+  else mBut[i] = mBut[i+1]; 
   }
 mNItem--;
@@ -124,30 +194,48 @@
 
 /* --Methode-- */
-void PIMenuX::CheckItem(char *nom, bool st)
-{
-
-for(int i=0; i<mNItem; i++)
-  if (strcmp(ItemName(i), nom) == 0)  
-    { CheckItemNum(i, st);  break; }
-
+void PIMenuX::SetState(char *nom, bool st)
+{
+SetStateNum(GetNumItem(nom), st);
+}
+
+/* --Methode-- */
+void PIMenuX::SetStateMsg(PIMessage msg, bool st)
+{
+SetStateNum(GetNumItemMsg(msg), st);
+}
+
+/* --Methode-- */
+void PIMenuX::SetStateNum(int n, bool st)
+{
+if ((n < 0) || (n >= mNItem))  return;
+if (mBut[n].toggpdm != 1 ) return;  // Pas un toggle-item
+Arg warg[2];
+if (st) XtSetArg(warg[0],XmNset, True);
+else XtSetArg(warg[0],XmNset, False);
+XtSetValues(mBut[n].itb, warg, 1);
+mBut[n].togstate = st;
 return;
 }
 
 /* --Methode-- */
-void PIMenuX::CheckItemMsg(PIMessage msg, bool st)
-{
-for(int i=0; i<mNItem; i++)
-  if (mBut[i].msg == msg)  
-    { CheckItemNum(i, st);  break; }
-
-return;
-}
-
-/* --Methode-- */
-void PIMenuX::CheckItemNum(int n, bool /*st*/)
-{
-printf("PIMenuX::CheckItemNum(%d,bool) Error/ Not yet implemented \n", n);
-return;
-}
+bool PIMenuX::GetState(char *nom)
+{
+return( GetStateNum(GetNumItem(nom)) );
+}
+
+/* --Methode-- */
+bool PIMenuX::GetStateMsg(PIMessage msg)
+{
+return( GetStateNum(GetNumItemMsg(msg)) );
+}
+
+/* --Methode-- */
+bool PIMenuX::GetStateNum(int n) 
+{
+if ((n < 0) || (n >= mNItem))  return(false);
+if (mBut[n].toggpdm != 1 ) return(false); 
+return(mBut[n].togstate); 
+}
+
 
 /* --Methode-- */
@@ -234,49 +322,54 @@
 
 /* --Methode-- */
-void PIMenuX::AddItem(char* nom, PIMessage msg, bool tog, char* sc)
+void PIMenuX::AddItem(const char* nom, PIMessage msg, int tog, char* sc, PIMenuX *pdm)
 {
 _pimxit_ *buto;
 SysDWdgClass wdgcl;
 String cbckn;
-
-
-if (mNItem >= mNItemMax)
-  {
+XtCallbackProc cbproc;
+Arg  warg[2];
+int n=0;
+
+
+if (mNItem >= mNItemMax)  {
   buto = mBut;
   mNItemMax += NBITEMB;
   mBut = new _pimxit_[mNItemMax];
-  for(int i=0; i<mNItem; i++)   
-    {
-    if (buto[i].togg)  cbckn = XmNvalueChangedCallback;
-    else cbckn = XmNactivateCallback;
-    XtRemoveCallback(buto[i].itb, cbckn, 
-                     (XtCallbackProc)menub_action, (XtPointer)(buto+i));
-    mBut[i] = buto[i];
-    XtAddCallback(mBut[i].itb, cbckn, 
-                 (XtCallbackProc) menub_action, (XtPointer)(mBut+i));
+  for(int i=0; i<mNItem; i++)    {
+    if (buto[i].toggpdm < 2) {  // Pas de Cascade Menu
+      if (buto[i].toggpdm == 1)  // ToggleItem
+        { cbckn = XmNvalueChangedCallback;  cbproc = (XtCallbackProc)menu_toggle_action; }
+      else { cbckn = XmNactivateCallback;  cbproc = menu_action; }
+      XtRemoveCallback(buto[i].itb, cbckn, cbproc, (XtPointer)(buto+i));
+      mBut[i] = buto[i];
+      XtAddCallback(mBut[i].itb, cbckn, cbproc, (XtPointer)(mBut+i));
+      }
+    else mBut[i] = buto[i]; 
     }
-
   delete[] buto;
   }
 
-if (tog)
-  {
-  cbckn = XmNvalueChangedCallback;
-  wdgcl = xmToggleButtonWidgetClass;
-  }
-else 
-  {
-  cbckn = XmNactivateCallback;
-  wdgcl = xmPushButtonWidgetClass;
-  }
-
-mBut[mNItem].itb = XtCreateManagedWidget(nom, wdgcl, this->XtWdg(), NULL, 0) ; 
-XtAddCallback(mBut[mNItem].itb, cbckn, 
-              (XtCallbackProc)menub_action, (XtPointer)(mBut+mNItem));
+if (tog < 2) {  // Pas de Cascade Menu
+  if (tog == 1) {   // Toggle-Item 
+    cbckn = XmNvalueChangedCallback;  cbproc = (XtCallbackProc)menu_toggle_action;
+    wdgcl = xmToggleButtonWidgetClass;  
+    XtSetArg(warg[0],XmNset, False); n = 1; }
+  else {
+    cbckn = XmNactivateCallback;  cbproc = menu_action;
+    wdgcl = xmPushButtonWidgetClass;  n = 0; }
+
+  mBut[mNItem].itb = XtCreateManagedWidget(nom, wdgcl, this->XtWdg(), warg, n) ; 
+  XtAddCallback(mBut[mNItem].itb, cbckn, cbproc, (XtPointer)(mBut+mNItem));
+  }
+else {    // Creation Cascade-Menu
+  XtSetArg(warg[0], XmNsubMenuId, pdm->XtWdg());
+  mBut[mNItem].itb = XtCreateManagedWidget(pdm->Nom().c_str(), xmCascadeButtonWidgetClass, 
+                                           XtWdg(), warg, 1) ;
+  pdm->SetMsgParent(this);
+  }
+
 if (sc)  // Raccourci clavier 
   {
   char acc[16];
-  int n=0;
-  Arg warg[2];
   XmString xmstr;
 
@@ -295,5 +388,6 @@
 mBut[mNItem].pmen = this;
 mBut[mNItem].msg = msg;
-mBut[mNItem].togg = tog;
+mBut[mNItem].toggpdm = tog;
+mBut[mNItem].togstate = false;
 mNItem++;
 return;
@@ -302,38 +396,16 @@
 
 
-/* --Methode-- */
+/* --Methode-- 
 void PIMenuX::Check()
 {
 printf("#Debug_CHECK: %d %d %d %d \n",XSize(), YSize(), XPos(), YPos() );  
 for(int i=0; i<mNItem; i++)
-  printf("##Debug_CHECK: %d %d %ld %lx %lx %lx \n", i, (int)mBut[i].togg, 
+  printf("##Debug_CHECK: %d %d %ld %lx %lx %lx \n", i, (int)mBut[i].toggpdm, 
          (long) mBut[i].msg, (long) mBut[i].itb, 
          (long) mBut[i].pmen, long (mBut+i));
 return;
 }
-
-/* --Methode-- A virer 
-void PIMenuX::AppendCheckItem(char* nom, PIMessage msg)
-{
-AddItem(nom, msg, true);
-}
 */
 
-/* --Methode--   A virer 
-void PIMenuX::SetItem(int n, bool st) 
-{
-if ((n < 0) || (n >= mNItem))  return;
-if (mBut[n].togg)  // C'est un toggle Bouton !
-  {
-  Arg  wargs[2];
-  int n=0;
-  if (st)  XtSetArg(wargs[n],XmNset,TRUE);  
-  else XtSetArg(wargs[n],XmNset,FALSE);  
-  n++;
-  XtSetValues(mBut[n].itb, wargs, n);  
-  }
-return;
-}
-*/
 
 
Index: trunk/SophyaPI/PI/pimenux.h
===================================================================
--- trunk/SophyaPI/PI/pimenux.h	(revision 105)
+++ trunk/SophyaPI/PI/pimenux.h	(revision 106)
@@ -12,5 +12,6 @@
 PIMenuX *pmen;
 PIMessage msg;
-bool togg;
+int toggpdm;      // 0= Normal Item, 1, Toggle Item,  2= PDMenu
+bool togstate;    // true , false pour toggle items  
 };
 
@@ -23,4 +24,6 @@
 				   
   virtual void	  AppendItem(char* nom, PIMessage msg, char* sc=NULL);
+  virtual void	  AppendCheckItem(char* nom, PIMessage msg, char* sc=NULL);
+  virtual void	  AppendPDMenu(PIMenuGen *pdm, char* sc=NULL);
 
   virtual void    DeleteItem(char *nom);
@@ -28,7 +31,19 @@
   virtual void    DeleteItemNum(int n);
 
-  virtual void    CheckItem(char *nom, bool st=false); 
-  virtual void    CheckItemMsg(PIMessage msg, bool st=false); 
-  virtual void    CheckItemNum(int n, bool st=false); 
+  virtual void    SetSensitivity(char *nom, bool sens=true); 
+  virtual void    SetSensitivityMsg(PIMessage msg, bool sens=true); 
+  virtual void    SetSensitivityNum(int n, bool sens=true);
+
+  virtual bool    IsSensitive(char *nom);
+  virtual bool    IsSensitiveMsg(PIMessage msg);
+  virtual bool    IsSensitiveNum(int n);
+
+  virtual void    SetState(char *nom, bool st=false); 
+  virtual void    SetStateMsg(PIMessage msg, bool st=false); 
+  virtual void    SetStateNum(int n, bool st=false);
+ 
+  virtual bool    GetState(char *nom); 
+  virtual bool    GetStateMsg(PIMessage msg); 
+  virtual bool    GetStateNum(int n); 
 
   virtual void    Show();
@@ -45,6 +60,5 @@
 
 protected:
-        void      AddItem(char* nom, PIMessage msg, bool tog, char* sc=NULL);
-        void      Check();
+        void      AddItem(const char* nom, PIMessage msg, int tog, char* sc, PIMenuX *pdm);
 
 int mNItem, mNItemMax;
Index: trunk/SophyaPI/PI/pistdwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/pistdwdggen.cc	(revision 105)
+++ trunk/SophyaPI/PI/pistdwdggen.cc	(revision 106)
@@ -1,6 +1,33 @@
 #include "pistdwdggen.h"
 
+/************* PILabelGen ************/
 
-/************* PILabelGen ************/
+//++
+// Class	PILabel
+// Lib		PI
+// include	pistdwdggen.h
+//
+//	Composant graphique simple permettant d'afficher une étiquette (texte).
+//	"PILabelGen" définit l'interface (classe virtuelle pure). Les objets 
+//	instanciés doivent être de la classe "PILabel" déclaré dans le fichier
+//	entête "PISTDWDG_H".
+//--
+//++
+// Links	Parents
+// PIWdg
+//--
+
+//++
+// Titre	Constructeur, méthodes
+//--
+//++
+// PILabel(PIContainerGen* par, char* nom, int sx=10, int sy=10, int px=0, int py=0)
+//	Création d'un objet PILabel ayant un contenu (étiquette) identique à "nom".
+// SetLabel(string const& lab)
+//	Modifie l'étiquette affichée par l'objet 
+//--
+
+
+
 
 PILabelGen::PILabelGen(PIContainerGen *par, char *nom,
@@ -13,4 +40,32 @@
 
 /************* PIButtonGen ************/
+//++
+// Class	PIButton
+// Lib		PI
+// include	pistdwdggen.h
+//
+//	Composant graphique de type bouton .
+//	"PIButtonGen" définit l'interface (classe virtuelle pure). Les objets 
+//	instanciés doivent être de la classe "PIButton" déclaré dans le fichier
+//	entête "PISTDWDG_H". Lors de l'activation, le message de l'objet complété
+//	par le modifier "PIMsg_Click" est envoyé ("Send()"). Le champ "data" 
+//	contient le pointeur "NULL".
+//--
+//++
+// Links	Parents
+// PIWdg
+//--
+
+//++
+// Titre	Constructeur, méthodes
+//--
+//++
+// PIButton(PIContainerGen* par, char* nom, PIMessage msg = PIMsg_Click, int sx=10, int sy=10, int px=0, int py=0)
+//	Création d'un objet PIButton avec une étiquette identique à "nom".
+// SetLabel(string const& lab)
+//	Modifie l'étiquette affichée par l'objet bouton.
+//--
+
+
 
 PIButtonGen::PIButtonGen(PIContainerGen *par, char *nom, PIMessage msg,
Index: trunk/SophyaPI/PI/pistdwdgx.cc
===================================================================
--- trunk/SophyaPI/PI/pistdwdgx.cc	(revision 105)
+++ trunk/SophyaPI/PI/pistdwdgx.cc	(revision 106)
@@ -251,4 +251,7 @@
 static void toggb_action(Widget w, XtPointer *usd, XmToggleButtonCallbackStruct* calld);
 
+//  Variable globale d'etat de checkbox pour Send(...)
+static bool toggb_state = false;
+
 /* Nouvelle-Fonction */
 void  toggb_action(Widget , XtPointer *usd, XmToggleButtonCallbackStruct* calld)
@@ -258,5 +261,6 @@
 if (calld->set == True)   picb->mSt = true;
 else picb->mSt = false;
-picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)(picb->mSt));
+toggb_state = picb->mSt;
+picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)(&toggb_state));
 return;
 }
@@ -291,5 +295,6 @@
 Arg warg[2];
 mSt = st;
-XtSetArg(warg[0],XmNset, mSt);
+if (st) XtSetArg(warg[0],XmNset, True);
+else XtSetArg(warg[0],XmNset, False);
 XtSetValues(XtWdg(), warg, 1);
 return;
@@ -309,5 +314,7 @@
 static void scale_action(Widget w, XtPointer *usd, 
                          XmScaleCallbackStruct *calld);
-
+// Variable globale pour contenir valeur de Scale a l'appel de Send;
+static int scale_value=0;
+ 
 void  scale_action(Widget, XtPointer *usd, 
                          XmScaleCallbackStruct *calld)
@@ -317,5 +324,6 @@
 pis = (PIScale *) usd ;
 pis->CBSetVal(calld->value);
-pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value);
+scale_value = calld->value;
+pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)(&scale_value));
 return;
 }
@@ -417,4 +425,6 @@
 static void scrollbar_drag(Widget w, XtPointer *usd, 
                            XmScrollBarCallbackStruct *calld);
+// Variable globale pour contenir valeur de Scale a l'appel de Send;
+static int scroll_value=0;
 
 void  scrollbar_action(Widget, XtPointer *usd, 
@@ -425,5 +435,6 @@
 pis = (PIScrollBar *) usd ;
 pis->CBSetVal(calld->value);
-pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value);
+scroll_value = calld->value;
+pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)(&scroll_value));
 return;
 }
@@ -436,5 +447,6 @@
 pis = (PIScrollBar *) usd ;
 pis->CBSetVal(calld->value);
-pis->Send(pis->Msg(), PIMsg_Drag, (void *)calld->value);
+scroll_value = calld->value;
+pis->Send(pis->Msg(), PIMsg_Drag, (void *)(&scroll_value));
 return;
 }
Index: trunk/SophyaPI/PI/pitestapp.cc
===================================================================
--- trunk/SophyaPI/PI/pitestapp.cc	(revision 105)
+++ trunk/SophyaPI/PI/pitestapp.cc	(revision 106)
@@ -2,4 +2,8 @@
 #include <stdio.h>
 
+/*  Ceci est un programme test des differents composants de PI : PEIDA Interactif */
+/*                 Reza ,  96-98                                                  */
+
+ 
 #include "pisysdep.h"
 
@@ -8,21 +12,18 @@
 #include PIMENU_H 
 #include PIOPTMENU_H 
-// #include PIMENUBAR_H 
 #include PISTDWDG_H 
 #include PIBWDG_H 
-
 #include PIPIXMAP_H 
-
 #include PIFILECHO_H 
+#include PILIST_H
 
 #include "ex_dessin.h"
 #include "sc_sample.h"
 #include "piimage.h"
-
-#include PILIST_H
+#include "pimgadapter.h"
+
 
 #include "fitsimage.h"
 
-#include <X11/Xlib.h>
 
 int SysBeep(int n)
@@ -31,19 +32,4 @@
 return(0);
 }
-/*
-class PITestWindow : public PIWindow {
-public:
-	PITestWindow(PIMsgHandler *par);
-	~PITestWindow() {}
-
-    PIText text;
-    PIButton bouton;
-    PIButton bouton2, bouton3;
-    PILabel label;
-    PIScale scl;
-    PIPUMenu  * menu;
-
-};
-*/
 
 class PITestApp : public PIApplication {
@@ -55,9 +41,11 @@
 
 //    PIMenubar * menb;
-    PIPDMenu  *m[3];
+    PIPDMenu  *m[5];
+    PIPDMenu  *mc[2];
     PICheckBox * ckb;
     PIText * text;
     PIButton * bouton;
     PIButton * bouton2, * bouton3, * bouton4, *bouton5;
+    PIButton * bouton11, * bouton12, * bouton13,* bouton14 ,* bouton15 ;
     PILabel * label;
     PIScale * scl;
@@ -68,4 +56,5 @@
     PILabel  * labimg;
     ScSample * scs;
+    bool stnewmen[2];
 
 };
@@ -97,5 +86,5 @@
 
 PITestApp::PITestApp(int sx, int sy)
-: PIApplication(sx, sy)
+: PIApplication(550, 450)
 {
 char ans[128];
@@ -111,8 +100,31 @@
    m[1]->AppendItem("Coller", 10202);
    m[1]->AppendItem("Couper", 10203);
+   m[1]->AppendCheckItem("Check It", 10205);
+   mc[0] = new PIPDMenu(m[1], "Cascade");
+   mc[0]->AppendItem("EdeCas-1", 10221);
+   mc[0]->AppendItem("EdeCas-2", 10222);
+   mc[0]->AppendItem("EdeCas-3", 10223);
+   m[1]->AppendPDMenu(mc[0]);
+
    m[2] = new PIPDMenu((PIMsgHandler *)Menubar(),"Operation");
    m[2]->AppendItem("AddItem", 10301);
    m[2]->AppendItem("DelItemName", 10302);
    m[2]->AppendItem("DelItemMsg", 10303);
+
+   m[3] = new PIPDMenu((PIMsgHandler *)Menubar(),"Special");
+   m[3]->AppendItem("Spec-Opt1", 10401);
+   m[3]->AppendItem("Spec-Opt2", 10402);
+   m[3]->AppendItem("Spec-Cascade", 10403);
+   mc[1] = new PIPDMenu(m[3], "Spec-Cascade");
+   mc[1]->AppendItem("Spec-Cas-1", 10441);
+   mc[1]->AppendItem("Spec-Cas-2", 10442);
+   mc[1]->AppendItem("Spec-Cas-3", 10443);
+   m[3]->AppendPDMenu(mc[1]);
+   m[3]->AppendCheckItem("Checkable", 10414);
+
+   m[4] = new PIPDMenu((PIMsgHandler *)Menubar(),"AddMenu2");
+   m[4]->AppendItem("option-A", 10501);
+   m[4]->AppendItem("option-B", 10502);
+   m[4]->AppendItem("option-C", 10503);
 
    AppendMenu(m[0]);
@@ -135,4 +147,15 @@
   labimg = new PILabel(this->MainWin(), "PixelValue", 250, 20, 10, 320);
 
+  int psx, psy;
+  PrefCompSz(psx, psy);
+  cout << " Creation bouton 11 -14 avec Sx,Sy= " << psx << " , " << psy << endl;
+
+  bouton11 = new PIButton(this->MainWin(), "AddMen-1", 1133, psx*1.5, psy, 20, 360);
+  bouton11 = new PIButton(this->MainWin(), "AddMen-2", 1233, psx*1.5, psy, 40+psx*1.5, 360);
+  stnewmen[0] = stnewmen[1] = false;
+  bouton13 = new PIButton(this->MainWin(), "Ready/Bloc", 1333, psx*1.5, psy, 60+psx*3, 360);
+  bouton14 = new PIButton(this->MainWin(), "TS-ExBWdg", 1433, psx*1.5, psy, 80+psx*4.5, 360);
+  bouton15 = new PIButton(this->MainWin(), "TS-MenuIt", 1533, psx*1.5, psy, 100+psx*6, 360);
+
 //  XSync(PIXDisplay(), FALSE);
 //  printf("Creation PIPUMenu DoIt-1... \n");   gets(ans);
@@ -169,9 +192,11 @@
 
   opt = new PIOptMenu(this->MainWin(), pum[0], 90, 25, 110, 150);
-  opt->SetValueStr("Sqrt");
+  string ops = "Sqrt";
+  opt->SetValueStr(ops);
   opt2 = new PIOptMenu(this->MainWin(), pum[1], 90, 25, 150, 200);
 
   opt3 = new PIOptMenu(this->MainWin(), pum[0], 80, 25, 110, 250);
-  opt3->SetValueStr("Linear");
+  ops = "Linear";
+  opt3->SetValueStr(ops);
   
 }
@@ -187,7 +212,13 @@
   delete bouton4;
   delete bouton5;
+  delete bouton11;
+  delete bouton12;
+  delete bouton13;
+  delete bouton14;
+  delete bouton15;
   delete scl;
   delete menu;
-  delete m[0]; delete m[1]; delete m[2];
+  delete m[0]; delete m[1]; delete m[2]; delete m[3]; delete m[4];
+  delete mc[0]; delete mc[1];
   delete opt;
   delete opt2;
@@ -228,11 +259,11 @@
   sprintf(truc,"< %ld - %d (%d)>",msg,x++, (int)((PIWdgGen *)sender)->kind());
   this->label->SetLabel(truc);
-  sprintf(truc,"[%d] Msg= %ld (%d-%d) Kind=(%d)  Data= (%d - %lx)",x, msg, (int)UserMsg(msg),
-         (int)ModMsg(msg), (int)((PIWdgGen *)sender)->kind(), (int)data, (long)data);
+  sprintf(truc,"[%d] Msg= %ld (%d-%d) Kind=(%d)  Data= (%ld - %lx)",x, msg, (int)UserMsg(msg),
+         (int)ModMsg(msg), (int)((PIWdgGen *)sender)->kind(), (long)data, (long)data);
   puts(truc);
 
   if (ModMsg(msg) == PIMsg_Active) 
     {  printf("Process: Setting active ImageWindow (%lx) \n", (long)sender); 
-    cur = (PIImage *)data; return;}
+    cur = (PIImage *)sender; return;}
 
   if (ModMsg(msg) == PIMsg_Close)
@@ -276,10 +307,39 @@
     }
 
+  if ( (msg == 1133) || (msg == 1233) )  {  // On ajoute ou on enleve un  menu du menu-bar
+    int idxmen = (msg-1133)/100;
+    cout << " Add/Remove Menu idxmen= " << idxmen << " Bool= " 
+         << Menubar()->IsSensitive(m[idxmen+3])  << " ( " << stnewmen[idxmen] << ")" << endl;
+    if ( Menubar()->IsSensitive(m[idxmen+3]) ) 
+      { Menubar()->RemoveMenu(m[idxmen+3]); stnewmen[idxmen] = false; }
+    else  { Menubar()->AppendMenu(m[idxmen+3]); stnewmen[idxmen] = true; }
+  }
+
+  if (msg == 1333) {  // Changement de sensibilite de Menu-Bar (par SetBusy())
+    cout << " SetSens() Menubar,  State= " <<  GetState()  << endl;
+    if (GetState() != kReadyState)  SetReady();
+    else  SetBlocked();
+  }
+
+  if (msg == 1533) {  // Changement de sensibilite de  Cascade
+    cout << " ChangeSensitivity()  Cascade Bool= " <<  m[1]->IsSensitive("Cascade")  << endl;
+    if (m[1]->IsSensitive("Cascade") )  m[1]->SetSensitivity("Cascade", false); 
+    else  m[1]->SetSensitivity("Cascade", true); 
+  }
+
+  if (msg == 1433) {  // Changement de sensibilite de 
+    
+  }
 //  if (msg == 555)   (this->menu)->Show(); 
 
-  if (msg == 10105)  scb->SetSize(atoi(((char *)text->GetText().c_str())));
+  if (msg == 10105)  scb->SetSlSize(atoi(((char *)text->GetText().c_str())));
   if (msg == 10104)  Stop();
   if (msg == 10101)  { pfc->AcceptNewFile(false); pfc->Show(); }
   if (msg == 10103)  { pfc->AcceptNewFile(true); pfc->Show(); }
+
+  if ((msg == 10205) || (msg == 166))  { // CheckItem Menu  or checkbox
+    cout << "PITestApp::Process CheckItem/Box Menu (" << msg 
+         << ") State=" <<  *((bool *)data) << endl; 
+  }
 
   if (msg == 10301)  
@@ -303,5 +363,5 @@
 
 
-  if ((msg > 9000) && data) printf("PITestApp::MenubarReturn: %s \n", (char *)data);
+  if (msg > 9000) printf("PITestApp::MenubarReturn: %d --> %lx \n", msg, (long)data);
   if (msg == 5000)  
     { 
@@ -318,5 +378,5 @@
         pimg[nimg]->SetZoomWin(zoom);
         pimg[nimg]->SetTextWin(labimg);
-        pimg[nimg]->SetImage(img[nimg]);
+        pimg[nimg]->SetImage(new RzImageAdapter(img[nimg], true) );
         pimg[nimg]->Apply();
         imgw[nimg]->Show();
@@ -327,5 +387,7 @@
 
   if ((msg / 100) == 56) 
-    printf("PITestApp::Process(%d) : %s \n", (int)msg, (char *)data); 
+    printf("PITestApp::Process(%d) : %lx \n", (int)msg, (long)data); 
+
+  if (msg == 8811) printf("PITestApp::Process(8811) ScrollBar( %d ) \n", *( (int*)data) );
 
 }
@@ -339,8 +401,8 @@
 
   wp2 = new PIWindow(app, "Window-2", PIWK_normal,  400, 200, 250, 250);
-  ExBWdg bw(wp2, "BWdg", 150, 150, 10, 40);
-  bw.SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_fixed);
-  ExBWdg bw2(wp2, "BWdg2", 180, 180, 200, 10);
-  bw.SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
+  exb1 = new ExBWdg(wp2, "BWdg", 150, 150, 10, 40);
+  exb1->SetBinding(PIBK_fixed,PIBK_elastic,PIBK_elastic,PIBK_fixed);
+  exb2 = new ExBWdg(wp2, "BWdg2", 180, 180, 200, 10);
+  exb2->SetBinding(PIBK_elastic,PIBK_elastic,PIBK_elastic,PIBK_elastic);
 
   wp4 = new PIWindow(app, "Window-4", PIWK_dialog,  200, 200, 350, 350);
Index: trunk/SophyaPI/PI/piwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/piwdggen.cc	(revision 105)
+++ trunk/SophyaPI/PI/piwdggen.cc	(revision 106)
@@ -77,10 +77,18 @@
 //	méthodes "Manage(), UnManage()". L'objet ne se trouve effectivement dans l'état 
 //	actif que si son conteneur parent est lui même actif.
-//--
-//++
-// void Manage()  UnManage()
+//	L'objet peut aussi être affichés, mais insensible aux actions utilisateur
+//	(clavier, souris, ...). Cette sensibilité est controlée par les 
+//	méthodes  "SetSensitive(), SetUnSensitive()".
+//--
+//++
+// void  Manage()  UnManage()
 //	Change l'état de l'objet (actif, inactif)
-// bool IfManaged()  IfVisible()
+// bool  IfManaged()  IfVisible()
 //	indique si l'objet est actif , visible	
+// void  SetSensitive() SetUnSensitive()
+//	Rend l'objet sensible/ insensible aux actions utilisateurs (clavier, souris, ...)
+//	L'état visuel de l'objet peut être modifié en conséquence.
+// bool  IfSensitive() 
+//	indique si l'objet est répond aux sollicitations utilisateur.
 //--
 
@@ -90,5 +98,4 @@
 
 //++
-//
 // void SetMsg(PIMessage msg = 0)
 //	Modifie la valeur du message associé à l'objet.
@@ -118,4 +125,5 @@
 //	une application destinatire.
 //--
+
 //++
 // bool  ClaimSelection(int typ=PICP_string)
Index: trunk/SophyaPI/PI/piwdggen.h
===================================================================
--- trunk/SophyaPI/PI/piwdggen.h	(revision 105)
+++ trunk/SophyaPI/PI/piwdggen.h	(revision 106)
@@ -64,8 +64,15 @@
   virtual void           GetScreenPos(int & spx, int & spy);
 
+// Pour activer, desactiver un composant graphique (PIWdg)
   virtual void           Manage()=0;
   virtual void           UnManage()=0;
   virtual bool           IfManaged()=0;
   virtual bool           IsVisible()=0;
+
+//  Pour rendre un composant graphique (PIWdg) sensible/insensible 
+//  aux actions utilisateur (souris, clavier, ...)
+  virtual void           SetSensitive()=0;
+  virtual void           SetUnSensitive()=0;
+  virtual bool           IfSensitive()=0;
 
   virtual void           PSPrint(PSFile *psf, int ofx=0, int ofy=0);
Index: trunk/SophyaPI/PI/piwdgx.cc
===================================================================
--- trunk/SophyaPI/PI/piwdgx.cc	(revision 105)
+++ trunk/SophyaPI/PI/piwdgx.cc	(revision 106)
@@ -227,4 +227,22 @@
 }
 
+/* --Methode-- */
+void PIWdgX::SetSensitive()
+{
+XtSetSensitive(XtWdg(), TRUE);
+}
+
+/* --Methode-- */
+void PIWdgX::SetUnSensitive()
+{
+XtSetSensitive(XtWdg(), FALSE);
+}
+
+/* --Methode-- */
+bool PIWdgX::IfSensitive()
+{
+if (XtIsSensitive(XtWdg()) == TRUE)  return(true);
+else return(false);
+}
 
 /* --Methode-- */
Index: trunk/SophyaPI/PI/piwdgx.h
===================================================================
--- trunk/SophyaPI/PI/piwdgx.h	(revision 105)
+++ trunk/SophyaPI/PI/piwdgx.h	(revision 106)
@@ -55,4 +55,8 @@
   virtual bool   IsVisible();
 
+  virtual void           SetSensitive();
+  virtual void           SetUnSensitive();
+  virtual bool           IfSensitive();
+
 //  Gestion de copier-coller
   virtual bool           ClaimSelection(unsigned int typ=PICP_string);
