Changeset 30 in Sophya


Ignore:
Timestamp:
Nov 1, 1996, 8:14:18 PM (29 years ago)
Author:
ansari
Message:

Nouveaux Objets : PIScrollBar et PIList
Nouvelles methodes PIColorMap::GetColor() Et PIWindow::AutoHideOnClose()
Reza 1 Nov 96

Location:
trunk/SophyaPI/PI
Files:
4 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r27 r30  
    11CC := gcc
    22CXX := g++
    3 # General setup GNU Makefile for EROS. To be included in all makefiles. 
    4 # Define  makefile variables according to CPU
    5 # MACHEROSD = `uname | sed 's/-//'`   i.e. { AIX HPUX OSF1 ULTRIX }
    6 #
    7 # Makefile variables set are:
    8 # - Path to Exec, Include, Libs, Obj directories (from EROSBASEREP env. var.)
    9 #     i.e. variables LIB, OBJ, EXE, INC
    10 #---------------------------------------------------------------------------
    11 
    12 # define MACHEROS from uname
    13 MACHEROS := $(shell echo `uname`)
    14 # define the -D option
    15 MACHEROSD := $(shell echo `uname | sed 's/-//'`)
    16 
    17 #-
    18 #-     Optimization option different for HP...
    19 ifeq (${MACHEROS},HP-UX)
    20   O := +O
    21 else
    22   O := -O
    23 endif
    24 #-
    25 #-   Define Makefile paths
    26 #- 
    27  PP  := ${EROSBASEREP}/${MACHEROS}/
    28  LIB := ${PP}/Libs/
    29  SLB := ${PP}/ShLibs/
    30  OBJ := ${PP}/Objs/
    31  EXE := ${PP}/Exec/
    32  INC := ${EROSBASEREP}/Include/
    33  CCI := ${INC}/CInc/
    34  CXI := ${INC}/CxxInc/
    35  GLB := ${GNU}/${MACHEROS}/lib/
    36 #--
    37 
    38 #-
    39 #-    Define default compilation flags
    40 #--
    41 ifeq (${MACHEROS},HP-UX)                                   
    42   CFLAGS   :=  -Aa
    43   FFLAGS   :=  -Aa -I${INC} -D${MACHEROSD} 
    44   CPPFLAGS :=  -I${INC} -D${MACHEROSD} \
    45                -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE
    46 else
    47   FFLAGS   :=  -I${INC} -D${MACHEROSD} 
    48   CFLAGS       := -g -O -Wall -Wpointer-arith \
    49                 -Wmissing-prototypes -Wsynth -I$(INC)
    50   CXXFLAGS     := $(CFLAGS) -I$(CXI)
    51 endif
    52 AR       := /usr/bin/ar
    53 ARFLAGS  := -rcs
    54 
    55 
    56 ifeq ($(CC), gcc)
    57 CFLAGS       := -g -O -Wall -Wpointer-arith \
    58                 -Wmissing-prototypes -Wsynth -I$(INC)
    59 //CXXFLAGS     := $(CFLAGS) -fno-implicit-templates -I$(CXI)
    60 CXXFLAGS     := $(CFLAGS) -I$(CXI)
    61 endif
    62 
    63 #- redefine implicit rule. Les .o sont dans $(OBJ).
    64 $(OBJ)%.o:%.c
    65         $(COMPILE.c) -o $@ $<
    66 
    67 $(OBJ)%.o:%.cc
    68         $(COMPILE.cc) -o $@ $<
    69 
    70 $(OBJ)%.o:%.f
    71         $(COMPILE.f) -o $@ $<
    72 
    73 #OSF1
    74 #LDFC est f77
    75 #LDFCFLAGS est rien
    76 
    77 #parfois
    78 #LDFC est cc
    79 #LDFCFLAGS est -ltruc
    80 
    81 #------------------------------------------------- End of Makefile.h -------
     3include ../Mgr/Makefile.h
    824 
    83 all: $(LIB)libPI.a 
    84 $(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
     5all: $(LIB)libPI.a
     6$(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
    857        $(AR) $(ARFLAGS)  $@ $?
    868 
    87 $(OBJ)piapplgen.o: ./piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
     9$(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
    8810 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
    8911 pimenubargen.h pimenux.h pimenugen.h
    90 $(OBJ)piapplx.o: ./piapplx.cc piapplx.h piapplgen.h pimsghandler.h \
    91  pisysdep.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    92  pimenubarx.h pimenubargen.h pimenux.h pimenugen.h
    93 $(OBJ)pibwdggen.o: ./pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
     12$(OBJ)piapplx.o: piapplx.cc piapplx.h piapplgen.h pimsghandler.h pisysdep.h \
     13 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
     14 pimenubargen.h pimenux.h pimenugen.h
     15$(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
    9416 pimsghandler.h
    95 $(OBJ)pibwdgx.o: ./pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
     17$(OBJ)pibwdgx.o: pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
    9618 piwdggen.h pimsghandler.h pixtbaseP.h pixtbase.h
    97 $(OBJ)picmap.o: ./picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
    98 $(OBJ)picmapgen.o: ./picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
    99 $(OBJ)picmapx.o: ./picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
     19$(OBJ)picmap.o: picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
     20$(OBJ)picmapgen.o: picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
     21$(OBJ)picmapx.o: picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
    10022 picmapgen.h pisysdep.h
    101 $(OBJ)picontainergen.o: ./picontainergen.cc picontainergen.h pisysdep.h \
     23$(OBJ)picontainergen.o: picontainergen.cc picontainergen.h pisysdep.h \
    10224 piwdgx.h piwdggen.h pimsghandler.h
    103 $(OBJ)picontainerx.o: ./picontainerx.cc picontainerx.h pisysdep.h \
     25$(OBJ)picontainerx.o: picontainerx.cc picontainerx.h pisysdep.h \
    10426 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    105 $(OBJ)pidemo.o: ./pidemo.cc \
    106  $(INC)perrors.h \
    107  $(INC)exceptions.h \
    108  $(INC)defs.h \
    109  $(INC)fitsimage.h \
    110  $(INC)cimage.h \
    111  $(INC)rzimage.h \
    112  $(INC)rzvect.h \
    113  $(INC)machine.h \
    114  $(INC)datatypes.h \
    115  $(INC)fitsheader.h \
    116  $(INC)fitskeys.h pidemo.h \
    117  pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \
    118  picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \
    119  pimenux.h pimenugen.h piwindowx.h piwindowgen.h pioptmenux.h \
    120  pioptmenugen.h pistdwdgx.h pistdwdggen.h pifilechox.h pifilechogen.h \
    121  piimage.h $(INC)lut.h \
    122  pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
    123  picmapgen.h pihisto.h piscdrawwdg.h \
    124  $(INC)histos.h \
    125  $(INC)peida.h \
    126  $(INC)utils.h pidrawwin.h \
    127  $(INC)piup.h
    128 $(OBJ)pidrawwin.o: ./pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
     27$(OBJ)pidrawwin.o: pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
    12928 piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    130  pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h
    131 $(OBJ)pifilechogen.o: ./pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
     29 pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h pistdwdgx.h \
     30 pistdwdggen.h
     31$(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
    13232 piwdggen.h pimsghandler.h
    133 $(OBJ)pifilechox.o: ./pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
     33$(OBJ)pifilechox.o: pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
    13434 piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \
    13535 picontainerx.h picontainergen.h
    136 $(OBJ)pihisto.o: ./pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
    137  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
    138  $(INC)histos.h \
     36$(OBJ)pihisto.o: pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
     37 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     38 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
     39 picontainergen.h $(INC)histos.h \
    13940 $(INC)peida.h \
    14041 $(INC)defs.h \
     
    14243 $(INC)machine.h \
    14344 $(INC)perrors.h \
    144  $(INC)exceptions.h
    145 $(OBJ)piimage.o: ./piimage.cc piimage.h \
    146  $(INC)cimage.h \
     45 $(INC)exceptions.h \
     46 $(INC)peidainit.h
     47$(OBJ)piimage.o: piimage.cc piimage.h $(INC)cimage.h \
    14748 $(INC)rzimage.h \
    14849 $(INC)rzvect.h \
     
    15051 $(INC)defs.h \
    15152 $(INC)exceptions.h \
     53 $(INC)peidainit.h \
    15254 $(INC)perrors.h \
     55 $(INC)imaginit.h \
    15356 $(INC)datatypes.h \
    154  $(INC)lut.h pisysdep.h \
    155  pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \
     57 $(INC)lut.h pisysdep.h pipixmapx.h \
     58 pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \
    15659 pimsghandler.h picmap.h picmapx.h picmapgen.h pistdwdgx.h \
    157  pistdwdggen.h \
    158  $(INC)imageop.h \
     60 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
     61 picontainergen.h $(INC)imageop.h \
    15962 $(INC)fitsimage.h \
    16063 $(INC)fitsheader.h \
    161  $(INC)fitskeys.h
    162 $(OBJ)pimenubargen.o: ./pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
     64 $(INC)erosio.h \
     65 $(INC)fitskeys.h \
     66 $(INC)erostape.h \
     67 $(INC)strutil.h \
     68 $(INC)ptrarray.h \
     69 $(INC)voidptrarray.h \
     70 $(INC)basearray.h \
     71 $(INC)peida.h \
     72 $(INC)utils.h \
     73 $(INC)array.h \
     74 $(INC)lockfile.h \
     75 $(INC)erostarfile.h \
     76 $(INC)dates.h \
     77 $(INC)tarlib.h
     78$(OBJ)pilistgen.o: pilistgen.cc pilistgen.h pisysdep.h piwdgx.h piwdggen.h \
     79 pimsghandler.h
     80$(OBJ)pilistx.o: pilistx.cc pilistx.h pilistgen.h pisysdep.h piwdgx.h \
     81 piwdggen.h pimsghandler.h picontainerx.h picontainergen.h
     82$(OBJ)pimenubargen.o: pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
    16383 pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \
    16484 picontainerx.h picontainergen.h pimenubarx.h
    165 $(OBJ)pimenubarx.o: ./pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
     85$(OBJ)pimenubarx.o: pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
    16686 pimenux.h pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h \
    16787 piapplgen.h picontainerx.h picontainergen.h
    168 $(OBJ)pimenugen.o: ./pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
     88$(OBJ)pimenugen.o: pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
    16989 pimsghandler.h
    170 $(OBJ)pimenux.o: ./pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
     90$(OBJ)pimenux.o: pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
    17191 piwdggen.h pimsghandler.h
    172 $(OBJ)pimsghandler.o: ./pimsghandler.cc pimsghandler.h
    173 $(OBJ)pioptmenugen.o: ./pioptmenugen.cc pioptmenugen.h pisysdep.h \
     92$(OBJ)pimsghandler.o: pimsghandler.cc pimsghandler.h
     93$(OBJ)pioptmenugen.o: pioptmenugen.cc pioptmenugen.h pisysdep.h \
    17494 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
    17595 pimenux.h pimenugen.h
    176 $(OBJ)pioptmenux.o: ./pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
     96$(OBJ)pioptmenux.o: pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
    17797 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
    17898 pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h
    179 $(OBJ)pipixmapgen.o: ./pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
     99$(OBJ)piperiodx.o: piperiodx.cc piperiodx.h \
     100 $(INC)periodic.h
     101$(OBJ)pipixmapgen.o: pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
    180102 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
    181103 picmapgen.h
    182 $(OBJ)piperiodx.o: ./piperiodx.cc ./piperiodx.h $(INC)periodic.h
    183 $(OBJ)pipixmapx.o: ./pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
     104$(OBJ)pipixmapx.o: pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
    184105 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \
    185106 picmapx.h picmapgen.h
    186 $(OBJ)piscdrawwdg.o: ./piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
    187  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
    188  $(INC)generalfit.h \
     107$(OBJ)piscdrawwdg.o: piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
     108 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     109 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
     110 picontainergen.h $(INC)generalfit.h \
    189111 $(INC)exceptions.h \
    190112 $(INC)defs.h \
     113 $(INC)peidainit.h \
    191114 $(INC)matrix.h \
    192115 $(INC)peida.h \
     
    197120 $(INC)pclassids.h \
    198121 $(INC)cvector.h
    199 $(OBJ)pistdwdggen.o: ./pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
     122$(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
    200123 piwdggen.h pimsghandler.h
    201 $(OBJ)pistdwdgx.o: ./pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
     124$(OBJ)pistdwdgx.o: pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
    202125 piwdgx.h piwdggen.h pimsghandler.h
    203 $(OBJ)piwdggen.o: ./piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
     126$(OBJ)piup.o: piup.cc $(INC)ctimer.h \
     127 $(INC)peida.h \
     128 $(INC)defs.h \
     129 $(INC)utils.h \
     130 $(INC)machine.h \
     131 $(INC)perrors.h \
     132 $(INC)exceptions.h \
     133 $(INC)peidainit.h \
     134 $(INC)imageop.h \
     135 $(INC)cimage.h \
     136 $(INC)rzimage.h \
     137 $(INC)rzvect.h \
     138 $(INC)imaginit.h \
     139 $(INC)datatypes.h \
     140 $(INC)fitsimage.h \
     141 $(INC)fitsheader.h \
     142 $(INC)erosio.h \
     143 $(INC)fitskeys.h \
     144 $(INC)erostape.h \
     145 $(INC)strutil.h \
     146 $(INC)ptrarray.h \
     147 $(INC)voidptrarray.h \
     148 $(INC)basearray.h \
     149 $(INC)array.h \
     150 $(INC)lockfile.h \
     151 $(INC)erostarfile.h \
     152 $(INC)dates.h \
     153 $(INC)tarlib.h piup.h
     154$(OBJ)piwdggen.o: piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
    204155 pisysdep.h piwdgx.h
    205 $(OBJ)piwdgx.o: ./piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h \
    206  picontainerx.h pisysdep.h picontainergen.h
    207 $(OBJ)piwindowgen.o: ./piwindowgen.cc piwindowgen.h pisysdep.h \
     156$(OBJ)piwdgx.o: piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h picontainerx.h \
     157 pisysdep.h picontainergen.h
     158$(OBJ)piwindowgen.o: piwindowgen.cc piwindowgen.h pisysdep.h picontainerx.h \
     159 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
     160$(OBJ)piwindowx.o: piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
    208161 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    209 $(OBJ)piwindowx.o: ./piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
    210  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    211 $(OBJ)pixtbase.o: ./pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
     162$(OBJ)pixtbase.o: pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
    212163 piwdgx.h piwdggen.h pimsghandler.h pixtbase.h
  • trunk/SophyaPI/PI/picmapgen.h

    r2 r30  
    3636  string const& Nom() const {return mNom;}
    3737
     38  virtual PIColor GetColor(int n)=0;
    3839  virtual void AllocColor(PIColor const& col, int index)=0;
    3940  virtual void FreeColors()=0;     // Desalloue les couleurs
  • trunk/SophyaPI/PI/picmapx.cc

    r2 r30  
    1414int n = nCols[id-1];
    1515mColors = new PIXColor[n];
    16 for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     16mColRGB = new PIColor[n];
     17for(int i=0; i<n; i++) 
     18  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     19  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
    1720
    1821// printf("PIColorMapX::PIColorMapX(CMapId) %d %d \n", mNCol, Type());
     
    2730int n = nCols[id-1];
    2831mColors = new PIXColor[n];
    29 for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     32mColRGB = new PIColor[n];
     33for(int i=0; i<n; i++) 
     34  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     35  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
    3036// printf("PIColorMapX::PIColorMapX(CMapId, int) %d %d \n", mNCol, Type());
    3137
     
    4147int n = nCol;
    4248mColors = new PIXColor[n];
    43 for(int i=0; i<n; i++)  mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     49mColRGB = new PIColor[n];
     50for(int i=0; i<n; i++) 
     51  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     52  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
    4453// printf("PIColorMapX::PIColorMapX(nom, nCol) %d %d \n", mNCol, Type());
    4554
     
    5261{
    5362delete[] mColors;
     63delete[] mColRGB;
     64}
     65
     66
     67/* --Methode-- */
     68PIColor PIColorMapX::GetColor(int n)
     69{
     70PIColor picr;
     71picr.red = picr.green = picr.blue = 0;
     72
     73if ((n<0) || (n >= NCol()))   
     74  {
     75  PIColor picr;
     76  picr.red = picr.green = picr.blue = 0;
     77  return(picr);
     78  }
     79return(mColRGB[n]);
    5480}
    5581
     
    76102  {
    77103  mColors[index] = myxcol.pixel;
     104  mColRGB[index] = col;
    78105//  printf("PIColorMapX::AllocColor()  RGB= %d %d %d \n",
    79106//         (int) col.red, (int) col.blue, (int) col.green);
     
    103130
    104131for (int i=0; i<mNCol; i++) 
    105   mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     132  { mColors[i] = BlackPixel(PIXDisplay(), PIXScreen());
     133  mColRGB[i].red = mColRGB[i].green = mColRGB[i].blue = 0; }
    106134
    107135printf("PIColorMapX::FreeColors()  Type= %d mNCol= %d \n",
     
    114142{
    115143  CopyFromGen(x);
    116   for (int i=0; i<mNCol; i++)  mColors[i] = ((PIColorMapX *)x)->mColors[i];
     144  for (int i=0; i<mNCol; i++) 
     145    { mColors[i] = ((PIColorMapX *)x)->mColors[i];
     146    mColRGB[i] = ((PIColorMapX *)x)->mColRGB[i]; }
    117147}
  • trunk/SophyaPI/PI/picmapx.h

    r2 r30  
    1818    { return ((index < mNCol) ? mColors[index] : 0); } ;
    1919
     20  virtual PIColor GetColor(int n);
    2021  virtual void AllocColor(PIColor const& col, int index);
    2122  virtual void FreeColors();
     
    2526  void CopyFrom(PIColorMapGen*);
    2627 
    27   PIXColor  * mColors;     // La table des couleurs ...
     28  PIXColor  * mColors;     // La table des couleurs ...
     29  PIColor   * mColRGB;     // Composantes RGB 
    2830};
    2931
  • trunk/SophyaPI/PI/pimsghandler.h

    r23 r30  
    1818        PIMsg_DataChanged   = 21,
    1919        PIMsg_Click         = 22,
    20         PIMsg_Press         = 23
     20        PIMsg_Press         = 23,
     21        PIMsg_Drag          = 24,
     22
     23        PIMsg_Select        = 31,
     24        PIMsg_ClearSel      = 32
     25
    2126};
    2227
  • trunk/SophyaPI/PI/pistdwdggen.cc

    r23 r30  
    2626
    2727
    28 /************* PIScaleGen ************/
    29 
    30 PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg,
    31                        int /*min*/, int /*max*/, int sx, int sy, int px, int py)
    32 : PIWdg(par, nom, sx, sy, px, py)
    33 {
    34 SetMsg(msg);
    35 }
    36 
    37 PIScaleGen::~PIScaleGen()
    38 {}
    3928
    4029/************* PITextGen ************/
     
    6453
    6554
     55/************* PIScaleGen ************/
     56
     57PIScaleGen::PIScaleGen(PIContainerGen *par, char *nom, PIMessage msg,
     58                       bool /*horiz*/, int sx, int sy, int px, int py)
     59: PIWdg(par, nom, sx, sy, px, py)
     60{
     61SetMsg(msg);
     62}
     63
     64PIScaleGen::~PIScaleGen()
     65{}
     66
     67/************* PIScrollBarGen ************/
     68
     69PIScrollBarGen::PIScrollBarGen(PIContainerGen *par, char *nom, PIMessage msg,
     70                       bool /*horiz*/, int sx, int sy, int px, int py)
     71: PIWdg(par, nom, sx, sy, px, py)
     72{
     73SetMsg(msg);
     74}
     75
     76PIScrollBarGen::~PIScrollBarGen()
     77{}
     78
  • trunk/SophyaPI/PI/pistdwdggen.h

    r23 r30  
    1212                     PILabelGen(PIContainerGen* par, char* nom,
    1313                                 int sx=10, int sy=10, int px=0, int py=0);
    14   virtual           ~PILabelGen();
     14  virtual            ~PILabelGen();
    1515
    1616  virtual long       kind() {return ClassId; }
     
    3030                                 int sx=10, int sy=10, int px=0, int py=0,
    3131                                 PIBtnSign bsgn = PIBtn_Label);
    32   virtual           ~PIButtonGen();
     32  virtual            ~PIButtonGen();
    3333
    3434  virtual long       kind() {return ClassId; }
    35 
    3635  virtual void       ActivatePress(bool acp=false)=0;
    3736
     
    6059
    6160
     61
     62class PICheckBoxGen : public PIWdg
     63{
     64public:
     65
     66  enum {ClassId = 1030};
     67
     68                     PICheckBoxGen(PIContainerGen* par, char* nom,
     69                                  PIMessage msg = PIMsg_Click,
     70                                  int sx=10, int sy=10, int px=0, int py=0);
     71  virtual            ~PICheckBoxGen()=0;
     72  virtual void       SetState(bool st=false)=0;
     73  virtual bool       GetState()=0;
     74 
     75  virtual long       kind() {return ClassId; }
     76
     77protected:
     78
     79};
     80
     81
    6282class PIScaleGen : public PIWdg
    6383{
    6484public:
    65   enum {ClassId = 1030};
     85  enum {ClassId = 1040};
    6686
    6787                     PIScaleGen(PIContainerGen* par, char* nom,
    68                      PIMessage msg = PIMsg_Click,
    69                      int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
    70   ~PIScaleGen();
     88                                PIMessage msg = PIMsg_DataChanged, bool horiz=true,
     89                               int sx=100, int sy=10, int px=0, int py=0);
     90  virtual            ~PIScaleGen();
    7191
    7292  virtual void       SetMinMax(int min, int max) = 0;
     
    7898protected:
    7999
    80 
    81100};
    82101
    83 class PICheckBoxGen : public PIWdg
     102class PIScrollBarGen : public PIWdg
    84103{
    85104public:
     105  enum {ClassId = 1050};
    86106
    87   enum {ClassId = 1040};
     107                     PIScrollBarGen(PIContainerGen* par, char* nom,
     108                                    PIMessage msg=PIMsg_DataChanged, bool vert=true,
     109                                    int sx=10, int sy=100, int px=0, int py=0);
     110  virtual            ~PIScrollBarGen();
    88111
    89                      PICheckBoxGen(PIContainerGen* par, char* nom,
    90                                    PIMessage msg = PIMsg_Click,
    91                                    int sx=10, int sy=10, int px=0, int py=0);
    92   virtual           ~PICheckBoxGen()=0;
    93   virtual void      SetState(bool st=false)=0;
    94   virtual bool      GetState()=0;
    95  
     112  virtual void       ActivateDrag(bool acd=false) = 0;
     113  virtual void       SetMinMax(int min, int max) = 0;
     114  virtual void       SetValue(int val) = 0;
     115  virtual int        GetValue() = 0;
     116  virtual void       SetSize(int sz) = 0;
     117  virtual int        GetSize() = 0;
     118
    96119  virtual long       kind() {return ClassId; }
    97120
     
    100123};
    101124
    102 
    103 
    104125#endif
  • trunk/SophyaPI/PI/pistdwdgx.cc

    r23 r30  
    221221
    222222
     223/************* PICheckBoxX ************/
     224#include <Xm/ToggleB.h>
     225
     226// Fonction prive (CallBack)
     227static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld);
     228
     229/* Nouvelle-Fonction */
     230void  toggb_action(Widget , XtPointer *usd, XtPointer *)
     231{
     232PICheckBoxX *picb;
     233picb = (PICheckBoxX *) usd ;
     234picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState());
     235return;
     236}
     237
     238/* --Methode-- */
     239PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg,
     240                         int sx, int sy, int px, int py)
     241: PICheckBoxGen(par, nom, msg, sx, sy, px, py)
     242{
     243CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py);
     244XtAddCallback(XtWdg(), XmNvalueChangedCallback,
     245              toggb_action, (XtPointer)this);
     246Arg warg[2];
     247XtSetArg(warg[0],XmNhighlightThickness, 0);
     248XtSetValues(XtWdg(), warg, 1);
     249Manage();
     250}
     251
     252
     253/* --Methode-- */
     254PICheckBoxX::~PICheckBoxX()
     255{}
     256
     257
     258/* --Methode-- */
     259void PICheckBoxX::SetState(bool st)
     260{
     261Arg warg[2];
     262XtSetArg(warg[0],XmNset, st);
     263XtSetValues(XtWdg(), warg, 1);
     264return;
     265}
     266
     267/* --Methode-- */
     268bool PICheckBoxX::GetState()
     269{
     270int val;
     271Arg warg[2];
     272XtSetArg(warg[0], XmNset, &val);
     273XtGetValues(XtWdg(), warg, 1);
     274return ((bool)val);
     275}
     276
     277
    223278/************* PIScaleX ************/
    224279#include <Xm/Scale.h>
     
    241296/* --Methode-- */
    242297PIScaleX::PIScaleX(PIContainerGen *par, char *nom, PIMessage msg,
    243                    int min, int max, int sx, int sy, int px, int py)
    244 : PIScaleGen(par, nom, msg, min, max, sx, sy, px, py)
     298                   bool horiz, int sx, int sy, int px, int py)
     299: PIScaleGen(par, nom, msg, horiz, sx, sy, px, py)
    245300{
    246301int n=0;
     
    248303CreateXtWdg(nom, xmScaleWidgetClass, NULL, sx, sy, px, py);
    249304XtSetArg(warg[n], XmNshowValue, TRUE); n++;
    250 if (sx > sy)
     305if (horiz)
    251306  {
    252307  XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
     
    263318
    264319XtSetValues(XtWdg(), warg, n);
    265 SetMinMax(min, max);
    266 SetValue(min);
     320SetMinMax(1, 10);
     321SetValue(1);
    267322XtAddCallback(XtWdg(), XmNvalueChangedCallback,
    268323              scale_action, (XtPointer)this);
     
    312367XtGetValues(this->sdw, warg, n);
    313368mVal = val;
    314 return(val);
     369return(mVal);
    315370}
    316371
     
    322377}
    323378
    324 /************* PICheckBoxX ************/
    325 #include <Xm/ToggleB.h>
     379
     380
     381/************* PIScrollBarX ************/
     382
     383#include <Xm/ScrollBar.h>
    326384
    327385// Fonction prive (CallBack)
    328 static void toggb_action(Widget w, XtPointer *usd, XtPointer *calld);
    329 
    330 /* Nouvelle-Fonction */
    331 void  toggb_action(Widget , XtPointer *usd, XtPointer *)
    332 {
    333 PICheckBoxX *picb;
    334 picb = (PICheckBoxX *) usd ;
    335 picb->Send(picb->Msg(), PIMsg_DataChanged, (void *)picb->GetState());
    336 return;
    337 }
    338 
    339 /* --Methode-- */
    340 PICheckBoxX::PICheckBoxX(PIContainerGen *par, char *nom, PIMessage msg,
    341                          int sx, int sy, int px, int py)
    342 : PICheckBoxGen(par, nom, msg, sx, sy, px, py)
    343 {
    344 CreateXtWdg(nom, xmToggleButtonWidgetClass, NULL, sx, sy, px, py);
    345 XtAddCallback(XtWdg(), XmNvalueChangedCallback,
    346               toggb_action, (XtPointer)this);
    347 Arg warg[2];
    348 XtSetArg(warg[0],XmNhighlightThickness, 0);
    349 XtSetValues(XtWdg(), warg, 1);
     386static void scrollbar_action(Widget w, XtPointer *usd,
     387                             XmScrollBarCallbackStruct *calld);
     388static void scrollbar_drag(Widget w, XtPointer *usd,
     389                           XmScrollBarCallbackStruct *calld);
     390
     391void  scrollbar_action(Widget, XtPointer *usd,
     392                       XmScrollBarCallbackStruct *calld)
     393{
     394PIScrollBar *pis;
     395
     396pis = (PIScrollBar *) usd ;
     397pis->CBSetVal(calld->value);
     398pis->Send(pis->Msg(), PIMsg_DataChanged, (void *)calld->value);
     399return;
     400}
     401
     402void  scrollbar_drag(Widget, XtPointer *usd,
     403                       XmScrollBarCallbackStruct *calld)
     404{
     405PIScrollBar *pis;
     406
     407pis = (PIScrollBar *) usd ;
     408pis->CBSetVal(calld->value);
     409pis->Send(pis->Msg(), PIMsg_Drag, (void *)calld->value);
     410return;
     411}
     412
     413/* --Methode-- */
     414PIScrollBarX::PIScrollBarX(PIContainerGen *par, char *nom, PIMessage msg,
     415                           bool vert, int sx, int sy, int px, int py)
     416: PIScrollBarGen(par, nom, msg, vert, sx, sy, px, py)
     417{
     418int n=0;
     419Arg warg[3];
     420
     421CreateXtWdg(nom, xmScrollBarWidgetClass, NULL, sx, sy, px, py);
     422if (vert)
     423  {
     424  XtSetArg(warg[n], XmNorientation, XmVERTICAL); n++;
     425  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_BOTTOM); n++;
     426  }
     427else
     428  {
     429  XtSetArg(warg[n], XmNorientation, XmHORIZONTAL); n++;
     430  XtSetArg(warg[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++;
     431  }
     432XtSetValues(XtWdg(), warg, n);
     433mAcD = false;
     434mVal = -1;
     435mMin = mMax = 0;
     436mSz = 0;
     437SetMinMax(0, 100);
     438SetSize(10);
     439SetValue(0);
     440XtAddCallback(XtWdg(), XmNvalueChangedCallback,
     441              scrollbar_action, (XtPointer)this);
    350442Manage();
    351443}
    352444
    353 
    354 /* --Methode-- */
    355 PICheckBoxX::~PICheckBoxX()
     445/* --Methode-- */
     446PIScrollBarX::~PIScrollBarX()
    356447{}
    357448
    358449
    359450/* --Methode-- */
    360 void PICheckBoxX::SetState(bool st)
    361 {
    362 Arg warg[2];
    363 XtSetArg(warg[0],XmNset, st);
    364 XtSetValues(XtWdg(), warg, 1);
    365 return;
    366 }
    367 
    368 /* --Methode-- */
    369 bool PICheckBoxX::GetState()
     451void PIScrollBarX::ActivateDrag(bool acd)
     452{
     453if (mAcD == acd)  return;
     454   
     455if (mAcD)
     456  XtRemoveCallback(XtWdg(), XmNdragCallback,
     457                   scrollbar_drag, (XtPointer)this);
     458else
     459  XtAddCallback(XtWdg(), XmNdragCallback,
     460                scrollbar_drag, (XtPointer)this);
     461mAcD = acd;
     462return;
     463}       
     464
     465/* --Methode-- */
     466void PIScrollBarX::SetMinMax(int min, int max)
     467{
     468if (min >= max)  max = min+100;
     469if (mVal < min)  mVal = min;
     470if (mVal > max)  mVal = max;
     471int n=0;
     472Arg warg[3];
     473XtSetArg(warg[n], XmNminimum, min); n++;
     474XtSetArg(warg[n], XmNmaximum, max); n++;
     475XtSetArg(warg[n], XmNvalue, mVal); n++;
     476XtSetValues(XtWdg(), warg, n);
     477mMin = min;   mMax = max;
     478return;
     479}
     480
     481
     482/* --Methode-- */
     483void PIScrollBarX::SetValue(int val)
     484{
     485int n=0;
     486if (val < mMin)  val = mMin;
     487if (val > mMax)  val = mMax;
     488Arg warg[2];
     489XtSetArg(warg[n], XmNvalue, val); n++;
     490XtSetValues(this->sdw, warg, n);
     491mVal = val;
     492return;
     493}
     494
     495/* --Methode-- */
     496int  PIScrollBarX::GetValue()
    370497{
    371498int val;
    372 Arg warg[2];
    373 XtSetArg(warg[0], XmNset, &val);
    374 XtGetValues(XtWdg(), warg, 1);
    375 return ((bool)val);
    376 }
     499int n=0;
     500Arg warg[2];
     501XtSetArg(warg[n], XmNvalue, &val); n++;
     502XtGetValues(this->sdw, warg, n);
     503mVal = val;
     504return(mVal);
     505}
     506
     507/* --Methode-- */
     508void PIScrollBarX::SetSize(int sz)
     509{
     510int n=0;
     511Arg warg[3];
     512int szl;
     513
     514szl = mMax-mMin;
     515if (sz > szl)  sz = szl;
     516szl /= 100;
     517if (szl < 1)  szl = 1;
     518if (sz < szl)  sz = szl;
     519szl = sz/10;
     520if (szl < 1)  szl = 1;
     521XtSetArg(warg[n], XmNsliderSize, sz); n++;
     522XtSetArg(warg[n], XmNpageIncrement, sz); n++;
     523XtSetArg(warg[n], XmNincrement, szl); n++;
     524XtSetValues(this->sdw, warg, n);
     525mSz = sz;
     526return;
     527}
     528
     529/* --Methode-- */
     530int  PIScrollBarX::GetSize()
     531{
     532int sz;
     533int n=0;
     534Arg warg[2];
     535XtSetArg(warg[n], XmNsliderSize, &sz); n++;
     536XtGetValues(this->sdw, warg, n);
     537mSz = sz;
     538return(mSz);
     539}
     540
     541
     542/* --Methode-- */
     543void  PIScrollBarX::CBSetVal(int val)
     544{
     545mVal = val;
     546return;
     547}
     548
  • trunk/SophyaPI/PI/pistdwdgx.h

    r23 r30  
    1010                     PILabelX(PIContainerGen *par, char *nom,
    1111                                 int sx=10, int sy=10, int px=0, int py=0);
    12   virtual           ~PILabelX();
     12  virtual            ~PILabelX();
    1313 
    1414};
     
    2121                               int sx=10, int sy=10, int px=0, int py=0,
    2222                               PIBtnSign bsgn = PIBtn_Label);
    23   virtual           ~PIButtonX();
     23  virtual            ~PIButtonX();
    2424
    2525  virtual void       ActivatePress(bool acp=false);
     
    3939                     PITextX(PIContainerGen *par, char *nom,
    4040                                  int sx=10, int sy=10, int px=0, int py=0);
    41   virtual           ~PITextX();
     41  virtual            ~PITextX();
    4242  virtual void       SetText(string const&);
    4343  virtual string     GetText() const;
     
    4949};
    5050
    51 class PIScaleX : public PIScaleGen
    52 {
    53 public:
    54   PIScaleX(PIContainerGen* par, char* nom, PIMessage msg=PIMsg_Click,
    55          int min=0, int max=10, int sx=100, int sy=10, int px=0, int py=0);
    56   ~PIScaleX();
    57 
    58   virtual void SetMinMax(int min, int max);
    59   virtual void SetValue(int val);
    60   virtual int  GetValue();
    61 
    62   virtual void CBSetVal(int val);   // A ne pas utiliser pour Callback
    63 protected:
    64   int mVal, mMin, mMax;
    65 };
    66 
    6751
    6852class PICheckBoxX : public PICheckBoxGen
     
    7256                                 PIMessage msg=PIMsg_Click,
    7357                                 int sx=10, int sy=10, int px=0, int py=0);
    74   virtual           ~PICheckBoxX();
     58  virtual            ~PICheckBoxX();
    7559
    7660  virtual void       SetState(bool st=false);
     
    7963
    8064
     65
     66class PIScaleX : public PIScaleGen
     67{
     68public:
     69                     PIScaleX(PIContainerGen* par, char* nom,
     70                              PIMessage msg=PIMsg_DataChanged, bool horiz=true,
     71                              int sx=100, int sy=10, int px=0, int py=0);
     72  virtual            ~PIScaleX();
     73
     74  virtual void       SetMinMax(int min, int max);
     75  virtual void       SetValue(int val);
     76  virtual int        GetValue();
     77
     78  virtual void       CBSetVal(int val);   // A ne pas utiliser (pour Callback Xt)
     79protected:
     80  int mVal, mMin, mMax;
     81};
     82
     83
     84
     85class PIScrollBarX : public PIScrollBarGen
     86{
     87public:
     88                     PIScrollBarX(PIContainerGen* par, char* nom,
     89                                  PIMessage msg = PIMsg_DataChanged, bool vert=true,
     90                                  int sx=10, int sy=100, int px=0, int py=0);
     91                     ~PIScrollBarX();
     92
     93  virtual void       ActivateDrag(bool acd=false);
     94  virtual void       SetMinMax(int min, int max);
     95  virtual void       SetValue(int val);
     96  virtual int        GetValue();
     97  virtual void       SetSize(int sz);
     98  virtual int        GetSize();
     99
     100  virtual void       CBSetVal(int val);   // A ne pas utiliser (pour Callback Xt)
     101
     102protected:
     103  int mVal, mMin, mMax, mSz;
     104  bool mAcD;
     105};
     106
     107
    81108typedef PILabelX       PILabel;
    82109typedef PIButtonX      PIButton;
    83110typedef PITextX        PIText;
     111typedef PICheckBoxX    PICheckBox;
    84112typedef PIScaleX       PIScale;
    85 typedef PICheckBoxX    PICheckBox;
     113typedef PIScrollBarX   PIScrollBar;
    86114
    87115
  • trunk/SophyaPI/PI/pisysdep.h

    r18 r30  
    1212  #define PIOPTMENU_H "pioptmenumac.h"
    1313  #define PIFILECHO_H "pifilechomac.h"
    14   #define PIPERIOD_H "piperiodmac.h"
     14  #define PILIST_H "pilistmac.h"
     15
    1516  #define PIAPP_H "piapplmac.h"
    1617 
     
    3132  #define PIOPTMENU_H "pioptmenux.h"
    3233  #define PIFILECHO_H "pifilechox.h"
    33   #define PIPERIOD_H "piperiodx.h"
     34  #define PILIST_H "pilistx.h"
     35
    3436  #define PIAPP_H "piapplx.h"
    3537
  • trunk/SophyaPI/PI/piwindowgen.cc

    r23 r30  
    88{
    99  SetMsgParent(par);
     10  AutoHideOnClose();
    1011}
    1112
     
    2223{
    2324
    24 if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this))
     25if ((msg == BuildMsg(Msg(), PIMsg_Close)) && (sender == this) && mAHC)
    2526  Hide();   // Action par defaut en cas de MsgClose.
    2627
  • trunk/SophyaPI/PI/piwindowgen.h

    r23 r30  
    2222  virtual long      kind() {return ClassId; }
    2323
     24  inline  void      AutoHideOnClose(bool ahc=true) { mAHC = ahc; }
     25
    2426  virtual void      Process(PIMessage msg, PIMsgHandler* sender, void* data=NULL);
    2527 
    2628protected: 
    2729  PIWindowKind         mWtyp;
     30  bool                 mAHC;
    2831};
    2932
Note: See TracChangeset for help on using the changeset viewer.