Index: trunk/SophyaPI/PI/Makefile
===================================================================
--- trunk/SophyaPI/PI/Makefile	(revision 29)
+++ trunk/SophyaPI/PI/Makefile	(revision 30)
@@ -1,140 +1,41 @@
 CC := gcc
 CXX := g++
-# General setup GNU Makefile for EROS. To be included in all makefiles.  
-# Define  makefile variables according to CPU
-# MACHEROSD = `uname | sed 's/-//'`   i.e. { AIX HPUX OSF1 ULTRIX }
-# 
-# Makefile variables set are:
-# - Path to Exec, Include, Libs, Obj directories (from EROSBASEREP env. var.)
-#     i.e. variables LIB, OBJ, EXE, INC 
-#---------------------------------------------------------------------------
-
-# define MACHEROS from uname
-MACHEROS := $(shell echo `uname`)
-# define the -D option
-MACHEROSD := $(shell echo `uname | sed 's/-//'`)
-
-#-
-#-     Optimization option different for HP...
-ifeq (${MACHEROS},HP-UX)
-  O := +O
-else
-  O := -O
-endif
-#-
-#-   Define Makefile paths
-#-  
- PP  := ${EROSBASEREP}/${MACHEROS}/
- LIB := ${PP}/Libs/
- SLB := ${PP}/ShLibs/
- OBJ := ${PP}/Objs/
- EXE := ${PP}/Exec/
- INC := ${EROSBASEREP}/Include/
- CCI := ${INC}/CInc/
- CXI := ${INC}/CxxInc/
- GLB := ${GNU}/${MACHEROS}/lib/
-#--
-
-#-
-#-    Define default compilation flags
-#--
-ifeq (${MACHEROS},HP-UX)                                    
-  CFLAGS   :=  -Aa
-  FFLAGS   :=  -Aa -I${INC} -D${MACHEROSD}  
-  CPPFLAGS :=  -I${INC} -D${MACHEROSD} \
-               -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE
-else
-  FFLAGS   :=  -I${INC} -D${MACHEROSD}  
-  CFLAGS       := -g -O -Wall -Wpointer-arith \
-                -Wmissing-prototypes -Wsynth -I$(INC)
-  CXXFLAGS     := $(CFLAGS) -I$(CXI)
-endif
-AR       := /usr/bin/ar
-ARFLAGS  := -rcs
-
-
-ifeq ($(CC), gcc)
-CFLAGS       := -g -O -Wall -Wpointer-arith \
-                -Wmissing-prototypes -Wsynth -I$(INC)
-//CXXFLAGS     := $(CFLAGS) -fno-implicit-templates -I$(CXI)
-CXXFLAGS     := $(CFLAGS) -I$(CXI)
-endif
-
-#- redefine implicit rule. Les .o sont dans $(OBJ).
-$(OBJ)%.o:%.c
-	$(COMPILE.c) -o $@ $<
-
-$(OBJ)%.o:%.cc
-	$(COMPILE.cc) -o $@ $<
-
-$(OBJ)%.o:%.f
-	$(COMPILE.f) -o $@ $< 
-
-#OSF1
-#LDFC est f77
-#LDFCFLAGS est rien
-
-#parfois
-#LDFC est cc
-#LDFCFLAGS est -ltruc
-
-#------------------------------------------------- End of Makefile.h ------- 
+include ../Mgr/Makefile.h
  
-all: $(LIB)libPI.a 
-$(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
+all: $(LIB)libPI.a
+$(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
 	$(AR) $(ARFLAGS)  $@ $?
  
-$(OBJ)piapplgen.o: ./piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
+$(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
  pimenubargen.h pimenux.h pimenugen.h
-$(OBJ)piapplx.o: ./piapplx.cc piapplx.h piapplgen.h pimsghandler.h \
- pisysdep.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
- pimenubarx.h pimenubargen.h pimenux.h pimenugen.h
-$(OBJ)pibwdggen.o: ./pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
+$(OBJ)piapplx.o: piapplx.cc piapplx.h piapplgen.h pimsghandler.h pisysdep.h \
+ picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
+ pimenubargen.h pimenux.h pimenugen.h
+$(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
  pimsghandler.h
-$(OBJ)pibwdgx.o: ./pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
+$(OBJ)pibwdgx.o: pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
  piwdggen.h pimsghandler.h pixtbaseP.h pixtbase.h
-$(OBJ)picmap.o: ./picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
-$(OBJ)picmapgen.o: ./picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
-$(OBJ)picmapx.o: ./picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
+$(OBJ)picmap.o: picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
+$(OBJ)picmapgen.o: picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
+$(OBJ)picmapx.o: picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
  picmapgen.h pisysdep.h
-$(OBJ)picontainergen.o: ./picontainergen.cc picontainergen.h pisysdep.h \
+$(OBJ)picontainergen.o: picontainergen.cc picontainergen.h pisysdep.h \
  piwdgx.h piwdggen.h pimsghandler.h
-$(OBJ)picontainerx.o: ./picontainerx.cc picontainerx.h pisysdep.h \
+$(OBJ)picontainerx.o: picontainerx.cc picontainerx.h pisysdep.h \
  picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
-$(OBJ)pidemo.o: ./pidemo.cc \
- $(INC)perrors.h \
- $(INC)exceptions.h \
- $(INC)defs.h \
- $(INC)fitsimage.h \
- $(INC)cimage.h \
- $(INC)rzimage.h \
- $(INC)rzvect.h \
- $(INC)machine.h \
- $(INC)datatypes.h \
- $(INC)fitsheader.h \
- $(INC)fitskeys.h pidemo.h \
- pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \
- picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \
- pimenux.h pimenugen.h piwindowx.h piwindowgen.h pioptmenux.h \
- pioptmenugen.h pistdwdgx.h pistdwdggen.h pifilechox.h pifilechogen.h \
- piimage.h $(INC)lut.h \
- pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
- picmapgen.h pihisto.h piscdrawwdg.h \
- $(INC)histos.h \
- $(INC)peida.h \
- $(INC)utils.h pidrawwin.h \
- $(INC)piup.h
-$(OBJ)pidrawwin.o: ./pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
+$(OBJ)pidrawwin.o: pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
  piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
- pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h
-$(OBJ)pifilechogen.o: ./pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
+ pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h pistdwdgx.h \
+ pistdwdggen.h
+$(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
  piwdggen.h pimsghandler.h
-$(OBJ)pifilechox.o: ./pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
+$(OBJ)pifilechox.o: pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
  piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \
  picontainerx.h picontainergen.h
-$(OBJ)pihisto.o: ./pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
- pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
- $(INC)histos.h \
+$(OBJ)pihisto.o: pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
+ pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
+ pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
+ picontainergen.h $(INC)histos.h \
  $(INC)peida.h \
  $(INC)defs.h \
@@ -142,7 +43,7 @@
  $(INC)machine.h \
  $(INC)perrors.h \
- $(INC)exceptions.h
-$(OBJ)piimage.o: ./piimage.cc piimage.h \
- $(INC)cimage.h \
+ $(INC)exceptions.h \
+ $(INC)peidainit.h
+$(OBJ)piimage.o: piimage.cc piimage.h $(INC)cimage.h \
  $(INC)rzimage.h \
  $(INC)rzvect.h \
@@ -150,43 +51,65 @@
  $(INC)defs.h \
  $(INC)exceptions.h \
+ $(INC)peidainit.h \
  $(INC)perrors.h \
+ $(INC)imaginit.h \
  $(INC)datatypes.h \
- $(INC)lut.h pisysdep.h \
- pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \
+ $(INC)lut.h pisysdep.h pipixmapx.h \
+ pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \
  pimsghandler.h picmap.h picmapx.h picmapgen.h pistdwdgx.h \
- pistdwdggen.h \
- $(INC)imageop.h \
+ pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
+ picontainergen.h $(INC)imageop.h \
  $(INC)fitsimage.h \
  $(INC)fitsheader.h \
- $(INC)fitskeys.h
-$(OBJ)pimenubargen.o: ./pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
+ $(INC)erosio.h \
+ $(INC)fitskeys.h \
+ $(INC)erostape.h \
+ $(INC)strutil.h \
+ $(INC)ptrarray.h \
+ $(INC)voidptrarray.h \
+ $(INC)basearray.h \
+ $(INC)peida.h \
+ $(INC)utils.h \
+ $(INC)array.h \
+ $(INC)lockfile.h \
+ $(INC)erostarfile.h \
+ $(INC)dates.h \
+ $(INC)tarlib.h
+$(OBJ)pilistgen.o: pilistgen.cc pilistgen.h pisysdep.h piwdgx.h piwdggen.h \
+ pimsghandler.h
+$(OBJ)pilistx.o: pilistx.cc pilistx.h pilistgen.h pisysdep.h piwdgx.h \
+ piwdggen.h pimsghandler.h picontainerx.h picontainergen.h
+$(OBJ)pimenubargen.o: pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
  pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \
  picontainerx.h picontainergen.h pimenubarx.h
-$(OBJ)pimenubarx.o: ./pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
+$(OBJ)pimenubarx.o: pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
  pimenux.h pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h \
  piapplgen.h picontainerx.h picontainergen.h
-$(OBJ)pimenugen.o: ./pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
+$(OBJ)pimenugen.o: pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
  pimsghandler.h
-$(OBJ)pimenux.o: ./pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
+$(OBJ)pimenux.o: pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
  piwdggen.h pimsghandler.h
-$(OBJ)pimsghandler.o: ./pimsghandler.cc pimsghandler.h
-$(OBJ)pioptmenugen.o: ./pioptmenugen.cc pioptmenugen.h pisysdep.h \
+$(OBJ)pimsghandler.o: pimsghandler.cc pimsghandler.h
+$(OBJ)pioptmenugen.o: pioptmenugen.cc pioptmenugen.h pisysdep.h \
  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
  pimenux.h pimenugen.h
-$(OBJ)pioptmenux.o: ./pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
+$(OBJ)pioptmenux.o: pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
  pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h
-$(OBJ)pipixmapgen.o: ./pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
+$(OBJ)piperiodx.o: piperiodx.cc piperiodx.h \
+ $(INC)periodic.h
+$(OBJ)pipixmapgen.o: pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
  picmapgen.h
-$(OBJ)piperiodx.o: ./piperiodx.cc ./piperiodx.h $(INC)periodic.h
-$(OBJ)pipixmapx.o: ./pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
+$(OBJ)pipixmapx.o: pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
  pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \
  picmapx.h picmapgen.h
-$(OBJ)piscdrawwdg.o: ./piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
- pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
- $(INC)generalfit.h \
+$(OBJ)piscdrawwdg.o: piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
+ pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
+ pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
+ picontainergen.h $(INC)generalfit.h \
  $(INC)exceptions.h \
  $(INC)defs.h \
+ $(INC)peidainit.h \
  $(INC)matrix.h \
  $(INC)peida.h \
@@ -197,16 +120,44 @@
  $(INC)pclassids.h \
  $(INC)cvector.h
-$(OBJ)pistdwdggen.o: ./pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
+$(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
  piwdggen.h pimsghandler.h
-$(OBJ)pistdwdgx.o: ./pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
+$(OBJ)pistdwdgx.o: pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
  piwdgx.h piwdggen.h pimsghandler.h
-$(OBJ)piwdggen.o: ./piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
+$(OBJ)piup.o: piup.cc $(INC)ctimer.h \
+ $(INC)peida.h \
+ $(INC)defs.h \
+ $(INC)utils.h \
+ $(INC)machine.h \
+ $(INC)perrors.h \
+ $(INC)exceptions.h \
+ $(INC)peidainit.h \
+ $(INC)imageop.h \
+ $(INC)cimage.h \
+ $(INC)rzimage.h \
+ $(INC)rzvect.h \
+ $(INC)imaginit.h \
+ $(INC)datatypes.h \
+ $(INC)fitsimage.h \
+ $(INC)fitsheader.h \
+ $(INC)erosio.h \
+ $(INC)fitskeys.h \
+ $(INC)erostape.h \
+ $(INC)strutil.h \
+ $(INC)ptrarray.h \
+ $(INC)voidptrarray.h \
+ $(INC)basearray.h \
+ $(INC)array.h \
+ $(INC)lockfile.h \
+ $(INC)erostarfile.h \
+ $(INC)dates.h \
+ $(INC)tarlib.h piup.h
+$(OBJ)piwdggen.o: piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
  pisysdep.h piwdgx.h
-$(OBJ)piwdgx.o: ./piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h \
- picontainerx.h pisysdep.h picontainergen.h
-$(OBJ)piwindowgen.o: ./piwindowgen.cc piwindowgen.h pisysdep.h \
+$(OBJ)piwdgx.o: piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h picontainerx.h \
+ pisysdep.h picontainergen.h
+$(OBJ)piwindowgen.o: piwindowgen.cc piwindowgen.h pisysdep.h picontainerx.h \
+ picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
+$(OBJ)piwindowx.o: piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
-$(OBJ)piwindowx.o: ./piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
- picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
-$(OBJ)pixtbase.o: ./pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
+$(OBJ)pixtbase.o: pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
  piwdgx.h piwdggen.h pimsghandler.h pixtbase.h
Index: trunk/SophyaPI/PI/picmapgen.h
===================================================================
--- trunk/SophyaPI/PI/picmapgen.h	(revision 29)
+++ trunk/SophyaPI/PI/picmapgen.h	(revision 30)
@@ -36,4 +36,5 @@
   string const& Nom() const {return mNom;}
 
+  virtual PIColor GetColor(int n)=0;
   virtual void AllocColor(PIColor const& col, int index)=0;
   virtual void FreeColors()=0;     // Desalloue les couleurs
Index: trunk/SophyaPI/PI/picmapx.cc
===================================================================
--- trunk/SophyaPI/PI/picmapx.cc	(revision 29)
+++ trunk/SophyaPI/PI/picmapx.cc	(revision 30)
@@ -14,5 +14,8 @@
 int n = nCols[id-1];
 mColors = new PIXColor[n];
-for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+mColRGB = new PIColor[n];
+for(int i=0; i<n; i++)  
+  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
 
 // printf("PIColorMapX::PIColorMapX(CMapId) %d %d \n", mNCol, Type());
@@ -27,5 +30,8 @@
 int n = nCols[id-1];
 mColors = new PIXColor[n];
-for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+mColRGB = new PIColor[n];
+for(int i=0; i<n; i++)  
+  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
 // printf("PIColorMapX::PIColorMapX(CMapId, int) %d %d \n", mNCol, Type());
 
@@ -41,5 +47,8 @@
 int n = nCol;
 mColors = new PIXColor[n];
-for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+mColRGB = new PIColor[n];
+for(int i=0; i<n; i++)  
+  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
 // printf("PIColorMapX::PIColorMapX(nom, nCol) %d %d \n", mNCol, Type());
 
@@ -52,4 +61,21 @@
 {
 delete[] mColors;
+delete[] mColRGB;
+}
+
+
+/* --Methode-- */
+PIColor PIColorMapX::GetColor(int n)
+{
+PIColor picr;
+picr.red = picr.green = picr.blue = 0;
+
+if ((n<0) || (n >= NCol()))   
+  {
+  PIColor picr;
+  picr.red = picr.green = picr.blue = 0;
+  return(picr);
+  }
+return(mColRGB[n]);
 }
 
@@ -76,4 +102,5 @@
   {
   mColors[index] = myxcol.pixel;
+  mColRGB[index] = col; 
 //  printf("PIColorMapX::AllocColor()  RGB= %d %d %d \n",
 //         (int) col.red, (int) col.blue, (int) col.green);
@@ -103,5 +130,6 @@
 
 for (int i=0; i<mNCol; i++)  
-  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
+  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
 
 printf("PIColorMapX::FreeColors()  Type= %d mNCol= %d \n",
@@ -114,4 +142,6 @@
 {
   CopyFromGen(x);
-  for (int i=0; i<mNCol; i++)  mColors[i] = ((PIColorMapX *)x)->mColors[i];
+  for (int i=0; i<mNCol; i++)  
+    { mColors[i] = ((PIColorMapX *)x)->mColors[i];
+    mColRGB[i] = ((PIColorMapX *)x)->mColRGB[i]; }
 }
Index: trunk/SophyaPI/PI/picmapx.h
===================================================================
--- trunk/SophyaPI/PI/picmapx.h	(revision 29)
+++ trunk/SophyaPI/PI/picmapx.h	(revision 30)
@@ -18,4 +18,5 @@
     { return ((index < mNCol) ? mColors[index] : 0); } ;
 
+  virtual PIColor GetColor(int n);
   virtual void AllocColor(PIColor const& col, int index);
   virtual void FreeColors();
@@ -25,5 +26,6 @@
   void CopyFrom(PIColorMapGen*);
   
-  PIXColor  * mColors;     // La table des couleurs ... 
+  PIXColor  * mColors;     // La table des couleurs ...
+  PIColor   * mColRGB;     // Composantes RGB  
 };
 
Index: trunk/SophyaPI/PI/pilistgen.cc
===================================================================
--- trunk/SophyaPI/PI/pilistgen.cc	(revision 30)
+++ trunk/SophyaPI/PI/pilistgen.cc	(revision 30)
@@ -0,0 +1,10 @@
+#include "pilistgen.h"
+
+
+PIListGen::PIListGen(PIContainerGen *par, char *nom,
+                     int sx, int sy, int px, int py)
+: PIWdg(par, nom, sx, sy, px, py)
+{}
+
+PIListGen::~PIListGen()
+{}
Index: trunk/SophyaPI/PI/pilistgen.h
===================================================================
--- trunk/SophyaPI/PI/pilistgen.h	(revision 30)
+++ trunk/SophyaPI/PI/pilistgen.h	(revision 30)
@@ -0,0 +1,37 @@
+#ifndef PILISTGEN_H_SEEN
+#define PILISTGEN_H_SEEN
+
+#include "pisysdep.h"
+#include PIWDG_H
+
+
+class PIListGen : public PIWdg {
+public:
+  enum {ClassId = 1110};
+
+	             PIListGen(PIContainerGen* par, char* nom,
+                               int sx=100, int sy=100, int px=0, int py=0);
+	             ~PIListGen();
+				   
+  virtual void	     AppendItem(char* item, PIMessage msg)=0;
+  virtual void       DeleteItem(char *item)=0;
+  virtual void       DeleteItem(PIMessage msg)=0;
+  
+  virtual void       SetMultipleSelect(bool ms=false)=0;
+
+  virtual int        GetNbSelection()=0;
+  virtual PIMessage  GetSelection(int num=0)=0;
+  virtual string     GetSelectionStr(int num=0)=0;
+
+  virtual void       SelectItem(char *item)=0;
+  virtual void       SelectItem(PIMessage msg)=0;
+  virtual void       ClearSelItem(char *item)=0;
+  virtual void       ClearSelItem(PIMessage msg)=0;
+
+  virtual long       kind() {return ClassId; }
+
+protected:
+}; 
+
+
+#endif
Index: trunk/SophyaPI/PI/pilistx.cc
===================================================================
--- trunk/SophyaPI/PI/pilistx.cc	(revision 30)
+++ trunk/SophyaPI/PI/pilistx.cc	(revision 30)
@@ -0,0 +1,379 @@
+#include<stdio.h>
+
+#include "pilistx.h"
+#include "picontainerx.h"
+
+#include <Xm/Xm.h>
+#include <Xm/List.h>
+
+/************* PIListX ************/
+
+
+// Fonction prive (CallBack)
+static void list_action(Widget w, XtPointer *usd, XmListCallbackStruct *isel);
+
+/* Nouvelle-Fonction */
+void  list_action(Widget /*w*/, XtPointer *usd, XmListCallbackStruct *isel)
+{
+PIListX *pil;
+
+pil = (PIListX *)usd ;
+pil->ToggleSel(isel->item_position, true);
+//printf("list_action/Debug: reason=%d itemPos= %d \n", 
+//isel->reason, isel->item_position);
+return;
+}
+
+
+#define NBITEMB  20
+#define NBISELB  5
+
+
+/* --Methode-- */
+PIListX::PIListX(PIContainerGen* par, char* nom,
+                 int sx, int sy, int px, int py)
+: PIListGen(par, nom, sx, sy, px, py)
+{
+
+mNItem = mNItemMax = 0;
+mMess = NULL;  mSel = NULL;
+mNbSel = mNSelMax = 0;
+mSelNum = NULL;
+ 
+Arg  warg[3];
+int n = 0;
+XtSetArg(warg[n], XmNlistSizePolicy, XmCONSTANT);  n++;
+XtSetArg(warg[n], XmNscrollBarDisplayPolicy, XmAS_NEEDED);  n++;
+mlist = XmCreateScrolledList(((PIWdgX *)par)->XtWdg(), nom, warg, n);
+XtManageChild(mlist);
+XtWdg() = XtParent(mlist);
+SetSize(sx, sy);
+SetPos(px, py);
+wmis == k_wmi_normal ;
+stmng = 0;
+
+//XtAddCallback(mlist, XmNdefaultActionCallback,
+//              list_action, (XtPointer)this);
+XtAddCallback(mlist, XmNmultipleSelectionCallback,
+              list_action, (XtPointer)this);
+XtAddCallback(mlist, XmNsingleSelectionCallback,
+              list_action, (XtPointer)this);
+
+SetMultipleSelect(false);
+Manage();
+}
+
+/* --Methode-- */
+PIListX::~PIListX()
+{
+
+if (mNItemMax > 0)  
+  {
+    //  XtFree((char *)mItems);
+  delete[] mMess;
+  delete[] mSel;
+  }  
+if (mNSelMax > 0)  delete[] mSelNum;
+}
+
+
+/* --Methode-- */
+void PIListX::AppendItem(char* item, PIMessage msg)
+{
+
+if (mNItem >= mNItemMax)
+  {
+  PIMessage *mso;
+  bool *slo;
+  int i;
+
+  mso = mMess;
+  slo = mSel;
+  mNItemMax += NBITEMB;
+  mMess = new PIMessage[mNItemMax];
+  mSel = new bool[mNItemMax];
+  for(i=0; i<mNItem; i++)   
+    {  mMess[i] = mso[i];  mSel[i] = slo[i]; }
+
+  delete[] mso;
+  delete[] slo;
+  }
+
+mMess[mNItem] = msg;
+mSel[mNItem] = false;
+mNItem++;
+
+XmString xms = XmStringCreate(item, XmSTRING_DEFAULT_CHARSET);
+XmListAddItem(mlist, xms, 0);
+XmStringFree(xms);
+return;
+}
+
+/* --Methode-- */
+void PIListX::DeleteItem(char *item)
+{
+int n;
+if ((n=GetNumItem(item)) < 0)  return;
+DelItem(n);
+return;
+}
+
+/* --Methode-- */
+void PIListX::DeleteItem(PIMessage msg)
+{
+int n;
+if ((n=GetNumItemMsg(msg)) < 0)  return;
+DelItem(n);
+return;
+}
+
+
+/* --Methode-- */
+void PIListX::SetMultipleSelect(bool ms)
+{
+Arg  warg[2];
+
+mMultSel = ms;
+if (ms)
+  XtSetArg(warg[0], XmNselectionPolicy, XmMULTIPLE_SELECT);  
+else
+  XtSetArg(warg[0], XmNselectionPolicy, XmSINGLE_SELECT);  
+
+XtSetValues(mlist, warg, 1);
+}
+
+/* --Methode-- */
+int PIListX::GetNbSelection()
+{
+return(mNbSel);
+}
+
+/* --Methode-- */
+PIMessage PIListX::GetSelection(int num)
+{
+return(ItemMsg(mSelNum[num]));
+}
+
+/* --Methode-- */
+string PIListX::GetSelectionStr(int num)
+{
+string s(ItemStr(mSelNum[num]));
+return(s);
+}
+
+/* --Methode-- */
+void PIListX::SelectItem(char * item)
+{
+int n;
+if ((n=GetNumItem(item)) < 0)  return;
+if ((!mMultSel) && (mNbSel > 0) && (mSelNum[0] != n))
+  ClrSItem(mSelNum[0], false, true);  
+SelItem(n, false, true);
+return;
+}
+
+/* --Methode-- */
+void PIListX::SelectItem(PIMessage msg)
+{
+int n;
+if ((n=GetNumItemMsg(msg)) < 0)  return;
+if ((!mMultSel) && (mNbSel > 0) && (mSelNum[0] != n))
+  ClrSItem(mSelNum[0], false, true);  
+SelItem(n, false, true);
+return;
+}
+
+
+/* --Methode-- */
+void PIListX::ClearSelItem(char * item)
+{
+int n;
+if ((n=GetNumItem(item)) < 0)  return;
+ClrSItem(n, false, true);
+return;
+}
+
+/* --Methode-- */
+void PIListX::ClearSelItem(PIMessage msg)
+{
+int n;
+if ((n=GetNumItemMsg(msg)) < 0)  return;
+ClrSItem(n, false, true);
+return;
+}
+
+
+/* --Methode-- */
+void PIListX::ToggleSel(int n, bool smg)
+{
+if ( (n < 0) || (n >= mNItem))  return;
+if (mSel[n])  ClrSItem(n,smg); 
+else
+  {
+  if ((!mMultSel) && (mNbSel > 0))  ClrSItem(mSelNum[0], smg);
+  SelItem(n, smg);
+  }
+}
+
+
+/* --Methode-- */
+PIMessage PIListX::ItemMsg(int n)
+{
+if ( (n < 0) || (n >= mNItem))  return(0);
+else return(mMess[n]);
+}
+
+/* --Methode-- */
+char * PIListX::ItemStr(int n)
+{
+Arg  warg[2];
+char *buff;
+XmString *xmst;
+
+if ( (n < 0) || (n >= mNItem))  return("");
+
+XtSetArg(warg[0], XmNitems, &xmst);  
+XtGetValues(mlist, warg, 1);
+XmStringGetLtoR(xmst[n], XmSTRING_DEFAULT_CHARSET, &buff);
+return(buff);
+}
+
+/* --Methode-- */
+int PIListX::GetNumItem(char *it)
+{
+for(int i=0; i<mNItem; i++)
+  if (strcmp(ItemStr(i), it) == 0)  return(i);
+return(-1);
+}
+
+/* --Methode-- */
+int PIListX::GetNumItemMsg(PIMessage msg)
+{
+for(int i=0; i<mNItem; i++)
+  if (mMess[i] == msg)   return(i);  
+return(-1);
+}
+
+
+
+/* --Methode-- */
+void PIListX::DelItem(int n)
+{
+int i;
+
+if ((n < 0) || (n > mNItem))  return;
+
+ClrSItem(n);
+for(i=n; i<mNItem-1; i++)
+  { mMess[i] = mMess[i+1];  mSel[i] = mSel[i+1]; }
+mNItem--;
+
+if (mNItem < (mNItemMax-NBITEMB-1))
+  {
+    //  XmString *ito;
+  PIMessage *mso;
+  bool *slo;
+
+  //  ito = mItems;
+  mso = mMess;
+  slo = mSel;
+  mNItemMax -= NBITEMB;
+  mMess = new PIMessage[mNItemMax];
+  mSel = new bool[mNItemMax];
+  //  mItems = (XmString *) XtMalloc(sizeof(XmString)*mNItemMax);
+  for(i=0; i<mNItem; i++)   
+    { // mItems[i] = ito[i];
+    mMess[i] = mso[i];  mSel[i] = slo[i]; }
+
+  //  XtFree((char *)mItems);
+  delete[] mso;
+  delete[] slo;
+  }
+
+XmListDeletePos(mlist, n+1);
+return;
+}
+
+
+/* --Methode-- */
+bool PIListX::SelItem(int n, bool smg, bool cxw)
+{
+int i;
+
+if ((n < 0) || (n > mNItem))  return(false);
+if (mSel[n])  return(false);
+
+mSel[n] = true;
+if (mNbSel >= mNSelMax)
+  {
+  int * osel;
+  osel = mSelNum;
+  mNSelMax += NBISELB;
+  mSelNum = new int[mNSelMax];
+  for(i=0; i<mNbSel; i++)  mSelNum[i] = osel[i];
+  if (osel)  delete[] osel;
+  }
+
+mSelNum[mNbSel] = n; 
+mNbSel++;
+if (smg)  
+  Send(mMess[n], PIMsg_Select); 
+if (cxw)
+  XmListSelectPos(mlist, n+1, FALSE);
+return(true);
+}
+
+
+
+
+/* --Methode-- */
+bool PIListX::ClrSItem(int n, bool smg, bool cxw)
+{
+int i;
+if ((n < 0) || (n > mNItem))  return(false);
+if (!mSel[n])  return(false);
+mSel[n] = false;
+
+mNbSel --;
+if (smg)  
+  Send(mMess[n], PIMsg_ClearSel); 
+if (cxw)
+  XmListDeselectPos(mlist, n+1);
+
+delete[] mSelNum;
+if (mNbSel <= 0)
+  { mNSelMax = mNbSel = 0;  mSelNum = NULL; }
+else
+  {
+  mNSelMax = (mNbSel+NBISELB)/NBISELB;
+  mSelNum = new int[mNSelMax];
+  mNbSel =  0;
+  for(i=0; i<mNItem; i++)
+    if (mSel[i]) { mSelNum[mNbSel] = i; mNbSel++; }
+  }
+
+return(true);
+} 
+
+
+/* --Methode-- 
+    A Supprimer .....
+void PIListX::ChangeSel()
+{
+XmString *xmst;
+int n;
+
+n=0;
+XtSetArg(warg[n], XmNselectedItems, &xmst);  n++;
+XtGetValues(mlist, warg, n);
+if (xmst)  XtFree(xmst);
+xmst =  (XmString *) XtMalloc(sizeof(XmString)*mNbSel);
+for(i=0; i<mNbSel; i++)
+  xmst[i] = mItems[mSelNum[i]];
+n=0;
+XtSetArg(warg[n], XmNselectedItems, xmst);  n++;
+XtSetArg(warg[n], XmNselectedItemCount, mNbSel);  n++;
+XtSetValues(mlist, warg, n);
+return;
+}
+   .....  */
Index: trunk/SophyaPI/PI/pilistx.h
===================================================================
--- trunk/SophyaPI/PI/pilistx.h	(revision 30)
+++ trunk/SophyaPI/PI/pilistx.h	(revision 30)
@@ -0,0 +1,51 @@
+#ifndef PILISTX_H_SEEN
+#define PILISTX_H_SEEN
+
+#include "pilistgen.h"
+
+class PIListX : public PIListGen {
+public:
+	             PIListX(PIContainerGen* par, char* nom,
+                             int sx=100, int sy=100, int px=0, int py=0);
+	             ~PIListX();
+				   
+  virtual void	     AppendItem(char* item, PIMessage msg);
+  virtual void       DeleteItem(char *item);
+  virtual void       DeleteItem(PIMessage msg);
+
+  virtual void       SetMultipleSelect(bool ms=false);
+
+  virtual int        GetNbSelection();
+  virtual PIMessage  GetSelection(int num=0);
+  virtual string     GetSelectionStr(int num=0);
+
+  virtual void       SelectItem(char * item);
+  virtual void       SelectItem(PIMessage msg);
+  virtual void       ClearSelItem(char * item);
+  virtual void       ClearSelItem(PIMessage msg);
+
+// Mis en public pour Callback Xt
+  virtual void       ToggleSel(int n, bool smg=false);
+
+protected:
+  PIMessage          ItemMsg(int n);
+  char *             ItemStr(int n);
+  int                GetNumItem(char *nom);
+  int                GetNumItemMsg(PIMessage msg);
+  void               DelItem(int n);
+  bool               SelItem(int n, bool smg=false, bool cxw=false);
+  bool               ClrSItem(int n, bool smg=false, bool cxw=false);
+
+int mNItem, mNItemMax;
+PIMessage * mMess;
+bool * mSel;
+int mNbSel, mNSelMax;
+int * mSelNum;
+bool mMultSel;
+
+SysDWdg mlist;
+};
+
+typedef PIListX        PIList;
+
+#endif
Index: trunk/SophyaPI/PI/pimsghandler.h
===================================================================
--- trunk/SophyaPI/PI/pimsghandler.h	(revision 29)
+++ trunk/SophyaPI/PI/pimsghandler.h	(revision 30)
@@ -18,5 +18,10 @@
 	PIMsg_DataChanged   = 21,
 	PIMsg_Click         = 22,
-        PIMsg_Press         = 23
+        PIMsg_Press         = 23,
+        PIMsg_Drag          = 24,
+
+        PIMsg_Select        = 31,
+        PIMsg_ClearSel      = 32
+
 };
 
Index: trunk/SophyaPI/PI/pistdwdggen.cc
===================================================================
--- trunk/SophyaPI/PI/pistdwdggen.cc	(revision 29)
+++ trunk/SophyaPI/PI/pistdwdggen.cc	(revision 30)
@@ -26,15 +26,4 @@
 
 
-/************* PIScaleGen ************/
-
-PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg, 
-                       int /*min*/, int /*max*/, int sx, int sy, int px, int py)
-: PIWdg(par, nom, sx, sy, px, py) 
-{
-SetMsg(msg);
-}
-
-PIScaleGen::~PIScaleGen()
-{}
 
 /************* PITextGen ************/
@@ -64,2 +53,26 @@
 
 
+/************* PIScaleGen ************/
+
+PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg, 
+                       bool /*horiz*/, int sx, int sy, int px, int py)
+: PIWdg(par, nom, sx, sy, px, py) 
+{
+SetMsg(msg);
+}
+
+PIScaleGen::~PIScaleGen()
+{}
+
+/************* PIScrollBarGen ************/
+
+PIScrollBarGen::PIScrollBarGen(PIContainerGen *par, char *nom, PIMessage msg, 
+                       bool /*horiz*/, int sx, int sy, int px, int py)
+: PIWdg(par, nom, sx, sy, px, py) 
+{
+SetMsg(msg);
+}
+
+PIScrollBarGen::~PIScrollBarGen()
+{}
+
Index: trunk/SophyaPI/PI/pistdwdggen.h
===================================================================
--- trunk/SophyaPI/PI/pistdwdggen.h	(revision 29)
+++ trunk/SophyaPI/PI/pistdwdggen.h	(revision 30)
@@ -12,5 +12,5 @@
                      PILabelGen(PIContainerGen* par, char* nom,
                                  int sx=10, int sy=10, int px=0, int py=0);
-  virtual           ~PILabelGen();
+  virtual            ~PILabelGen();
 
   virtual long       kind() {return ClassId; }
@@ -30,8 +30,7 @@
                                  int sx=10, int sy=10, int px=0, int py=0,
                                  PIBtnSign bsgn = PIBtn_Label);
-  virtual           ~PIButtonGen();
+  virtual            ~PIButtonGen();
 
   virtual long       kind() {return ClassId; }
-
   virtual void       ActivatePress(bool acp=false)=0;
 
@@ -60,13 +59,34 @@
 
 
+
+class PICheckBoxGen : public PIWdg
+{
+public:
+
+  enum {ClassId = 1030};
+
+                     PICheckBoxGen(PIContainerGen* par, char* nom, 
+                                  PIMessage msg = PIMsg_Click,
+                                  int sx=10, int sy=10, int px=0, int py=0);
+  virtual            ~PICheckBoxGen()=0;
+  virtual void       SetState(bool st=false)=0;
+  virtual bool       GetState()=0;
+  
+  virtual long       kind() {return ClassId; }
+
+protected:
+
+};
+
+
 class PIScaleGen : public PIWdg
 {
 public:
-  enum {ClassId = 1030};
+  enum {ClassId = 1040};
 
                      PIScaleGen(PIContainerGen* par, char* nom, 
-                     PIMessage msg = PIMsg_Click,
-                     int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
-  ~PIScaleGen();
+                                PIMessage msg = PIMsg_DataChanged, bool horiz=true,
+                                int sx=100, int sy=10, int px=0, int py=0);
+  virtual            ~PIScaleGen();
 
   virtual void       SetMinMax(int min, int max) = 0;
@@ -78,20 +98,23 @@
 protected:
 
-
 };
 
-class PICheckBoxGen : public PIWdg
+class PIScrollBarGen : public PIWdg
 {
 public:
+  enum {ClassId = 1050};
 
-  enum {ClassId = 1040};
+                     PIScrollBarGen(PIContainerGen* par, char* nom, 
+                                    PIMessage msg=PIMsg_DataChanged, bool vert=true,
+                                    int sx=10, int sy=100, int px=0, int py=0);
+  virtual            ~PIScrollBarGen();
 
-                     PICheckBoxGen(PIContainerGen* par, char* nom, 
-                                   PIMessage msg = PIMsg_Click,
-                                   int sx=10, int sy=10, int px=0, int py=0);
-  virtual           ~PICheckBoxGen()=0;
-  virtual void      SetState(bool st=false)=0;
-  virtual bool      GetState()=0;
-  
+  virtual void       ActivateDrag(bool acd=false) = 0;
+  virtual void       SetMinMax(int min, int max) = 0;
+  virtual void       SetValue(int val) = 0;
+  virtual int        GetValue() = 0; 
+  virtual void       SetSize(int sz) = 0;
+  virtual int        GetSize() = 0;
+
   virtual long       kind() {return ClassId; }
 
@@ -100,5 +123,3 @@
 };
 
-
-
 #endif
Index: trunk/SophyaPI/PI/pistdwdgx.cc
===================================================================
--- trunk/SophyaPI/PI/pistdwdgx.cc	(revision 29)
+++ trunk/SophyaPI/PI/pistdwdgx.cc	(revision 30)
@@ -221,4 +221,59 @@
 
 
+/************* PICheckBoxX ************/
+#include <Xm/ToggleB.h>
+
+// Fonction prive (CallBack)
+static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld);
+
+/* Nouvelle-Fonction */
+void  toggb_action(Widget , XtPointer *usd, XtPointer *)
+{
+PICheckBoxX *picb;
+picb = (PICheckBoxX *) usd ;
+picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState());
+return;
+}
+
+/* --Methode-- */
+PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg,
+                         int sx, int sy, int px, int py)
+: PICheckBoxGen(par, nom, msg, sx, sy, px, py)
+{
+CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py);
+XtAddCallback(XtWdg(), XmNvalueChangedCallback,
+              toggb_action, (XtPointer)this);
+Arg warg[2];
+XtSetArg(warg[0],XmNhighlightThickness, 0);
+XtSetValues(XtWdg(), warg, 1);
+Manage();
+}
+
+
+/* --Methode-- */
+PICheckBoxX::~PICheckBoxX()
+{}
+
+
+/* --Methode-- */
+void PICheckBoxX::SetState(bool st)
+{
+Arg warg[2];
+XtSetArg(warg[0],XmNset, st);
+XtSetValues(XtWdg(), warg, 1);
+return;
+}
+
+/* --Methode-- */
+bool PICheckBoxX::GetState()
+{
+int val;
+Arg warg[2];
+XtSetArg(warg[0], XmNset, &val); 
+XtGetValues(XtWdg(), warg, 1);
+return ((bool)val);
+}
+
+
 /************* PIScaleX ************/
 #include <Xm/Scale.h>
@@ -241,6 +296,6 @@
 /* --Methode-- */
 PIScaleX::PIScaleX(PIContainerGen *par, char *nom, PIMessage msg,
-                   int min, int max, int sx, int sy, int px, int py)
-: PIScaleGen(par, nom, msg, min, max, sx, sy, px, py)
+                   bool horiz, int sx, int sy, int px, int py)
+: PIScaleGen(par, nom, msg, horiz, sx, sy, px, py)
 {
 int n=0;
@@ -248,5 +303,5 @@
 CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py);
 XtSetArg(warg[n], XmNshowValue, TRUE); n++;
-if (sx > sy)
+if (horiz)
   {
   XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
@@ -263,6 +318,6 @@
 
 XtSetValues(XtWdg(), warg, n);
-SetMinMax(min, max);
-SetValue(min);
+SetMinMax(1, 10);
+SetValue(1);
 XtAddCallback(XtWdg(), XmNvalueChangedCallback, 
               scale_action, (XtPointer)this);
@@ -312,5 +367,5 @@
 XtGetValues(this->sdw, warg, n);
 mVal = val;
-return(val);
+return(mVal);
 }
 
@@ -322,55 +377,172 @@
 }
 
-/************* PICheckBoxX ************/
-#include <Xm/ToggleB.h>
+
+
+/************* PIScrollBarX ************/
+
+#include <Xm/ScrollBar.h>
 
 // Fonction prive (CallBack)
-static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld);
-
-/* Nouvelle-Fonction */
-void  toggb_action(Widget , XtPointer *usd, XtPointer *)
-{
-PICheckBoxX *picb;
-picb = (PICheckBoxX *) usd ;
-picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState());
-return;
-}
-
-/* --Methode-- */
-PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg,
-                         int sx, int sy, int px, int py)
-: PICheckBoxGen(par, nom, msg, sx, sy, px, py)
-{
-CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py);
-XtAddCallback(XtWdg(), XmNvalueChangedCallback,
-              toggb_action, (XtPointer)this);
-Arg warg[2];
-XtSetArg(warg[0],XmNhighlightThickness, 0);
-XtSetValues(XtWdg(), warg, 1);
+static void scrollbar_action(Widget w, XtPointer *usd, 
+                             XmScrollBarCallbackStruct *calld);
+static void scrollbar_drag(Widget w, XtPointer *usd, 
+                           XmScrollBarCallbackStruct *calld);
+
+void  scrollbar_action(Widget, XtPointer *usd, 
+                       XmScrollBarCallbackStruct *calld)
+{
+PIScrollBar *pis;
+
+pis = (PIScrollBar *) usd ;
+pis->CBSetVal(calld->value);
+pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value);
+return;
+}
+
+void  scrollbar_drag(Widget, XtPointer *usd, 
+                       XmScrollBarCallbackStruct *calld)
+{
+PIScrollBar *pis;
+
+pis = (PIScrollBar *) usd ;
+pis->CBSetVal(calld->value);
+pis->Send(pis->Msg(), PIMsg_Drag, (void *)calld->value);
+return;
+}
+
+/* --Methode-- */
+PIScrollBarX::PIScrollBarX(PIContainerGen *par, char *nom, PIMessage msg,
+                           bool vert, int sx, int sy, int px, int py)
+: PIScrollBarGen(par, nom, msg, vert, sx, sy, px, py)
+{
+int n=0;
+Arg warg[3];
+
+CreateXtWdg(nom, xmScrollBarWidgetClass, NULL, sx, sy, px, py);
+if (vert)
+  {
+  XtSetArg(warg[n], XmNorientation, XmVERTICAL); n++;
+  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_BOTTOM); n++;
+  }
+else
+  { 
+  XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
+  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
+  }
+XtSetValues(XtWdg(), warg, n);
+mAcD = false;
+mVal = -1;
+mMin = mMax = 0;
+mSz = 0;
+SetMinMax(0, 100);
+SetSize(10);
+SetValue(0);
+XtAddCallback(XtWdg(), XmNvalueChangedCallback, 
+              scrollbar_action, (XtPointer)this);
 Manage();
 }
 
-
-/* --Methode-- */
-PICheckBoxX::~PICheckBoxX()
+/* --Methode-- */
+PIScrollBarX::~PIScrollBarX()
 {}
 
 
 /* --Methode-- */
-void PICheckBoxX::SetState(bool st)
-{
-Arg warg[2];
-XtSetArg(warg[0],XmNset, st);
-XtSetValues(XtWdg(), warg, 1);
-return;
-}
-
-/* --Methode-- */
-bool PICheckBoxX::GetState()
+void PIScrollBarX::ActivateDrag(bool acd)
+{
+if (mAcD == acd)  return; 
+    
+if (mAcD)
+  XtRemoveCallback(XtWdg(), XmNdragCallback, 
+                   scrollbar_drag, (XtPointer)this);
+else 
+  XtAddCallback(XtWdg(), XmNdragCallback, 
+                scrollbar_drag, (XtPointer)this);
+mAcD = acd;
+return;
+}       
+
+/* --Methode-- */
+void PIScrollBarX::SetMinMax(int min, int max)
+{
+if (min >= max)  max = min+100;
+if (mVal < min)  mVal = min;
+if (mVal > max)  mVal = max;
+int n=0;
+Arg warg[3];
+XtSetArg(warg[n], XmNminimum, min); n++;
+XtSetArg(warg[n], XmNmaximum, max); n++;
+XtSetArg(warg[n], XmNvalue, mVal); n++;
+XtSetValues(XtWdg(), warg, n);
+mMin = min;   mMax = max;
+return;
+}
+
+
+/* --Methode-- */
+void PIScrollBarX::SetValue(int val)
+{
+int n=0;
+if (val < mMin)  val = mMin;
+if (val > mMax)  val = mMax;
+Arg warg[2];
+XtSetArg(warg[n], XmNvalue, val); n++;
+XtSetValues(this->sdw, warg, n);
+mVal = val;
+return;
+}
+
+/* --Methode-- */
+int  PIScrollBarX::GetValue()
 {
 int val;
-Arg warg[2];
-XtSetArg(warg[0], XmNset, &val); 
-XtGetValues(XtWdg(), warg, 1);
-return ((bool)val);
-}
+int n=0;
+Arg warg[2];
+XtSetArg(warg[n], XmNvalue, &val); n++;
+XtGetValues(this->sdw, warg, n);
+mVal = val;
+return(mVal);
+}
+
+/* --Methode-- */
+void PIScrollBarX::SetSize(int sz)
+{
+int n=0;
+Arg warg[3];
+int szl;
+
+szl = mMax-mMin;
+if (sz > szl)  sz = szl;
+szl /= 100;
+if (szl < 1)  szl = 1;
+if (sz < szl)  sz = szl;
+szl = sz/10;
+if (szl < 1)  szl = 1;
+XtSetArg(warg[n], XmNsliderSize, sz); n++;
+XtSetArg(warg[n], XmNpageIncrement, sz); n++;
+XtSetArg(warg[n], XmNincrement, szl); n++;
+XtSetValues(this->sdw, warg, n);
+mSz = sz;
+return;
+}
+
+/* --Methode-- */
+int  PIScrollBarX::GetSize()
+{
+int sz;
+int n=0;
+Arg warg[2];
+XtSetArg(warg[n], XmNsliderSize, &sz); n++;
+XtGetValues(this->sdw, warg, n);
+mSz = sz;
+return(mSz);
+}
+
+
+/* --Methode-- */
+void  PIScrollBarX::CBSetVal(int val)
+{
+mVal = val;
+return;
+}
+
Index: trunk/SophyaPI/PI/pistdwdgx.h
===================================================================
--- trunk/SophyaPI/PI/pistdwdgx.h	(revision 29)
+++ trunk/SophyaPI/PI/pistdwdgx.h	(revision 30)
@@ -10,5 +10,5 @@
                      PILabelX(PIContainerGen *par, char *nom,
                                  int sx=10, int sy=10, int px=0, int py=0);
-  virtual           ~PILabelX();
+  virtual            ~PILabelX();
   
 };
@@ -21,5 +21,5 @@
                                int sx=10, int sy=10, int px=0, int py=0,
                                PIBtnSign bsgn = PIBtn_Label);
-  virtual           ~PIButtonX();
+  virtual            ~PIButtonX();
 
   virtual void       ActivatePress(bool acp=false);
@@ -39,5 +39,5 @@
                      PITextX(PIContainerGen *par, char *nom, 
                                   int sx=10, int sy=10, int px=0, int py=0);
-  virtual           ~PITextX();
+  virtual            ~PITextX();
   virtual void       SetText(string const&);
   virtual string     GetText() const;
@@ -49,20 +49,4 @@
 };
 
-class PIScaleX : public PIScaleGen
-{
-public:
-  PIScaleX(PIContainerGen* par, char* nom, PIMessage msg=PIMsg_Click,
-         int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
-  ~PIScaleX();
-
-  virtual void SetMinMax(int min, int max);
-  virtual void SetValue(int val);
-  virtual int  GetValue(); 
-
-  virtual void CBSetVal(int val);   // A ne pas utiliser pour Callback
-protected: 
-  int mVal, mMin, mMax;
-};
-
 
 class PICheckBoxX : public PICheckBoxGen
@@ -72,5 +56,5 @@
                                  PIMessage msg=PIMsg_Click,
                                  int sx=10, int sy=10, int px=0, int py=0);
-  virtual           ~PICheckBoxX();
+  virtual            ~PICheckBoxX();
 
   virtual void       SetState(bool st=false);
@@ -79,9 +63,53 @@
 
 
+
+class PIScaleX : public PIScaleGen
+{
+public:
+                     PIScaleX(PIContainerGen* par, char* nom, 
+                              PIMessage msg=PIMsg_DataChanged, bool horiz=true,
+                              int sx=100, int sy=10, int px=0, int py=0);
+  virtual            ~PIScaleX();
+
+  virtual void       SetMinMax(int min, int max);
+  virtual void       SetValue(int val);
+  virtual int        GetValue(); 
+
+  virtual void       CBSetVal(int val);   // A ne pas utiliser (pour Callback Xt)
+protected: 
+  int mVal, mMin, mMax;
+};
+
+
+
+class PIScrollBarX : public PIScrollBarGen
+{
+public:
+                     PIScrollBarX(PIContainerGen* par, char* nom, 
+                                  PIMessage msg = PIMsg_DataChanged, bool vert=true,
+                                  int sx=10, int sy=100, int px=0, int py=0);
+                     ~PIScrollBarX();
+
+  virtual void       ActivateDrag(bool acd=false);
+  virtual void       SetMinMax(int min, int max);
+  virtual void       SetValue(int val);
+  virtual int        GetValue(); 
+  virtual void       SetSize(int sz);
+  virtual int        GetSize();
+
+  virtual void       CBSetVal(int val);   // A ne pas utiliser (pour Callback Xt)
+
+protected: 
+  int mVal, mMin, mMax, mSz;
+  bool mAcD;
+};
+
+
 typedef PILabelX       PILabel;
 typedef PIButtonX      PIButton;
 typedef PITextX        PIText;
+typedef PICheckBoxX    PICheckBox;
 typedef PIScaleX       PIScale;
-typedef PICheckBoxX    PICheckBox;
+typedef PIScrollBarX   PIScrollBar;
 
 
Index: trunk/SophyaPI/PI/pisysdep.h
===================================================================
--- trunk/SophyaPI/PI/pisysdep.h	(revision 29)
+++ trunk/SophyaPI/PI/pisysdep.h	(revision 30)
@@ -12,5 +12,6 @@
   #define PIOPTMENU_H "pioptmenumac.h"
   #define PIFILECHO_H "pifilechomac.h"
-  #define PIPERIOD_H "piperiodmac.h"
+  #define PILIST_H "pilistmac.h"
+
   #define PIAPP_H "piapplmac.h"
   
@@ -31,5 +32,6 @@
   #define PIOPTMENU_H "pioptmenux.h"
   #define PIFILECHO_H "pifilechox.h"
-  #define PIPERIOD_H "piperiodx.h"
+  #define PILIST_H "pilistx.h"
+
   #define PIAPP_H "piapplx.h"
 
Index: trunk/SophyaPI/PI/piwindowgen.cc
===================================================================
--- trunk/SophyaPI/PI/piwindowgen.cc	(revision 29)
+++ trunk/SophyaPI/PI/piwindowgen.cc	(revision 30)
@@ -8,4 +8,5 @@
 {
   SetMsgParent(par);
+  AutoHideOnClose();
 }
 
@@ -22,5 +23,5 @@
 {
 
-if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this)) 
+if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this) && mAHC) 
   Hide();   // Action par defaut en cas de MsgClose.
 
Index: trunk/SophyaPI/PI/piwindowgen.h
===================================================================
--- trunk/SophyaPI/PI/piwindowgen.h	(revision 29)
+++ trunk/SophyaPI/PI/piwindowgen.h	(revision 30)
@@ -22,8 +22,11 @@
   virtual long      kind() {return ClassId; }
 
+  inline  void      AutoHideOnClose(bool ahc=true) { mAHC = ahc; }
+
   virtual void      Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
   
 protected:  
   PIWindowKind	       mWtyp;
+  bool                 mAHC;
 };
 
