Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro	(revision 51)
@@ -0,0 +1,349 @@
+; $Id$
+;
+; Copyright (c) 1992-1998, Research Systems, Inc.  All rights reserved.
+;	Unauthorized reproduction prohibited.
+;+
+; NAME:
+;	CW_BGROUP
+;
+; PURPOSE:
+;	CW_BGROUP is a compound widget that simplifies creating
+;	a base of buttons. It handles the details of creating the
+;	proper base (standard, exclusive, or non-exclusive) and filling
+;	in the desired buttons. Events for the individual buttons are
+;	handled transparently, and a CW_BGROUP event returned. This
+;	event can return any one of the following:
+;		- The Index of the button within the base.
+;		- The widget ID of the button.
+;		- The name of the button.
+;		- An arbitrary value taken from an array of User values.
+;
+; CATEGORY:
+;	Compound widgets.
+;
+; CALLING SEQUENCE:
+;		Widget = CW_BGROUP(Parent, Names)
+;
+;	To get or set the value of a CW_BGROUP, use the GET_VALUE and
+;	SET_VALUE keywords to WIDGET_CONTROL. The value of a CW_BGROUP
+;	is:
+;
+;		-----------------------------------------------
+;		Type		Value
+;		-----------------------------------------------
+;		normal		None
+;		exclusive   	Index of currently set button
+;		non-exclusive	Vector indicating the position
+;				of each button (1-set, 0-unset)
+;		-----------------------------------------------
+;
+;
+; INPUTS:
+;       Parent:		The ID of the parent widget.
+;	Names:		A string array, containing one string per button,
+;			giving the name of each button.
+;
+; KEYWORD PARAMETERS:
+;
+;	BUTTON_UVALUE:	An array of user values to be associated with
+;			each button and returned in the event structure.
+;	COLUMN:		Buttons will be arranged in the number of columns
+;			specified by this keyword.
+;	EVENT_FUNCT:	The name of an optional user-supplied event function 
+;			for buttons. This function is called with the return
+;			value structure whenever a button is pressed, and 
+;			follows the conventions for user-written event
+;			functions.
+;	EXCLUSIVE:	Buttons will be placed in an exclusive base, with
+;			only one button allowed to be selected at a time.
+;	FONT:		The name of the font to be used for the button
+;			titles. If this keyword is not specified, the default
+;			font is used.
+;	FRAME:		Specifies the width of the frame to be drawn around
+;			the base.
+;	IDS:		A named variable into which the button IDs will be
+;			stored, as a longword vector.
+;	LABEL_LEFT:	Creates a text label to the left of the buttons.
+;	LABEL_TOP:	Creates a text label above the buttons.
+;	MAP:		If set, the base will be mapped when the widget
+;			is realized (the default).
+;	NONEXCLUSIVE:	Buttons will be placed in an non-exclusive base.
+;			The buttons will be independent.
+;	NO_RELEASE:	If set, button release events will not be returned.
+;	RETURN_ID:	If set, the VALUE field of returned events will be
+;			the widget ID of the button.
+;	RETURN_INDEX:	If set, the VALUE field of returned events will be
+;			the zero-based index of the button within the base.
+;			THIS IS THE DEFAULT.
+;	RETURN_NAME:	If set, the VALUE field of returned events will be
+;			the name of the button within the base.
+;	ROW:		Buttons will be arranged in the number of rows
+;			specified by this keyword.
+;	SCROLL:		If set, the base will include scroll bars to allow
+;			viewing a large base through a smaller viewport.
+;	SET_VALUE:	The initial value of the buttons. This is equivalent
+;			to the later statement:
+;
+;			WIDGET_CONTROL, widget, set_value=value
+;
+;	SPACE:		The space, in pixels, to be left around the edges
+;			of a row or column major base. This keyword is
+;			ignored if EXCLUSIVE or NONEXCLUSIVE are specified.
+;	UVALUE:		The user value to be associated with the widget.
+;	XOFFSET:	The X offset of the widget relative to its parent.
+;	XPAD:		The horizontal space, in pixels, between children
+;			of a row or column major base. Ignored if EXCLUSIVE
+;			or NONEXCLUSIVE are specified.
+;	XSIZE:		The width of the base. 
+;	X_SCROLL_SIZE:	The width of the viewport if SCROLL is specified.
+;	YOFFSET:	The Y offset of the widget relative to its parent.
+;	YPAD:		The vertical space, in pixels, between children of
+;			a row or column major base. Ignored if EXCLUSIVE
+;			or NONEXCLUSIVE are specified.
+;	YSIZE:		The height of the base. 
+;	Y_SCROLL_SIZE:	The height of the viewport if SCROLL is specified.
+;
+; OUTPUTS:
+;       The ID of the created widget is returned.
+;
+; SIDE EFFECTS:
+;	This widget generates event structures with the following definition:
+;
+;		event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 }
+;
+;	The SELECT field is passed through from the button event. VALUE is
+;	either the INDEX, ID, NAME, or BUTTON_UVALUE of the button,
+;	depending on how the widget was created.
+;
+; RESTRICTIONS:
+;	Only buttons with textual names are handled by this widget.
+;	Bitmaps are not understood.
+;
+; MODIFICATION HISTORY:
+;	15 June 1992, AB
+;	7 April 1993, AB, Removed state caching.
+;	6 Oct. 1994, KDB, Font keyword is not applied to the label.
+;       10 FEB 1995, DJC  fixed bad bug in event procedure, getting
+;                         id of stash widget.
+;	11 April 1995, AB Removed Motif special cases.
+;-
+
+
+pro CW_BGROUP_SETV, id, value
+
+  ON_ERROR, 2						;return to caller
+
+  stash = WIDGET_INFO(id, /CHILD)
+  WIDGET_CONTROL, stash, GET_UVALUE=state, /NO_COPY
+
+  case state.type of
+    0: message,'unable to set plain button group value'
+    1: begin
+	  WIDGET_CONTROL, SET_BUTTON=0, state.ids[state.excl_pos]
+	  state.excl_pos = value
+	  WIDGET_CONTROL, /SET_BUTTON, state.ids[value]
+	end
+    2: begin
+	  n = n_elements(value)-1
+	  for i = 0, n do begin
+	    state.nonexcl_curpos[i] = value[i]
+	    WIDGET_CONTROL, state.ids[i], SET_BUTTON=value[i]
+	  endfor
+	end
+  endcase
+
+  WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
+end
+
+
+
+function CW_BGROUP_GETV, id, value
+
+   ON_ERROR, 2                  ;return to caller
+
+   stash = WIDGET_INFO(id, /CHILD)
+   WIDGET_CONTROL, stash, GET_UVALUE=state, /NO_COPY
+
+   case state.type of
+      0: message,'unable to get plain button group value'
+;    1: ret = state.excl_pos
+      1: ret = state.ret_arr[state.excl_pos]
+;    2: ret = state.nonexcl_curpos
+      2: BEGIN 
+         index = where(state.nonexcl_curpos NE 0)
+         if index[0] EQ -1 then begin
+            if size(state.ret_arr, /type) EQ 7 then ret = '' ELSE ret = -1
+         ENDIF ELSE ret = state.ret_arr[index]
+      END
+   endcase
+
+   WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
+
+   return, ret
+
+end
+
+
+
+function CW_BGROUP_EVENT, ev
+  WIDGET_CONTROL, ev.handler, GET_UVALUE=stash
+  WIDGET_CONTROL, stash, GET_UVALUE=state, /NO_COPY
+  WIDGET_CONTROL, ev.id, get_uvalue=uvalue
+
+  ret = 1			;Assume we return a struct
+  case state.type of
+    0:
+    1: if (ev.select eq 1) then begin
+	  state.excl_pos = uvalue
+	ENDIF else begin
+	  if (state.no_release ne 0) then ret = 0
+	ENDELSE
+    2: begin
+	  ; Keep track of the current state
+	  state.nonexcl_curpos[uvalue] = ev.select
+          if (state.no_release ne 0) and (ev.select eq 0) then ret = 0
+	end
+  endcase
+
+  if ret then begin		;Return a struct?
+      ret = { ID:state.base, TOP:ev.top, HANDLER:0L, SELECT:ev.select, $
+	       VALUE:state.ret_arr[uvalue] }
+      efun = state.efun
+      WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
+      if efun ne '' then return, CALL_FUNCTION(efun, ret) $
+      else return, ret
+  endif else begin		;Trash the event
+      WIDGET_CONTROL, stash, SET_UVALUE=state, /NO_COPY
+      return, 0
+  endelse
+end
+
+
+
+
+
+
+
+function CW_BGROUP, parent, names, $
+	BUTTON_UVALUE = button_uvalue, COLUMN=column, EVENT_FUNCT = efun, $
+	EXCLUSIVE=excl, FONT=font, FRAME=frame, IDS=ids, LABEL_TOP=label_top, $
+	LABEL_LEFT=label_left, MAP=map, $
+	NONEXCLUSIVE=nonexcl, NO_RELEASE=no_release, RETURN_ID=return_id, $
+	RETURN_INDEX=return_index, RETURN_NAME=return_name, $
+	ROW=row, SCROLL=scroll, SET_VALUE=sval, SPACE=space, UVALUE=uvalue, UNAME = uname, $
+	XOFFSET=xoffset, XPAD=xpad, XSIZE=xsize, X_SCROLL_SIZE=x_scroll_size,$
+	YOFFSET=yoffset, YPAD=ypad, YSIZE=ysize, Y_SCROLL_SIZE=y_scroll_size, $
+           _EXTRA = ex
+
+
+  IF (N_PARAMS() ne 2) THEN MESSAGE, 'Incorrect number of arguments'
+
+  ON_ERROR, 2						;return to caller
+
+  ; Set default values for the keywords
+  version = WIDGET_INFO(/version)
+  if (version.toolkit eq 'OLIT') then def_space_pad = 4 else def_space_pad = 3
+  IF (N_ELEMENTS(column) eq 0) 		then column = 0
+  IF (N_ELEMENTS(excl) eq 0) 		then excl = 0
+  IF (N_ELEMENTS(frame) eq 0)		then frame = 0
+  IF (N_ELEMENTS(map) eq 0)		then map=1
+  IF (N_ELEMENTS(nonexcl) eq 0)		then nonexcl = 0
+  IF (N_ELEMENTS(no_release) eq 0)	then no_release = 0
+  IF (N_ELEMENTS(row) eq 0)		then row = 0
+  IF (N_ELEMENTS(scroll) eq 0)		then scroll = 0
+  IF (N_ELEMENTS(space) eq 0)		then space = def_space_pad
+  IF (N_ELEMENTS(uvalue) eq 0)		then uvalue = 0
+  IF (N_ELEMENTS(uname) eq 0)		then uname = ' '
+  IF (N_ELEMENTS(xoffset) eq 0)		then xoffset=0
+  IF (N_ELEMENTS(xpad) eq 0)		then xpad = def_space_pad
+  IF (N_ELEMENTS(xsize) eq 0)		then xsize = 0
+  IF (N_ELEMENTS(x_scroll_size) eq 0)	then x_scroll_size = 0
+  IF (N_ELEMENTS(yoffset) eq 0)		then yoffset=0
+  IF (N_ELEMENTS(ypad) eq 0)		then ypad = def_space_pad
+  IF (N_ELEMENTS(ysize) eq 0)		then ysize = 0
+  IF (N_ELEMENTS(y_scroll_size) eq 0)	then y_scroll_size = 0
+  
+
+
+
+  top_base = 0L
+  if (n_elements(label_top) ne 0) then begin
+    next_base = WIDGET_BASE(parent, XOFFSET=xoffset, YOFFSET=yoffset, /COLUMN, _EXTRA = ex)
+    if(keyword_set(font))then $
+       junk = WIDGET_LABEL(next_base, value=label_top,font=font) $
+    else    junk = WIDGET_LABEL(next_base, value=label_top)
+    top_base = next_base
+  endif else next_base = parent
+  if (n_elements(label_left) ne 0) then begin
+    next_base = WIDGET_BASE(next_base, XOFFSET=xoffset, YOFFSET=yoffset, /ROW, _EXTRA = ex)
+    if(keyword_set(font))then $
+       junk = WIDGET_LABEL(next_base, value=label_left, font=font) $
+    else junk = WIDGET_LABEL(next_base, value=label_left)
+    if (top_base eq 0L) then top_base = next_base
+  endif
+  ; We need some kind of outer base to hold the users UVALUE
+  if (top_base eq 0L) then begin
+    top_base = WIDGET_BASE(parent, XOFFSET=xoffset, YOFFSET=yoffset, _EXTRA = ex)
+    next_base = top_base
+  endif
+  If (top_base EQ next_base) THEN $
+     next_base = WIDGET_BASE(top_base, Xpad=1, Ypad=1, Space=1, _EXTRA = ex)
+
+  ; Set top level base attributes
+  WIDGET_CONTROL, top_base, MAP=map, $
+	FUNC_GET_VALUE='CW_BGROUP_GETV', PRO_SET_VALUE='CW_BGROUP_SETV', $
+	SET_UVALUE=uvalue, SET_UNAME = uname
+
+  ; The actual button holding base
+  base = WIDGET_BASE(next_base, COLUMN=column, EXCLUSIVE=excl, FRAME=frame, $
+	NONEXCLUSIVE=nonexcl, ROW=row, SCROLL=scroll, SPACE=space, $
+	XPAD=xpad, XSIZE=xsize, X_SCROLL_SIZE=x_scroll_size, $
+	YPAD=ypad, YSIZE=ysize, Y_SCROLL_SIZE=y_scroll_size, $
+	EVENT_FUNC='CW_BGROUP_EVENT', _EXTRA = ex, $
+	UVALUE=WIDGET_INFO(top_base, /child))
+
+
+  n = n_elements(names)
+  ids = lonarr(n)
+  for i = 0, n-1 do begin
+    if (n_elements(font) eq 0) then begin
+      ids[i] = WIDGET_BUTTON(base, value=names[i], UVALUE=i)
+    endif else begin
+      ids[i] = WIDGET_BUTTON(base, value=names[i], FONT=font, UVALUE=i)
+    endelse
+  endfor
+
+  ; Keep the state info in the real (inner) base UVALUE.
+  ; Pick an event value type:
+  ;	0 - Return ID
+  ;	1 - Return INDEX
+  ;	2 - Return NAME
+  ret_type = 1
+  if KEYWORD_SET(RETURN_ID) then ret_type = 0
+  if KEYWORD_SET(RETURN_NAME) then ret_type = 2
+  if KEYWORD_SET(BUTTON_UVALUE) then ret_type = 3
+    case ret_type of
+      0: ret_arr = ids
+      1: ret_arr = indgen(n)
+      2: ret_arr = names
+      3: ret_arr = button_uvalue
+    endcase
+  type = 0
+  if (excl ne 0) then type = 1
+
+  if (nonexcl ne 0) then type = 2
+  if n_elements(efun) le 0 then efun = ''
+  state = { type:type, $	; 0-Standard, 1-Exclusive, 2-Non-exclusive
+	    base: top_base, $	; cw_bgroup base...
+	    ret_arr:ret_arr, $	; Vector of event values
+	    efun : efun, $	; Name of event fcn
+	    nonexcl_curpos:intarr(n), $	; If non-exclus, tracks state
+	    excl_pos:0, $			; If exclusive, current button
+	    ids:ids, $			; Ids of buttons
+	    no_release:no_release }
+  WIDGET_CONTROL, WIDGET_INFO(top_base, /CHILD), SET_UVALUE=state, /NO_COPY
+
+  if (n_elements(sval) ne 0) then CW_BGROUP_SETV, top_base, sval
+
+  return, top_base
+END
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro	(revision 51)
@@ -0,0 +1,265 @@
+; IDL> testwid,julday(1,1,1980)+lindgen(100)*5
+;
+PRO testwid_event, event
+    DroplistId = widget_info(event.top,find_by_uname = 'c''est lui')
+   widget_control, event.id, get_uvalue=uval
+   if n_elements(uval) EQ 0 then return
+   case uval of
+      'done':widget_control, event.top, /destroy
+      'set':BEGIN 
+         widget_control, event.id, get_value = value
+         widget_control, DroplistId, set_value = value
+      END
+      'get':BEGIN 
+         widget_control, DroplistId, get_value = value
+         help,  value, /struct
+      END
+      ELSE:
+   endcase
+   return
+end
+PRO testwid, calendar, date0, _extra = ex
+   base=widget_base(/COLUMN)
+print, 'base=', base
+   nothing = widget_label(base, value = 'beginning of the test')
+;
+   nothing = cw_calendar(base,calendar, date0, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui' )
+print, 'cw_calendar ID =', nothing
+;
+   nothing = widget_label(base, value = 'end of the test')
+    nothing = widget_text(base, value = string(calendar[0]), uvalue = 'set', /editable)
+    nothing = widget_button(base, value = 'get', uvalue = 'get')
+    nothing = widget_button(base, value = 'done', uvalue = 'done')
+   widget_control, base, /REALIZE
+   xmanager,'testwid', base
+   return
+END
+;
+;
+;
+PRO cw_calendar_set_value, id, value
+   possiblecase = ['day', 'month', 'year', 'century']
+   name = 0
+   repeat begin
+      wid_id = widget_info(id,find_by_uname = possiblecase[name])
+      name = name+1
+   endrep until wid_id NE 0
+   widget_control,wid_id, get_uvalue=wid_uvalue
+   value = long(value[0])
+   year = value/10000l & month = (value-year*10000l)/100L & day = value-year*10000l-month*100L
+   if year EQ 0 then year = -1 & if month EQ 0 then month = 6 & if day EQ 0 then day = 15
+   julianvalue = julday(month, day, year)
+   if (where(wid_uvalue.calendar EQ julianvalue))[0] EQ - 1 then return
+   for name = 3, 0, -1 do BEGIN
+      if widget_info(id,find_by_uname = possiblecase[name]) NE 0  then $
+         set_droplist, {handler:id, out:2}, possiblecase[name], value
+   endfor
+   return
+end
+;----------------------------------------------------------------------
+FUNCTION cw_calendar_get_value, id
+   possiblecase = ['day', 'month', 'year', 'century']
+   name = 0
+   repeat begin
+      wid_id = widget_info(id,find_by_uname = possiblecase[name])
+      name = name+1
+   endrep until wid_id NE 0
+   widget_control,wid_id, get_uvalue=wid_uvalue
+   caldat, wid_uvalue.calendar,monthcal,daycal,yearcal
+   centurycal = yearcal/100L
+   if n_elements(centurycal[uniq(centurycal, sort(centurycal))]) NE 1 then $ 
+    yearcal = yearcal-centurycal*100
+   droplistname = ['day','month','year','century']
+   for name = 0, n_elements(droplistname)-1  do begin
+      nothing = execute('wid_id = widget_info(id,find_by_uname = '''+droplistname[name]+''')')
+      if wid_id NE 0 then begin
+         widget_control,wid_id, get_value=wid_value
+         widget_control,wid_id, get_uvalue=wid_uvalue
+         nothing = execute('array = '+droplistname[name]+'cal[wid_uvalue.index]')
+         nothing = execute(droplistname[name]+' = array[wid_value.droplist_select]')
+      ENDIF ELSE nothing = execute(droplistname[name]+'= 0')
+   ENDFOR
+   return, 10000L*(year+100L*century)+100L*month+day
+end
+;----------------------------------------------------------------------
+PRO set_droplist, event, casename, date0
+; casename: quel est le widget que l''on veut bouger: 'day', 'month',
+; 'year', 'century' ???
+   wid_id = widget_info(event.handler,find_by_uname = casename)
+   possiblecase = ['day', 'month', 'year', 'century']
+   whichcase = (where(possiblecase EQ casename))[0]
+; on recupere la uvalue attache au widget et qui nous donne ques sont
+; les 'day', 'month', 'year', 'century' en train d''etre traites et le
+; calendrier
+; on recuper ici le calendrier
+   widget_control,wid_id, get_uvalue=wid_uvalue
+   caldat, wid_uvalue.calendar,monthcal,daycal,yearcal
+   centurycal = yearcal/100
+; et la date courrante
+   if n_elements(date0) EQ 0 then date0 = cw_calendar_get_value(event.handler)
+   year0 = date0/10000l
+   century0 = year0/100
+   month0 = (date0-year0*10000l)/100L
+   day0 = date0-year0*10000l-month0*100L
+   if n_elements(centurycal[uniq(centurycal, sort(centurycal))]) NE 1 then BEGIN 
+      yearcal = yearcal-centurycal*100
+      year0   = year0  -centurycal*100
+   ENDIF
+; index: 'day', 'month', 'year', 'century' possibles pour la date donnee
+   case casename of
+      'day':index = where(monthcal EQ month0 AND yearcal EQ year0 AND centurycal EQ century0)
+      'month':index = where(yearcal EQ year0 AND centurycal EQ century0)
+      'year':index = where(centurycal EQ century0)
+      'century':index = uniq(centurycal, sort(long(centurycal)))
+   ENDCASE
+; current: liste des mois possibles par ex
+   nothing = execute('current = '+possiblecase[whichcase]+'cal[index]')
+; supprime les boublons
+   indexbis = uniq(current, sort(current))
+   index = index[indexbis];
+; nouvelle liste des possibilites offertes par la droplist (par ex
+; liste des mois possibles)
+   current = current[indexbis]
+; on accualise la uvalue du widget (par ex on met la nouvelle liste de
+; mois possibles)
+   widget_control, wid_id, set_uvalue = {name:wid_uvalue.name, calendar:wid_uvalue.calendar, index:index}
+;on met en place la nouvelle liste possible
+   widget_control, wid_id, get_value = oldselect
+   if casename EQ 'month' then begin
+      widget_control, wid_id, set_value = string(format='(C(CMoA))',31*(current-1))
+   ENDIF ELSE BEGIN 
+      widget_control, wid_id, set_value = strtrim(current, 1)
+  ENDELSE
+; quel est l''index qu'il faut selectionner parmis la nouvelle liste!
+   widget_control, wid_id, get_value = droplist
+   if event.out EQ 2 then BEGIN 
+    nothing = execute('widget_control, wid_id, set_value = {droplist_select:(where(current EQ '+casename+'0))[0]}') 
+   ENDIF ELSE widget_control, wid_id, set_value $
+    = {droplist_select:((droplist.droplist_number-1)*(event.out EQ -1)+oldselect.droplist_select*(event.out EQ 0)) < (droplist.droplist_number-1)}
+   return
+end
+;----------------------------------------------------------------------
+PRO move, event, casename
+   possiblecase = ['day', 'month', 'year', 'century', 'impossiblecase']
+   whichcase = (where(possiblecase EQ casename))[0]
+   id = widget_info(event.handler,find_by_uname = casename)
+   widget_control, id, get_value=wvalue
+   if wvalue.droplist_select EQ (wvalue.droplist_number-1)*(event.out EQ 1) THEN BEGIN
+      if casename EQ 'century' $
+       OR widget_info(event.handler,find_by_uname = possiblecase[whichcase+1]) EQ 0 then begin
+         widget_control, id, get_value=widvalue
+         widget_control, id, set_value={droplist_select:(widvalue.droplist_number-1)*(event.out EQ -1)}
+      ENDIF ELSE nothing = execute('move, event,'''+possiblecase[whichcase+1]+'''') 
+   ENDIF ELSE widget_control, id, set_value={droplist_select:wvalue.droplist_select+event.out}
+   nothing = execute('set_droplist, event,'''+possiblecase[whichcase-1]+'''')
+   return
+end
+;----------------------------------------------------------------------
+FUNCTION cw_calendar_event, event
+;help,  /struct, event
+   widget_control, event.id, get_uvalue=uval
+   possiblecase = ['day', 'month', 'year', 'century', 'impossiblecase']
+   whichcase = (where(possiblecase EQ uval.name))[0]
+   if event.out NE 0 then BEGIN ; we use the +/- button and we want to go out of the droplist:
+; to index -1 (event.out=-1) or to index droplist_number (event.out=1)
+; we try to move the droplist just right named possiblecase[whichcase+1]
+      if widget_info(event.handler,find_by_uname = possiblecase[whichcase+1]) EQ 0 then BEGIN
+; this widget do not exist we set cyclicly the current widget to the
+; value 0 if event.out=1 or droplist_number-1 if event.out=-1
+         widget_control, event.id, get_value=widvalue
+         widget_control, event.id, set_value={droplist_select:(widvalue.droplist_number-1)*(event.out EQ -1)}
+      ENDIF ELSE move, event, possiblecase[whichcase+1]
+   ENDIF
+   if uval.name NE 'day' then begin
+      event.out = 0
+      for name = whichcase-1, 0, -1 do begin
+         if widget_info(event.handler,find_by_uname = possiblecase[name]) NE 0 then $
+          set_droplist, event, possiblecase[name]
+      endfor
+   endif
+   return, {CW_CALENDAR, ID:event.handler, TOP:event.top, HANDLER:0L $
+            , VALUE:cw_calendar_get_value(event.handler)}
+end
+;----------------------------------------------------------------------
+FUNCTION cw_calendar, parent, calendar, date0, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex
+; cheking for row and column keywords
+   column = keyword_set(column)*(1-keyword_set(row))
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 
+; liste des mois, jours annee disponibles ds le calendrier
+   caldat, calendar,monthcal,daycal,yearcal
+   centurycal = yearcal/100
+; date de depart
+   if n_elements(date0) EQ 0 then date0 = calendar[0]
+   if (where(calendar EQ date0))[0] EQ -1 then date0 = calendar[0]
+   caldat, date0,month0,day0,year0
+   century0 = year0/100
+; test du type de calendrier
+   if n_elements(calendar) GT 1 then begin
+      if total(daycal eq 15) EQ n_elements(calendar) then monthly = 1
+   if total(monthcal EQ 6) EQ n_elements(calendar) AND n_elements(uniq(daycal, sort(daycal))) EQ 1 then BEGIN  & monthly = 1 & yearly = 1 & endif
+   if total(yearcal EQ 50) EQ n_elements(calendar) then BEGIN  & monthly = 1 & yearly = 1 & centuryly = 1 & ENDIF
+   endif
+;---------------------------------------------------------------------------------------
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+   base = widget_base(parent, ROW = row, COLUMN = column  $
+                      , EVENT_FUNC = 'cw_calendar_event' $
+                      , FUNC_GET_VALUE='cw_calendar_get_value' $
+                      , PRO_SET_VALUE='cw_calendar_set_value' $
+                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
+;-------------day----------------
+   if NOT keyword_set(monthly)  then begin
+      dayindex = where(monthcal EQ month0 AND yearcal EQ year0 AND centurycal EQ century0)
+      currentday = daycal[dayindex]
+      currentday = string(currentday)
+      for i = 0, n_elements(currentday)-1 do currentday[i] = strtrim(currentday[i], 1)
+      rien = cw_droplist_pm(base,UVALUE = {name:'day', calendar:calendar, index:dayindex}, UNAME = 'day', value = currentday)
+      widget_control, rien, set_value = {droplist_select:(where(long(currentday) EQ day0))[0]}
+   endif
+;-------------month----------------
+   if NOT keyword_set(yearly)  then BEGIN
+; les mois du siecle en cours et de l''anne en cours
+      monthindex = where(yearcal EQ year0 AND centurycal EQ century0)
+      currentmonth = long(monthcal[monthindex])
+; on supprime les elements repetes
+      monthindexbis = uniq(currentmonth, sort(currentmonth))
+      monthindex = monthindex[monthindexbis]
+      currentmonth = currentmonth[monthindexbis]
+; on cree une droplist avec comme valeur tous les mois possibles de
+; l''annee courrante (year0)
+;       rien = cw_droplist_pm(base,UVALUE = {name:'month', calendar:calendar, index:monthindex}, UNAME = 'month', value = string(format='(C(CMoA))',31*indgen(12)))
+      rien = cw_droplist_pm(base,UVALUE = {name:'month', calendar:calendar, index:monthindex}, UNAME = 'month', value = string(format='(C(CMoA))',31*(currentmonth-1)))
+; on possitionne le mois courrant sur le bon mois parmis les mois
+; possibles de l''annee courrante
+      widget_control, rien, set_value = {droplist_select:(where(long(currentmonth) EQ month0))[0]}
+   endif
+;-------------year----------------
+   if NOT keyword_set(centuryly)  then begin
+      if n_elements(centurycal[uniq(centurycal, sort(centurycal))]) NE 1 then BEGIN 
+         yearcal = yearcal-centurycal*100
+         year0   = year0-centurycal*100
+      endif
+      yearindex = where(centurycal EQ century0)
+      currentyear = yearcal[yearindex]
+      yearindexbis = uniq(currentyear, sort(long(currentyear)))
+      yearindex = yearindex[yearindexbis]
+      currentyear = currentyear[yearindexbis]
+      currentyear = string(currentyear)
+      for i = 0, n_elements(currentyear)-1 do currentyear[i] = strtrim(currentyear[i], 1)
+      rien = cw_droplist_pm(base,UVALUE = {name:'year', calendar:calendar, index:yearindex}, UNAME = 'year', value = currentyear)
+      widget_control, rien, set_value = {droplist_select:(where(long(currentyear) EQ year0))[0]}
+   endif
+;-------------century----------------
+   centuryindex = uniq(centurycal, sort(long(centurycal)))
+   currentcentury = centurycal[centuryindex]
+   currentcentury = string(currentcentury)
+   for i = 0, n_elements(currentcentury)-1 do currentcentury[i] = strtrim(currentcentury[i], 1)
+   if n_elements(uniq(centurycal, sort(centurycal))) NE 1 then BEGIN
+      rien = cw_droplist_pm(base,UVALUE = {name:'century', calendar:calendar, index:centuryindex}, UNAME = 'century', value = currentcentury)
+      widget_control, rien, set_value = {droplist_select:(where(long(currentcentury) EQ century0))[0]}
+   endif
+;-----------------------------
+;
+;
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro	(revision 51)
@@ -0,0 +1,525 @@
+; IDL> testwid
+; PRO testwid_event, event
+; ; help,  event, /struct
+;    Id = widget_info(event.top,find_by_uname = 'c''est lui')
+;    widget_control, event.id, get_uvalue=uval
+;    if n_elements(uval) EQ 0 then return
+;    case uval of
+;       'done':widget_control, event.top, /destroy
+;       'set':BEGIN
+;          widget_control, event.id, get_value = value & value = value[0]
+;          nothing = execute('boxzoom ='+value)
+;          widget_control, Id, set_value = boxzoom
+;       END
+;       'get':BEGIN 
+;          widget_control, Id, get_value = value
+;          print,  value
+;       END
+;       ELSE:
+;    endcase
+;    return
+; end
+; PRO testwid, _extra = ex
+;    base=widget_base(/COLUMN)
+;    print, 'base=', base
+;    nothing = widget_label(base, value = 'beginning of the test')
+; ;
+;    nothing = cw_domain(base,_extra = ex, uname = 'c''est lui', uvalue = 'c''est lui')
+;    print, 'cw_domain ID =', nothing
+; ;
+;    nothing = widget_label(base, value = 'end of the test')
+;    nothing = widget_text(base, value = '[40, 100, -10, 10]', uvalue = 'set', /editable)
+;    nothing = widget_button(base, value = 'get', uvalue = 'get')
+;    nothing = widget_button(base, value = 'done', uvalue = 'done')
+;    widget_control, base, /REALIZE
+;    xmanager,'testwid', base
+;    return
+; end
+;
+;
+;*********************************************************************
+pro cw_domain_set_value, id, value
+@common
+;------------------------------------------------
+; quel est le type de boxzoom?
+   topid = findtopid(id)
+   widget_control, topid, get_uvalue=top_uvalue
+   currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1
+   options = extractatt(top_uvalue, 'options')   
+   flags = extractatt(top_uvalue, 'optionsflag')
+   flags = flags[*, currentplot]
+   IF (flags[where(options EQ 'Longitude / x index')])[0] EQ 0 THEN $
+    xtype = 'geographic' ELSE xtype = 'index'
+   IF (flags[where(options EQ 'Latitude / y index')])[0] EQ 0 THEN $
+    ytype = 'geographic' ELSE ytype = 'index'
+;------------------------------------------------
+; comment completer la boxzoom?
+   IF xtype EQ  'geographic' then begin
+      lonn1 = lon1
+      lonn2 = lon2
+      xtitle = 'lon'
+   ENDIF ELSE BEGIN
+      lonn1 = firstxt
+      lonn2 = lastxt
+      xtitle = 'x index'
+   ENDELSE
+   IF ytype EQ  'geographic' then begin
+      latt1 = lat1
+      latt2 = lat2
+      ytitle = 'lat'
+   ENDIF ELSE BEGIN
+      latt1 = firstyt
+      latt2 = lastyt
+      ytitle = 'y index'
+   ENDELSE
+;------------------------------------------------
+   vertf1 = floor(min([gdepw[0], gdept[0]]))
+   vertf2 = ceil(max([gdepw[0], gdept[0]]))
+;------------------------------------------------
+   Case N_Elements(Value) OF
+      0:boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2]
+      1:BEGIN 
+         if value EQ -1 then boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] $
+         ELSE boxzoom=[lonn1, lonn2, latt1, latt2, 0.,value[0]]
+      END
+      2:boxzoom=[lonn1, lonn2, latt1, latt2, value[0],value[1]]
+      4:boxzoom=[Value]
+      5:boxzoom=[Value[0:3], 0, Value[4]]
+      6:boxzoom = Value
+      Else:BEGIN 
+         rien = report('Mauvaise Definition de Boxzoom')
+      END
+   ENDCASE
+;------------------------------------------------
+   boxzoom[0] = floor(boxzoom[0])
+   boxzoom[1] = ceil(boxzoom[1])
+   boxzoom[2] = floor(boxzoom[2])
+   boxzoom[3] = ceil(boxzoom[3])
+   if n_elements(boxzoom GE 5) then begin
+      boxzoom[4] = floor(boxzoom[4])
+      boxzoom[5] = ceil(boxzoom[5])
+   endif
+;------------------------------------------------
+;------------------------------------------------
+   widget_control,widget_info(id,find_by_uname = 'lon1'), get_uvalue = uvalue
+   strict = uvalue.strict
+;
+; les longitudes
+;
+; min et max possible
+   if xtype EQ 'geographic' then BEGIN
+      min = floor(min([glamt,glamf], max = max))
+      max = ceil(max)
+   ENDIF ELSE BEGIN 
+      min = 0
+      max = jpi-1
+   ENDELSE
+; les id des widgets
+   lon1id = widget_info(id,find_by_uname = 'lon1')
+   lon2id = widget_info(id,find_by_uname = 'lon2')
+; doit-on changer de type d''axe x: longitude/index
+   lonbase = widget_info(id,find_by_uname = 'lonbase')
+   widget_control, lonbase,  get_uvalue = lonbase_uvalue
+   if lonbase_uvalue.name NE xtype then BEGIN
+      widget_control, lonbase, update = 0
+; on casse tout
+      widget_control, lon1id, /destroy
+      widget_control, lon2id, /destroy
+; on reconstruit
+      lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $
+                            , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $
+                            , title = xtitle+'1', minimum = min $
+                            , maximum = (boxzoom[1] < max)-keyword_set(strict))
+      lon2id = cw_slider_pm(lonbase,value=((min > boxzoom[0])+keyword_set(strict)) > boxzoom[1] < max $
+                            , uvalue={name:'lon2', strict:keyword_set(strict)} $
+                            , uname='lon2', title = xtitle+'2', maximum = max $
+                            , minimum = (min > boxzoom[0])+keyword_set(strict))
+      widget_control, lonbase, set_uvalue = {name:xtype}
+      widget_control, lonbase, update = 1
+   ENDIF ELSE BEGIN
+; la nouvelle valeur qu''ils vont avoir
+      cursorvalue1 = min > boxzoom[0] < ((boxzoom[1] < max)-strict)
+      cursorvalue2 = ((min > boxzoom[0])+strict) > boxzoom[1] < max
+; on change les bornes des slider
+      widget_control, lon1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict}
+      widget_control, lon2id, set_value = {slider_min:cursorvalue1+strict, slider_max:max}
+; on attribut la nouvelle valeur
+      widget_control, lon1id , set_value = cursorvalue1
+      widget_control, lon2id, set_value = cursorvalue2
+   ENDELSE
+;
+; les latitudes
+;
+; min et max possible
+   if ytype EQ 'geographic' then begin
+      min = floor(min([gphit,gphif], max = max))
+      max = ceil(max)
+   ENDIF ELSE BEGIN 
+      min = 0
+      max = jpj-1
+   ENDELSE
+; doit-on changer de type d''axe y: latitude/index
+   latbase = widget_info(id,find_by_uname = 'latbase')
+   widget_control, latbase,  get_uvalue = latbase_uvalue
+   lat1id = widget_info(id,find_by_uname = 'lat1')
+   lat2id = widget_info(id,find_by_uname = 'lat2')
+   if latbase_uvalue.name NE ytype then BEGIN
+      widget_control, latbase, update = 0
+      widget_control, lat1id, /destroy
+      widget_control, lat2id, /destroy
+      lat1id = cw_slider_pm(latbase,value=min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $
+                            , uvalue={name:'lat1', strict:keyword_set(strict)},uname ='lat1' $
+                            , title = ytitle+'1', minimum =min $
+                            , maximum = ((boxzoom[3] < max)-keyword_set(strict)))
+      lat2id = cw_slider_pm(latbase,value=((min > boxzoom[2])+keyword_set(strict)) > boxzoom[3] < max $
+                            , uvalue={name:'lat2', strict:keyword_set(strict)} $
+                            , uname ='lat2', title = ytitle+'2' ,maximum =  max $
+                            , minimum =(min > boxzoom[2])+keyword_set(strict))
+      widget_control, latbase, set_uvalue = {name:ytype}
+      widget_control, latbase, update = 1
+   ENDIF ELSE BEGIN
+      cursorvalue1 = min > boxzoom[2] < ((boxzoom[3] < max)-strict)
+      cursorvalue2 = ((min > boxzoom[2])+strict) > boxzoom[3] < max
+      widget_control, lat1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict}
+      widget_control, lat2id, set_value = {slider_min:cursorvalue1+strict, slider_max:max}
+      widget_control, lat1id, set_value = cursorvalue1
+      widget_control, lat2id, set_value = cursorvalue2
+   ENDELSE
+;
+;
+   if n_elements(boxzoom) EQ 4 then return
+;
+; la profondeur
+;
+   depthlev1id = widget_info(id,find_by_uname = 'depthlev1')
+   depthlev2id = widget_info(id,find_by_uname = 'depthlev2')
+   depth1id = widget_info(id,find_by_uname = 'depth1')
+   depth2id = widget_info(id,find_by_uname = 'depth2')
+   widget_control, depthlev1id, get_uvalue = depthlev1_uval
+; a-t-on change de type de grille ?, faut=il changerl''axe verticale?
+   widget_control, findtopid(id),  get_uvalue = top_uvalue
+   zgrid = extractatt(top_uvalue, 'zgrid')
+   grid_t = zgrid EQ 'T'
+   if grid_t NE depthlev1_uval.grid_t then BEGIN
+      widget_control, depthlev2id, get_uvalue = depthlev2_uval
+      depthlev1_uval.grid_t = grid_t
+      depthlev2_uval.grid_t = grid_t
+;
+      if grid_t then gdep = gdept ELSE gdep = gdepw
+      gdep1 = floor(gdep)
+      gdep2 = ceil(gdep)
+      identique = where(gdep2-gdep1 EQ 0)
+      if identique[0] NE -1 then gdep2[identique] = gdep2[identique] +1
+      depthlev1_uval.value = gdep1
+      depthlev2_uval.value = gdep2
+;
+      widget_control, depthlev1id, set_value = {value:strtrim(gdep1, 1)}
+      widget_control, depthlev2id, set_value = {value:strtrim(gdep2, 1)}
+;
+      widget_control, depthlev1id, set_uvalue = depthlev1_uval
+      widget_control, depthlev2id, set_uvalue = depthlev2_uval
+   ENDIF ELSE BEGIN 
+      gdep1 = depthlev1_uval.value
+      gdep2 = gdep1+1
+   ENDELSE
+; on s''assure que les profs donnees contiennent bien au moins un
+; niveau.
+   if boxzoom[4] GT boxzoom[5] then begin
+      rien = boxzoom[4]
+      boxzoom[4] = boxzoom[5]
+      boxzoom[5] = rien
+   endif
+; 
+   rien = where(gdep1 LT boxzoom[4], indice1)
+   indice1 = indice1 < (jpk-1)
+   rien = where(gdep2 LE boxzoom[5], indice2)
+   indice2 = indice1 > (indice2-1)
+;
+   if indice1 EQ indice2 then BEGIN
+      if (where(gdep1 GE boxzoom[4] AND gdep2 LE boxzoom[5]))[0]  EQ -1 then begin
+         indice1 = 0 > (indice1-(grid_t EQ 1))
+         indice2 = indice1
+      endif
+      boxzoom[4] = gdep1[indice1]
+      boxzoom[5] = boxzoom[4]+1
+   endif
+; maintenant que les values et les indexes sont definis proprement,
+; on peut les appliquer
+   widget_control, depthlev1id, set_value = {droplist_select:indice1}
+   widget_control, depthlev2id, set_value = {droplist_select:indice2}
+; controler les min et les max des sliders...
+   if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1]
+   max1 = (min1+1) > gdep1[indice2]
+   widget_control, depth1id, set_value = {slider_min:min1, slider_max:max1, value:boxzoom[4]}
+   min2 = gdep2[indice1]
+   if indice2 EQ jpk-1 then BEGIN 
+      max2 = max([gdept, gdepw])
+      max2 = strtrim(string(max2,format='(e8.0)'), 1)
+      max2 = float('1'+strmid(max2, 1))+float(max2)
+   ENDIF ELSE max2 = gdep1[indice2+1]
+   widget_control, depth2id, set_value = {slider_min:min2, slider_max:max2, value:boxzoom[5]}
+;
+   return
+end
+;*********************************************************************
+FUNCTION cw_domain_get_value, id
+   box = lonarr(6)
+   possiblecase = ['lon1', 'lon2','lat1', 'lat2','depth1','depth2']
+   for i = 0, 5 do begin
+      widget_control,widget_info(id,find_by_uname = possiblecase[i]) $
+       , get_value = value
+      box[i] = value.value
+   endfor
+   return, box
+end
+;*********************************************************************
+FUNCTION cw_domain_event, event
+@common
+; help,  /struct, event
+   if (where(tag_names(event) EQ 'OUT'))[0] NE -1 then if event.out NE 0 then return,  -1
+   widget_control, event.id, get_uvalue=uval
+   case uval.name of
+      'lon1':widget_control,widget_info(event.handler,find_by_uname = 'lon2') $
+       , set_value = {slider_min:event.value+uval.strict}
+      'lon2':widget_control,widget_info(event.handler,find_by_uname = 'lon1') $
+       , set_value = {slider_max:event.value-uval.strict}
+      'lat1':widget_control,widget_info(event.handler,find_by_uname = 'lat2') $
+       , set_value = {slider_min:event.value+uval.strict}
+      'lat2':widget_control,widget_info(event.handler,find_by_uname = 'lat1') $
+       , set_value = {slider_max:event.value-uval.strict}
+      'unzoom':BEGIN
+         id = widget_info(event.handler,find_by_uname = 'lon1')
+         widget_control, id, get_value = value
+         widget_control, id, set_value = {slider_min:value.slider_min_max[0]}
+         widget_control, id, set_value = value.slider_min_max[0]
+         id = widget_info(event.handler,find_by_uname = 'lat1')
+         widget_control, id, get_value = value
+         widget_control, id, set_value = {slider_min:value.slider_min_max[0]}
+         widget_control, id, set_value = value.slider_min_max[0]
+         id = widget_info(event.handler,find_by_uname = 'lon2')
+         widget_control, id, get_value = value
+         widget_control, id, set_value = {slider_max:value.slider_min_max[1]}
+         widget_control, id, set_value = value.slider_min_max[1]
+         id = widget_info(event.handler,find_by_uname = 'lat2')
+         widget_control, id, get_value = value
+         widget_control, id, set_value = {slider_max:value.slider_min_max[1]}
+         widget_control, id, set_value = value.slider_min_max[1]
+      END
+      'depthlev1':BEGIN
+; ids...
+         depth1id = widget_info(event.handler,find_by_uname = 'depth1')
+         depth2id = widget_info(event.handler,find_by_uname = 'depth2')
+         depthlev2id = widget_info(event.handler,find_by_uname = 'depthlev2')
+; faut-il changer depthlev2 ?
+         widget_control, depthlev2id, get_value = depthlev2_value
+         if depthlev2_value.droplist_select LT event.index then BEGIN
+; on redefinie la valeur de depthlev2id
+            widget_control, depthlev2id, set_value = {droplist_select:event.index}
+; donc on redefinit la valeur et le max du slider 2
+            widget_control, depthlev2id, get_uvalue = depthlev2_uval
+            if event.index EQ jpk-1 then BEGIN 
+               max = max([gdept, gdepw])
+               max = strtrim(string(max,format='(e8.0)'), 1)
+               max = float('1'+strmid(max, 1))+float(max)
+            ENDIF ELSE max = depthlev2_uval.value[event.index+1]-1
+            widget_control, depth2id $
+             , set_value = {slider_max:max, value:depthlev2_uval.value[event.index]}
+; du coup on redefinie donc le max du slider 1 
+            widget_control, depth1id, set_value = {slider_max:uval.value[event.index]}
+         END 
+; on redefinie la valeur et le min du slider depth 1
+         if event.index EQ 0 then min = 0 ELSE min = uval.value[event.index-1]+1
+         widget_control, depth1id, set_value = {slider_min:min, value:uval.value[event.index]}
+; du coup on change aussi la valeur du min du slider depth 2
+         widget_control, depth2id, set_value = {slider_min:uval.value[event.index]+1}
+      END
+      'depthlev2':BEGIN
+; ids...
+         depth1id = widget_info(event.handler,find_by_uname = 'depth1')
+         depth2id = widget_info(event.handler,find_by_uname = 'depth2')
+         depthlev1id = widget_info(event.handler,find_by_uname = 'depthlev1')
+; faut-il changer depthlev1 ?
+         widget_control, depthlev1id, get_value = depthlev1_value
+         if depthlev1_value.droplist_select GT event.index then BEGIN
+; on redefinie la valeur de depthlev1id
+            widget_control, depthlev1id, set_value = {droplist_select:event.index}
+; donc on redefinit la valeur et le min du slider 1
+            widget_control, depthlev1id, get_uvalue = depthlev1_uval
+            if event.index EQ 0 then min = 0 ELSE min = uval.value[event.index-1]
+            widget_control, depth1id $
+             , set_value = {slider_min:min, value:depthlev1_uval.value[event.index]}
+; du coup on redefinie donc le min du slider 2
+            widget_control, depth2id, set_value = {slider_min:uval.value[event.index]}
+         END 
+; on redefinie la valeur et le max du slider depth 2
+         if event.index EQ jpk-1 then BEGIN 
+            max = max([gdept, gdepw])
+            max = strtrim(string(max,format='(e8.0)'), 1)
+            max = float('1'+strmid(max, 1))+float(max)
+         ENDIF ELSE max = uval.value[event.index+1]-1
+         widget_control, depth2id, set_value = {slider_max:max, value:uval.value[event.index]}
+; du coup on change aussi la valeur du max du slider depth 1
+         widget_control, depth1id, set_value = {slider_max:uval.value[event.index]-1}
+      END
+      'depth1':BEGIN
+; ids...
+         depth2id = widget_info(event.handler,find_by_uname = 'depth2')
+         depthlev1id = widget_info(event.handler,find_by_uname = 'depthlev1')
+; doit-on changer depthlev1 ?
+         widget_control, depthlev1id, get_value = depthlev1_value
+         widget_control, depthlev1id, get_uvalue = depthlev1_uval
+         rien = where(depthlev1_uval.value LT event.value, indice)
+         indice = indice < (jpk-1)
+         if indice NE depthlev1_value.droplist_select then begin
+; on change le min de depth2
+            widget_control, depth2id, set_value = {slider_min:depthlev1_uval.value[indice]+1}
+; on redefinie la valeur de depthlev1id
+            widget_control, depthlev1id, set_value = {droplist_select:indice}
+; donc on redefinit le min du slider 1
+            if indice EQ 0 then min = 0 ELSE min = depthlev1_uval.value[indice-1]+1
+            widget_control, event.id, set_value = {slider_min:min}
+         endif
+      END
+      'depth2':BEGIN
+; ids...
+         depth1id = widget_info(event.handler,find_by_uname = 'depth1')
+         depthlev2id = widget_info(event.handler,find_by_uname = 'depthlev2')
+; doit-on changer depthlev2 ?
+         widget_control, depthlev2id, get_value = depthlev2_value
+         widget_control, depthlev2id, get_uvalue = depthlev2_uval
+         rien = where(depthlev2_uval.value LE event.value, indice)
+         indice = 0 > (indice-1)
+         if indice NE depthlev2_value.droplist_select then begin
+; on change le max de depth1
+            widget_control, depth1id, set_value = {slider_max:depthlev2_uval.value[indice]-1}
+; on redefinie la valeur de depthlev2id
+            widget_control, depthlev2id, set_value = {droplist_select:indice}
+; donc on redefinit le max du slider 2
+            if indice EQ jpk-1 then BEGIN 
+               max = max([gdept, gdepw])
+               max = strtrim(string(max,format='(e8.0)'), 1)
+               max = float('1'+strmid(max, 1))+float(max)
+            ENDIF ELSE max = depthlev2_uval.value[indice+1]-1
+            widget_control, event.id, set_value = {slider_max:max}
+         endif
+      END
+      ELSE:
+   ENDCASE
+;    slidesliceid = widget_info(event.top, find_by_uname = 'slide_slice')
+;    if slidesliceid NE 0 then widget_control, slidesliceid, set_value = 1
+   return,{ID:event.handler, TOP:event.top, HANDLER:0L $
+           , BOX:cw_domain_get_value(event.handler)}
+end
+;*********************************************************************
+FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex
+;
+@common
+; cheking exclusive keywords
+   column = keyword_set(column)*(1-keyword_set(row))
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 
+; def de la boxzoom
+   if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2 $
+                                           , min([gdepw[0], gdept[0]]), max([gdepw[0], gdept[0]]) ]
+   Case N_Elements(Boxzoom) OF
+      0:boxzoom = [lon1, lon2, lat1, lat2, vert1, vert2]
+      1:boxzoom=[lon1, lon2, lat1, lat2, 0.,boxzoom[0]]
+      2:boxzoom=[lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]]
+      4:boxzoom=[Boxzoom, vert1, vert2]
+      5:boxzoom=[Boxzoom[0:3], 0, Boxzoom[4]]
+      6:
+      Else: return, report('Mauvaise Definition de Boxzoom')
+   ENDCASE
+;
+   boxzoom[0] = floor(boxzoom[0])
+   boxzoom[1] = ceil(boxzoom[1])
+   boxzoom[2] = floor(boxzoom[2])
+   boxzoom[3] = ceil(boxzoom[3])
+   boxzoom[4] = floor(boxzoom[4])
+   boxzoom[5] = ceil(boxzoom[5])
+;------------------------------------------------
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+   base = widget_base(parent, /row  $
+                      , space = 1,  xpad = 1,  ypad = 1 $
+                      , EVENT_FUNC = 'cw_domain_event' $
+                      , FUNC_GET_VALUE='cw_domain_get_value' $
+                      , PRO_SET_VALUE='cw_domain_set_value' $
+                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
+;-------------longitude---------------------------
+   basehori = widget_base(base, ROW = row, COLUMN = column)
+;-------------longitude---------------------------
+   min = floor(min([glamt,glamf], max = max))
+   max = ceil(max)
+   lonbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'lonbase')
+   lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $
+                       , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $
+                       , title = 'lon1', minimum = min $
+                       , maximum = (boxzoom[1] < max)-keyword_set(strict))
+   lon2id = cw_slider_pm(lonbase,value=((min > boxzoom[0])+keyword_set(strict)) > boxzoom[1] < max $
+                       , uvalue={name:'lon2', strict:keyword_set(strict)} $
+                       , uname='lon2', title = 'lon2', maximum = max $
+                       , minimum = (min > boxzoom[0])+keyword_set(strict))
+   widget_control, lonbase, set_uvalue = {name:'geographic'}
+;---------------latitude-------------------------
+   min = floor(min([gphit,gphif], max = max))
+   max = ceil(max)
+   latbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'latbase')
+   lat1id = cw_slider_pm(latbase,value=min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $
+                       , uvalue={name:'lat1', strict:keyword_set(strict)},uname ='lat1' $
+                       , title = 'lat1', minimum =min $
+                       , maximum = ((boxzoom[3] < max)-keyword_set(strict)))
+   lat2id = cw_slider_pm(latbase,value=((min > boxzoom[2])+keyword_set(strict)) > boxzoom[3] < max $
+                       , uvalue={name:'lat2', strict:keyword_set(strict)} $
+                       , uname ='lat2', title = 'lat2' ,maximum =  max $
+                       , minimum =(min > boxzoom[2])+keyword_set(strict))
+   widget_control, latbase, set_uvalue = {name:'geographic'}
+;----------------unzoom------------------------
+   if keyword_set(unzoom) then rien = widget_button(basehori,value='unzoom', uvalue={name:'unzoom'})
+;----------------depth------------------------
+   basevert = widget_base(base, ROW = row, COLUMN = column)
+   basedepth = widget_base(basevert, /row)
+;
+   if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept
+   gdep1 = floor(gdep)
+   gdep2 = ceil(gdep)
+   identique = where(gdep2-gdep1 EQ 0)
+   if identique[0] NE -1 then gdep2[identique] = gdep2[identique] +1
+   sgdep1 = strtrim(gdep1, 1)
+   sgdep2 = strtrim(gdep2, 1)
+;
+   basedepthdrop = widget_base(basedepth, column = column,  row = row)
+;
+   dephtid=cw_droplist_pm(basedepthdrop,value=''+sgdep1, uvalue={name:'depthlev1', value:gdep1, grid_t:strupcase(vargrid) NE 'W'}, uname='depthlev1')
+   rien = where(gdep1 LT boxzoom[4], indice1)
+   indice1 = indice1 < (jpk-1)
+   widget_control, dephtid, set_value = {droplist_select:indice1}
+;
+   dephtid=cw_droplist_pm(basedepthdrop,value=''+sgdep2, uvalue={name:'depthlev2', value:gdep2, grid_t:strupcase(vargrid) NE 'W'}, uname='depthlev2')
+   rien = where(gdep2 LE boxzoom[5], indice2)
+   indice2 = indice1 > (indice2-1)
+   widget_control, dephtid, set_value = {droplist_select:indice2}
+;
+   basedepthslid = widget_base(basedepth, column = column,  row = row)
+;
+   if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1]
+   max1 = (min1+1) > gdep1[indice2]
+   rien = cw_slider_pm(basedepthslid, value= min1 > boxzoom[4] < (boxzoom[5] < max1) $
+                       , uvalue = {name:'depth1'}, uname = 'depth1' $
+                       , title = 'depth1', minimum = min1, maximum = max1)
+;
+   min2 = gdep2[indice1]
+   if indice2 EQ jpk-1 then BEGIN 
+      max2 = max([gdept, gdepw])
+      max2 = strtrim(string(max2,format='(e8.0)'), 1)
+      max2 = float('1'+strmid(max2, 1))+float(max2)
+   ENDIF ELSE max2 = gdep1[indice2+1]
+   if max2 EQ min2 then max2 = min2+1
+   rien = cw_slider_pm(basedepthslid, value= (min2 > boxzoom[4]) > boxzoom[5] < max2 $
+                       , uvalue={name:'depth2'}, minimum = min2 $
+                       , uname = 'depth2', title = 'depth2' ,maximum =  max2)
+;--------------------------------------------
+;
+;
+;
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro	(revision 51)
@@ -0,0 +1,219 @@
+;------------------------------------------------------------
+;------------------------------------------------------------
+;------------------------------------------------------------
+;+
+; NAME: cw_droplist_pm
+;
+; PURPOSE: widget equivalent a WIDGET_DROPLIST sauf qu'en plus on
+; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1.
+;
+; CATEGORY: compound widget (aide a l''ecriture des widgets)
+;
+; CALLING SEQUENCE: id=cw_droplist_pm(parent)
+; 
+; INPUTS:
+;         Parent: The widget ID of the parent widget.
+;
+; KEYWORD PARAMETERS:tous ceux de WIDGET_DROPLIST
+;
+; OUTPUTS:
+;         The returned value of this function is the widget ID of the
+;         newly-created animation widget.
+;
+; COMMON BLOCKS: none
+;
+; SIDE EFFECTS:
+;
+;     Widget Events Returned by Droplist Widgets
+;
+;   Pressing the mouse button while the mouse cursor is over an
+;   element of a droplist widget causes the widget to change the label
+;   on the droplist button and to generate an event. The appearance of
+;   any previously selected element is restored to normal at the same
+;   time. The event structure returned by the WIDGET_EVENT function is
+;   defined by the following statement:
+;
+;   { CW_DROPLIST_PM, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, OUT:0 }
+;
+;   The first three fields are the standard fields found in every
+;   widget event.
+;   INDEX returns the index of the selected item. This can be used to
+;   index the array of names originally used to set the widget''s
+;   value
+;   OUT:c''est un entier qui peut prendre 3 valeurs:
+;       1 : si on appuie sur + alors que l''index est deja aux max. rq:
+;       ds ce cas l''index reste au max
+;       -1: si on appuie sur - alors que l''index est deja aux min. rq:
+;       ds ce cas l''index reste au min
+;       0 : ds les autres cas!
+;
+;   Keywords to WIDGET_CONTROL
+;
+;   A number of keywords to the WIDGET_CONTROL procedure affect the
+;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE.
+;       1) GET_VALUE
+;   widget_control,wid_id,get_value=resultat
+;   retourne ds la variable resultat une structure de 3 elements dont
+;   les noms sont inspires des mots cles que l''on peut passer a
+;   widget_control qd on utilise WIDGET_DROPLIST:
+;            DROPLIST_NUMBER: the number of elements currently
+;            contained in the specified droplist widget.
+;            DROPLIST_SELECT: the zero-based number of the
+;            currently-selected element (i.e., the currently-displayed
+;            element) in the specified droplist widget.
+;            DYNAMIC_RESIZE: a True value (1) if the widget specified
+;            by Widget_ID is a button, droplist, or label widget that
+;            has had its DYNAMIC_RESIZE attribute set. Otherwise,
+;            False (0) is returned.
+;       2) SET_VALUE
+;   widget_control,wid_id,set_value=impose
+;   permet de modifier l''etat de la droplist comme on peut le faire
+;   pour WIDGET_DROPLIST Impose peut etre:
+;       a) The contents of the list widget (string or string array)
+;       b) une structure qui peut avoir comme elements (de 1 a 3):
+;            DYNAMIC_RESIZE:Set this keyword to activate (if set to 1)
+;            or deactivate (if set to 0) dynamic resizing of the
+;            specified CW_DROPLIST_PM widget (see the documentation
+;            for the DYNAMIC_RESIZE keyword to WIDGET_DROPLIST
+;            procedure for more information about dynamic widget
+;            resizing).
+;            DROPLIST_SELECT:Set this keyword to return the zero-based
+;            number of the currently-selected element (i.e., the
+;            currently-displayed element) in the specified droplist
+;            widget.
+;            VALUE: The contents of the list widget (string or string
+;            array)
+;
+; RESTRICTIONS:
+;
+; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la
+; procedure associee, testwid_event.
+;
+; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
+;                      6/9/1999
+;
+;-
+;------------------------------------------------------------
+;------------------------------------------------------------
+;------------------------------------------------------------
+; PRO testwid_event, event
+; ;   help, event, /STRUCT
+;    DroplistId = widget_info(event.top,find_by_uname = 'c''est lui')
+;    widget_control, event.id, get_uvalue=uval
+;    if n_elements(uval) EQ 0 then return
+;    case uval of
+;       'done':widget_control, event.top, /destroy
+;       'dynamic_resize':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, DroplistId, set_value = {dynamic_resize:value}
+;       END
+;       'droplist_select':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, DroplistId, set_value = {droplist_select:value}
+;       END
+;       'value':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, DroplistId, set_value = value
+;       END
+;       'get':BEGIN 
+;          widget_control, DroplistId, get_value = value
+;          help,  value, /struct
+;       END
+;       ELSE:
+;    endcase
+;    return
+; end
+; PRO testwid, _extra = ex
+;    base=widget_base(/COLUMN)
+; print, 'base=', base
+;    nothing = widget_label(base, value = 'beginning of the test')
+; ;
+;    nothing = cw_droplist_pm(base, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui')
+; print, 'cw_droplist_pm ID =', nothing
+; ;
+;    nothing = widget_label(base, value = 'end of the test')
+;    nothing = widget_text(base, value = '0', uvalue = 'dynamic_resize', /editable)
+;    nothing = widget_text(base, value = '10', uvalue = 'droplist_select', /editable)
+;    nothing = widget_text(base, value = '5', uvalue = 'value', /editable)
+;    nothing = widget_button(base, value = 'get', uvalue = 'get')
+;    nothing = widget_button(base, value = 'done', uvalue = 'done')
+;    widget_control, base, /REALIZE
+;    xmanager,'testwid', base
+;    return
+; end
+;----------------------------------------------------------------------
+PRO cw_droplist_pm_set_value, id, value
+   DroplistId = widget_info(id,find_by_uname = 'Droplist')
+   if size(value, /type) eq 8 then BEGIN ; this is a structure
+      tagnames = tag_names(value)
+      for tag = 0, n_tags(value)-1 do begin
+         case strtrim(strlowcase(tagnames[tag]), 2) of
+            'dynamic_resize':widget_control, DroplistId, dynamic_resize = value.dynamic_resize
+            'droplist_select':widget_control, DroplistId, set_droplist_select = value.droplist_select
+            'value':widget_control, DroplistId, set_value = value.value
+            ELSE:ras = report('mauvais nom de l''argument de la structure ds cw_droplist_pm_set_value')
+         endcase
+      endfor
+   ENDIF ELSE widget_control, DroplistId, set_value = value
+   return
+end
+;----------------------------------------------------------------------
+FUNCTION cw_droplist_pm_get_value, id
+   DroplistId = widget_info(id,find_by_uname = 'Droplist')
+   return, {droplist_number:widget_info(DroplistId, /droplist_number) $
+            , droplist_select:widget_info(DroplistId, /droplist_select) $
+            , dynamic_resize:widget_info(DroplistId, /dynamic_resize)}
+end
+;----------------------------------------------------------------------
+FUNCTION cw_droplist_pm_event, event
+   widget_control, event.id, get_uvalue=uval
+;
+   if uval EQ 'Droplist' then $
+    return, {CW_DROPLIST_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+             , INDEX:event.index, OUT:0}
+;
+   DroplistId = widget_info(event.handler,find_by_uname = 'Droplist')
+   index = widget_info(DroplistId, /droplist_select)
+   case uval OF
+      'plus':BEGIN
+         indexmax = widget_info(DroplistId, /droplist_number)-1
+         if index NE indexmax then widget_control, DroplistId,set_droplist_select = index+1
+         return, {CW_DROPLIST_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+                  , INDEX:(index+1) < indexmax, OUT:long(index EQ indexmax)}
+      END
+      'minus':BEGIN
+         if index NE 0 then widget_control, DroplistId,set_droplist_select = index-1
+         return, {CW_DROPLIST_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+                  , INDEX:0 > (index-1), OUT:-long(index EQ 0)}
+      END
+   endcase
+end
+;----------------------------------------------------------------------
+FUNCTION cw_droplist_pm, parent,UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, _extra = ex
+
+   IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments'
+   ON_ERROR, 2                  ;return to caller
+; cheking for row and column keywords
+   row = keyword_set(row)*(1-keyword_set(column)) 
+   column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+;
+   base = widget_base(parent, space = 1, xpad = 1, ypad = 1, ROW = row, COLUMN = column  $
+                      , EVENT_FUNC = 'cw_droplist_pm_event' $
+                      , FUNC_GET_VALUE='cw_droplist_pm_get_value' $
+                      , PRO_SET_VALUE='cw_droplist_pm_set_value' $
+                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
+;
+   if keyword_set(row) THEN nothing = widget_button(base,value= '-', uvalue= 'minus')
+   nothing = widget_droplist(base, UVALUE = 'Droplist', UNAME = 'Droplist', _extra = ex)
+   if keyword_set(column) then begin
+      base1 = widget_base(base, /row, /align_center, space = 1, xpad = 1, ypad = 1)
+      nothing = widget_button(base1,value= '-', uvalue= 'minus', xsize = 20, ysize = 20)
+      nothing = widget_button(base1,value= '+', uvalue= 'plus', xsize = 20, ysize = 20)
+   ENDIF ELSE nothing = widget_button(base,value= '+', uvalue= 'plus')
+;
+;   widget_control,base,/realize
+;
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_fourparameter.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_fourparameter.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_fourparameter.pro	(revision 51)
@@ -0,0 +1,105 @@
+;*********************************************************************************
+FUNCTION cw_fourparameter_get_value, id
+      widget_control, widget_info(id, find_by_uname = 'glo'), get_value = glo
+      widget_control, widget_info(id, find_by_uname = 'used'), get_value = used
+      widget_control, widget_info(id, find_by_uname = 'min'), get_value = min
+      widget_control, widget_info(id, find_by_uname = 'max'), get_value = max
+   return, fix([glo[0], used[0], min[0], max[0]])
+end
+;*********************************************************************************
+FUNCTION cw_fourparameter_event, event
+   widget_control, event.id, get_uvalue=uval
+   value = cw_fourparameter_get_value(event.handler)
+   case uval of
+      'glo':
+      'used':BEGIN
+         widget_control, event.id, get_value = used 
+         value[1] = fix(used[0])
+         if value[1] GT value[0] then begin
+            value[1] = value[0]
+            widget_control, event.id, set_value = strtrim(value[1], 1)
+            value[2] = 0
+            widget_control, widget_info(event.handler, find_by_uname = 'min'), set_value = strtrim(value[2], 1)
+            value[3] = value[0]-1
+            widget_control, widget_info(event.handler, find_by_uname = 'max'),set_value=strtrim(value[3], 1)
+         ENDIF
+         if value[1] GT value[3]-value[2] then begin
+            value[2] = 0
+            widget_control, widget_info(event.handler, find_by_uname = 'min'), set_value = strtrim(value[2], 1)
+            value[3] = value[1]-1
+            widget_control, widget_info(event.handler, find_by_uname = 'max'),set_value=strtrim(value[3], 1)
+         ENDIF
+      END
+      'min':BEGIN 
+         widget_control, event.id, get_value = minv 
+         value[2] = 0 > fix(minv[0]) < (value[3]-1)
+         widget_control, event.id, set_value = strtrim(value[2], 1)
+         value[1] = fix(value[3]-value[2]+1)
+         widget_control, widget_info(event.handler, find_by_uname = 'used'), set_value = strtrim(value[1], 1)
+      END
+      'max':BEGIN
+         widget_control, event.id, get_value = maxv 
+         value[3] = (value[2]+1) > fix(maxv[0]) < (value[0]-1)
+         widget_control, event.id, set_value = strtrim(value[3], 1)
+         value[1] = fix(value[3]-value[2]+1)
+         widget_control, widget_info(event.handler, find_by_uname = 'used'), set_value = strtrim(value[1], 1)
+      END
+   endcase
+   return, {ID:event.handler, TOP:event.top, HANDLER:0L $
+            , VALUE:value}
+end
+;*********************************************************************************
+FUNCTION cw_fourparameter,  parent, xgloin, xin, xminin, xmaxin, direction, type, CLEAR = clear, EDITABLE = editable, UVALUE = uvalue, UNAME = uname
+;
+@common
+;
+   xglo = xgloin
+   x = xin
+   xmin = xminin
+   xmax = xmaxin
+;
+   if keyword_set(clear)  then begin
+      x = 0
+      xmin = 0
+      xmax = 0
+   ENDIF
+;   
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+    base = widget_base(parent, /column, UVALUE = uvalue, UNAME = uname $
+                      , EVENT_FUNC = 'cw_fourparameter_event' $
+                      , FUNC_GET_VALUE='cw_fourparameter_get_value' $
+                      , PRO_SET_VALUE='cw_fourparameter_set_value' )
+;
+;     case type of
+;        'mesh':nothing = widget_label(base, value = 'parametres de position de la grille par rapport')
+;        'dta':nothing = widget_label(base, value = 'parametres de position des donnees par rapport')
+;     endcase
+;     nothing = widget_label(base, value = 'au domaine de calcul suivant '+direction)
+    baserow = widget_base(base, /row)
+    case direction of
+       'x':letter = 'i'
+       'y':letter = 'j'
+       'z':letter = 'k'
+    ENDCASE
+    case type of
+       'mesh':used = ''
+       'dta':used = 'dta'
+    endcase
+;
+    nothing = widget_label(baserow, value = 'jp'+letter+'glo')
+    nothing = widget_text(baserow, value = strtrim(xglo, 1), uname = 'glo', uvalue = 'glo', xsize = 4, EDITABLE = editable)
+
+    nothing = widget_label(baserow, value = 'jp'+letter+used)
+    nothing = widget_text(baserow, value = strtrim(x, 1), uname = 'used', uvalue = 'used', xsize = 4, EDITABLE = editable)
+
+    nothing = widget_label(baserow, value = 'i'+direction+'min'+type)
+    rien = execute('value = strtrim(i'+direction+'min'+type+'*(1-keyword_set(editable)), 1)')
+    nothing = widget_text(baserow, value = strtrim(xmin, 1), uname = 'min', uvalue = 'min', xsize = 4, EDITABLE = editable)
+
+    nothing = widget_label(baserow, value = 'i'+direction+'max'+type)
+    nothing = widget_text(baserow, value = strtrim(xmax, 1), uname = 'max', uvalue = 'max', xsize = 4, EDITABLE = editable)
+
+
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_miseenpage.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_miseenpage.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_miseenpage.pro	(revision 51)
@@ -0,0 +1,138 @@
+;*********************************************************************
+;*********************************************************************
+FUNCTION cw_miseenpage_event, event
+
+   widget_control, event.id, get_uvalue=uval
+   widget_control, event.top, get_uvalue=top_uvalue
+;
+   smallin = extractatt(top_uvalue, 'smallin')
+   numdessinin = smallin[2]-1
+   smallout = extractatt(top_uvalue, 'smallout')
+;
+   if uval.name EQ 'undo' then begin
+      return,{ID:event.handler, TOP:event.top, HANDLER:0L}
+   ENDIF ELSE BEGIN 
+;
+@common
+; si on ne change pas le nombre de colonnes, on sort
+      if uval.name EQ 'column' then $
+       if event.index+1 EQ smallin[0] THEN $
+       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
+; si on ne change pas le nombre de lignes, on sort
+      if uval.name EQ 'row' then $
+       if event.index+1 EQ smallin[1] THEN $
+       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
+;
+; on efface la page
+;      graphid = widget_info(event.top,find_by_uname = 'graph')
+      graphid = extractatt(top_uvalue, 'graphid')
+      widget_control,graphid,get_value=win
+      wset, win
+      erase, 255
+      case uval.name of
+         'clear':
+         'column':BEGIN 
+            smallin = [event.index+1, smallin[1], 1]
+            smallout = [event.index+1, smallout[1], 1]
+         END
+         'row':BEGIN
+            smallin = [smallin[0], event.index+1, 1]
+            smallout = [smallout[0], event.index+1, 1]
+         END
+      endcase
+      nbredessin = smallin[0]*smallin[1]
+;         
+; on remet tout a 0 en ce qui concerne les postscripts
+      createhistory, event.top, smallin
+;         
+         options = extractatt(top_uvalue, 'options')   
+         flags = extractatt(top_uvalue, 'optionsflag')
+         xlonindex = where(options EQ 'Longitude / x index')
+         xlonflag = flags[xlonindex, numdessinin] & xlonflag = xlonflag[0]
+         ylatindex = where(options EQ 'Latitude / y index')
+         ylatflag = flags[ylatindex, numdessinin] & ylatflag = ylatflag[0]
+;         
+      flag = [1, key_portrait, 0, 0, 0, 0]
+      flag[xlonindex] = xlonflag
+      flag[ylatindex] = ylatflag
+;         
+; actualisation de la top_uvalue...
+;
+      *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
+      *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout
+;
+      *top_uvalue[1, findline(top_uvalue, 'penvs')] = replicate(!p, nbredessin)
+      *top_uvalue[1, findline(top_uvalue, 'xenvs')] = replicate(!x, nbredessin)
+      *top_uvalue[1, findline(top_uvalue, 'yenvs')] = replicate(!y, nbredessin)
+;
+      old = (extractatt(top_uvalue, 'nameprocedures'))[numdessinin]
+      new = strarr(nbredessin)
+      new[0] = old
+      *top_uvalue[1, findline(top_uvalue, 'nameprocedures')] = new
+;
+      old = (extractatt(top_uvalue, 'types'))[numdessinin]
+      new = strarr(nbredessin)
+      new[0] = old
+      *top_uvalue[1, findline(top_uvalue, 'types')] = new
+;
+      old = (extractatt(top_uvalue,  'champs'))[*, numdessinin]
+      new = strarr(2, nbredessin)
+      new[*, 0] = old
+      *top_uvalue[1, findline(top_uvalue, 'champs')] = new
+;
+      old = (extractatt(top_uvalue, 'domaines'))[*, numdessinin]
+      new = fltarr(6, nbredessin)
+      new[*, 0] = old
+      *top_uvalue[1, findline(top_uvalue, 'domaines')] = new
+;
+      old = (extractatt(top_uvalue, 'dates'))[*, numdessinin]
+      new = lonarr(2, nbredessin)
+      new[*, 0] = old
+      *top_uvalue[1, findline(top_uvalue, 'dates')] = new
+;
+      old = (extractatt(top_uvalue,  'prefixes'))[numdessinin]
+      new = strarr(nbredessin)
+      new[0] = old
+      *top_uvalue[1, findline(top_uvalue, 'prefixes')] = new
+;
+      new = flag#replicate(1, nbredessin)
+      *top_uvalue[1, findline(top_uvalue, 'optionsflag')] = new
+;
+      ptr_free, extractatt(top_uvalue, 'exextra')
+      *top_uvalue[1, findline(top_uvalue, 'exextra')] = ptrarr(nbredessin, /allocate_heap)
+;      *top_uvalue[1, findline(top_uvalue, '')] = 
+;
+   ENDELSE 
+
+   return,{ID:event.handler, TOP:event.top, HANDLER:0L}
+end
+;*********************************************************************
+FUNCTION cw_miseenpage, parent, small, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex
+; cheking exclusive keywords
+   column = keyword_set(column)*(1-keyword_set(row))
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column)
+;------------------------------------------------
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+   base = widget_base(parent, ROW = row, COLUMN = column  $
+                      , EVENT_FUNC = 'cw_miseenpage_event' $
+                      , FUNC_GET_VALUE='cw_miseenpage_get_value' $
+                      , PRO_SET_VALUE='cw_miseenpage_set_value' $
+                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
+;------------------------------------------------
+   IF n_elements(small) eq 0 then small = [1, 1, 1]
+   basedroplist = widget_base(base, /column, /align_center)
+   id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title ='column' $
+                        , uvalue ={name:'column'}, uname='column')
+   widget_control, id, set_droplist_select = small[0]-1
+   id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title =' row ' $
+                        , uvalue ={name:'row'}, uname='row')
+   widget_control, id, set_droplist_select = small[1]-1
+   basebutton = widget_base(base, /column, /align_center)
+   rien = widget_button(basebutton, value = 'Clear', uvalue ={name:'clear'}, uname='clear')
+   rien = widget_button(basebutton, value = 'Undo', uvalue ={name:'undo'}, uname='undo')
+;------------------------------------------------
+;------------------------------------------------
+   return, base
+end
+;*********************************************************************
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pdmenu.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pdmenu.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pdmenu.pro	(revision 51)
@@ -0,0 +1,362 @@
+; $Id$
+;
+; Copyright (c) 1992-1998, Research Systems, Inc.  All rights reserved.
+;	Unauthorized reproduction prohibited.
+;+
+; NAME:
+;	CW_PDMENU
+;
+; PURPOSE:
+;	CW_PDMENU is a compound widget that simplifies creating
+;	pulldown menus. It has a simpler interface than the XPDMENU
+;	procedure, which it is intended to replace. Events for the
+;	individual buttons are handled transparently, and a CW_PDMENU
+;	event returned. This event can return any one of the following:
+;               - The Index of the button within the base.
+;               - The widget ID of the button.
+;               - The name of the button.
+;		- The fully qualified name of the button. This allows
+;		  different sub-menus to contain buttons with the same
+;		  name in an unambiguous way.
+;
+;
+; CATEGORY:
+;	Compound widgets.
+;
+; CALLING SEQUENCE:
+;	widget = CW_PDMENU(Parent, Desc)
+;
+; INPUTS:
+;       Parent:	The ID of the parent widget.
+;	Desc:	An array of strings or structures.  Each element contains
+;		a menu description with two fields, a flag field, and
+;		the name of the item.  If a structure, each element
+;		is defined as follows:
+;			{ CW_PDMENU_S, flags:0, name:'' }
+;
+;		The name tag gives the name of button. The flags
+;		field is a two-bit bitmask that controls how the button is
+;		interpreted:
+;
+;		    Value	   Meaning
+;		    -------------------------------------------
+;		     0     This button is neither the beginning
+;			   nor the end of a pulldown level.
+;		     1     This button is the root of a
+;                          sub-pulldown menu. The sub-buttons
+;			   start with the next button.
+;		     2     This button is the last button at the
+;			   current pulldown level. The next button
+;			   belongs to the same level as the current
+;			   parent button.
+;			   If none or empty string is specified as a
+;			   the name, the button is not created, but
+;			   the next button belongs to the upward level.
+;		     3     This button is the root of a sub-pulldown
+;			   menu, but it is also the last entry of
+;			   the current level.
+;		     4     Same as 0, above, except that this button will
+;			   be preceeded by a separator as with the SEPARATOR
+;			   keyword to WIDGET_BUTTON.
+;		     5     Same as 1, above, except that this button will
+;			   be preceeded by a separator.
+;		     6     Same as 2, above, except that this button will
+;			   be preceeded by a separator.
+;		     7     Same as 3, above, except that this button will
+;			   be preceeded by a separator.
+;
+;	If Desc is a string, each element contains the flag field
+;	followed by a backslash character, followed by the menu item's
+;	contents.  See the example below.
+;
+;	EVENT PROCEDURES:  An event procedure may be specified for an
+;	element and all its children, by including a third field
+;	in Desc, if Desc is a string array.  Events for buttons without
+;	an event procedure, are dispatched normally.
+;	See the example below.
+;
+; KEYWORD PARAMETERS:
+;	DELIMITER:        The character used to separate the parts of a
+;			  fully qualified name in returned events. The
+;			  default is to use the '.' character.
+;	FONT:		  The name of the font to be used for the button
+;			  titles. If this keyword is not specified, the
+;			  default font is used.
+;	HELP:		  If MBAR is specified and one of the buttons on the
+;			  menubar has the label "help" (case insensitive) then
+;			  that button is created with the /HELP keyword to
+;			  give it any special appearance it is supposed to
+;			  have on a menubar. For example, Motif expects
+;			  help buttons to be on the right.
+;	IDS:		  A named variable into which the button IDs will
+;			  be stored as a longword vector.
+;	MBAR:		  if constructing a menu-bar pulldown, set this
+;			  keyword.  In this case, the parent must be the 
+;			  widget id of the menu bar of a top-level base,
+;			  returned by WIDGET_BASE(..., MBAR=mbar).
+;	RETURN_ID:	  If present and non-zero, the VALUE field of returned
+;			  events will be the widget ID of the button.
+;	RETURN_INDEX:	  If present and non-zero, the VALUE field of returned
+;			  events will be the zero-based index of the button
+;			  within the base. THIS IS THE DEFAULT.
+;	RETURN_NAME:	  If present and non-zero, the VALUE field of returned
+;			  events will be the name of the selected button.
+;	RETURN_FULL_NAME: If present and non-zero, the VALUE field of returned
+;               	  events will be the fully qualified name of the
+;			  selected button. This means that the names of all
+;			  the buttons from the topmost button of the pulldown
+;			  menu to the selected one are concatenated with the
+;			  delimiter specified by the DELIMITER keyword. For
+;			  example, if the top button was named COLORS, the
+;			  second level button was named BLUE, and the selected
+;			  button was named LIGHT, the returned value would be
+;
+;			  COLORS.BLUE.LIGHT
+;
+;			  This allows different submenus to have buttons with
+;			  the same name (e.g. COLORS.RED.LIGHT).
+;	UVALUE:		  The user value to be associated with the widget.
+;
+;       UNAME:            Set this keyword to a string that can be
+;       used to identify the widget in your code. You can associate a
+;       name with each widget in a specific hierarchy, and then use
+;       that name to query the widget hierarchy and get the correct
+;       widget ID.
+;
+;	XOFFSET:	  The X offset of the widget relative to its parent.
+;	YOFFSET:	  The Y offset of the widget relative to its parent.
+;
+;       _EXTRA:
+;
+; OUTPUTS:
+;       The ID of the top level button is returned.
+;
+; SIDE EFFECTS:
+;	This widget generates event structures with the following definition:
+;
+;		event = { ID:0L, TOP:0L, HANDLER:0L, VALUE:0 }
+;
+;	VALUE is either the INDEX, ID, NAME, or FULL_NAME of the button,
+;	depending on how the widget was created.
+;
+; RESTRICTIONS:
+;	Only buttons with textual names are handled by this widget.
+;	Bitmaps are not understood.
+;
+; EXAMPLE:
+;	The following is the description of a menu bar with two buttons,
+;	"Colors" and "Quit". Colors is a pulldown containing the colors
+;	"Red", "Green", Blue", "Cyan", and "Magenta". Blue is a sub-pulldown
+;	containing "Light", "Medium", "Dark", "Navy", and "Royal":
+;
+;		; Make sure CW_PDMENU_S is defined
+;		junk = { CW_PDMENU_S, flags:0, name:'' }
+;
+;		; The description
+;		desc = [ { CW_PDMENU_S, 1, 'Colors' }, $
+;			     { CW_PDMENU_S, 0, 'Red' }, $
+;			     { CW_PDMENU_S, 0, 'Green' }, $
+;			     { CW_PDMENU_S, 5, 'Blue\BLUE_EVENT_PROC' }, $
+;			         { CW_PDMENU_S, 0, 'Light' }, $
+;			         { CW_PDMENU_S, 0, 'Medium' }, $
+;			         { CW_PDMENU_S, 0, 'Dark' }, $
+;			         { CW_PDMENU_S, 0, 'Navy' }, $
+;			         { CW_PDMENU_S, 2, 'Royal' }, $
+;			       { CW_PDMENU_S, 4, 'Cyan' }, $
+;			       { CW_PDMENU_S, 2, 'Magenta\MAGENTA_EVENT_PROC' }, $
+;			 { CW_PDMENU_S, 2, 'Quit' } ]
+;
+;	The same menu may be defined as a string by equating the Desc parameter
+;	to the following string array:
+;	
+;	desc =[ '1\Colors' , $
+;		'0\Red' , $
+;		'0\Green' , $
+;		'5\Blue\BLUE_EVENT_PROC' , $
+;		'0\Light' , $
+;		'0\Medium' , $
+;		'0\Dark' , $
+;		'0\Navy' , $
+;		'2\Royal' , $
+;		'4\Cyan' , $
+;		'2\Magenta\MAGENTA_EVENT_PROC' , $
+;		'2\Quit'  ]
+;
+;
+;	The following small program can be used with the above description
+;	to create the specified menu:
+;
+;
+;		base = widget_base()
+;		menu = cw_pdmenu(base, desc, /RETURN_FULL_NAME)
+;		WIDGET_CONTROL, /REALIZE, base
+;		repeat begin
+;		  ev = WIDGET_EVENT(base)
+;		  print, ev.value
+;		end until ev.value eq 'Quit'
+;		WIDGET_CONTROL, /DESTROY, base
+;		end
+;
+;	Note that independent event procedures were specified for
+;	the multiple Blue buttons (blue_event_proc), and the Magenta button 
+;	(magenta_event_proc).
+
+; MODIFICATION HISTORY:
+;	18 June 1992, AB
+;	16 Jan 1995, DMS, Added MBAR keyword, event procedures,
+;			and menu descriptor strings.
+;	2 July 1995, AB, Added HELP keyword.
+;	3 September 1996, LP, Added button-less end of current level
+;-
+
+
+function CW_PDMENU_EVENT, ev
+
+  WIDGET_CONTROL, ev.id, get_uvalue=uvalue
+
+  return, { ID:ev.handler, TOP:ev.top, HANDLER:0L, value:uvalue }
+
+end
+
+
+
+
+
+
+
+pro CW_PDMENU_BUILD, parent, desc, cur, n, ev_type, full_qual_str, $
+	delim, ids, mbars, HELP_KW, FONT=font
+; Recursive routine that builds the pulldown hierarchy described in DESC.
+; Returns the ID of each button in ids.
+
+  is_string = size(desc)
+  is_string = is_string[is_string[0]+1] eq 7
+  while (cur lt n) do begin
+    separator=0
+    if is_string then begin
+        ; String version of DESC structure
+	a = str_sep(desc[cur], '\')
+	dflags = fix(strtrim(a[0],2))
+        if dflags GT 3 then begin
+          separator = 1
+          dflags = dflags - 4
+        endif
+        ; End of the level, and no button
+        if dflags EQ 2 AND N_ELEMENTS(a) LT 2 then begin
+            ids[cur] = 0
+            cur = cur + 1
+            return
+        endif
+        dname = a[1]
+    endif else begin
+        ; Structure version of DESC structure
+        dflags = desc[cur].flags
+        if dflags GT 3 then begin
+          separator = 1
+          dflags = dflags - 4
+        endif
+        dname = desc[cur].name
+        ; End of the level, and no button
+        if dflags EQ 2 AND dname EQ '' then begin
+            ids[cur] = 0
+            cur = cur + 1
+            return
+        endif
+        a = ['', str_sep(dname, '\')]
+        dname = a[1]
+    endelse
+
+    if (strlen(full_qual_str) ne 0) then $
+      new_qstr = full_qual_str + delim + dname $
+    else new_qstr = dname
+    ;If parented to a menu bar, don't draw a frame.
+    if (dflags and 1) then menu=2-mbars else menu = 0
+    ;
+    ; Build string with approriate keywords and execute it
+    ;
+    strExecute = 'new = WIDGET_BUTTON(parent, value=dname, MENU=menu'
+    if ((mbars ne 0) and (HELP_KW ne 0) $
+        and (strupcase(dname) eq 'HELP')) then $
+      strExecute = strExecute + ', /HELP'
+    if (keyword_set(font)) then strExecute = strExecute + ',  FONT=font'
+    strExecute = strExecute + ', SEPARATOR=separator'
+    strExecute = strExecute + ')'
+
+    status = EXECUTE(strExecute)
+
+    ; Set requested Return value
+    case ev_type of
+      0: uvalue = cur
+      1: uvalue = new
+      2: uvalue = dname
+      3: uvalue = new_qstr
+    endcase
+    WIDGET_CONTROL, new, SET_UVALUE=uvalue
+
+    ; Register event procedure
+    if n_elements(a) ge 3 then WIDGET_CONTROL, new, EVENT_PRO=strtrim(a[2],2)
+    ids[cur] = new
+    cur = cur + 1
+
+    ; Pullright menu button, start new level
+    if (dflags and 1) then $
+      CW_PDMENU_BUILD,new,desc,cur,n,ev_type,$
+      new_qstr,delim,ids,mbars, 0,FONT=font
+
+    ; End of the current level
+    if ((dflags and 2) ne 0) then return
+  endwhile
+
+end
+
+
+
+
+
+
+function CW_PDMENU, parent, desc, COLUMN=column, DELIMITER=delim, FONT=font, $
+	IDS=ids, MBAR=mbar, HELP=HELP_KW, $
+	RETURN_ID=r_id, RETURN_INDEX=ignore, RETURN_NAME=r_name, $
+	RETURN_FULL_NAME=r_full_name, $
+	UVALUE=uvalue, UNAME = uname, XOFFSET=xoffset, YOFFSET=yoffset, $
+           _EXTRA = ex
+
+
+  IF (N_PARAMS() ne 2) THEN MESSAGE, 'Incorrect number of arguments'
+
+  ON_ERROR, 2						;return to caller
+
+  ; Set default values for the keywords
+  If KEYWORD_SET(column) then row = 0 else begin row = 1 & column = 0 & end
+  IF (N_ELEMENTS(delim) eq 0)	then delim = '.'
+  IF (N_ELEMENTS(uvalue) eq 0)	then uvalue = 0
+  IF (N_ELEMENTS(xoffset) eq 0)	then xoffset=0
+  IF (N_ELEMENTS(yoffset) eq 0)	then yoffset=0
+
+  ; How to interpret ev_type:
+  ;	0 - Return index
+  ;	1 - Return ID
+  ;	2 - Return name
+  ;	3 - Return fully qualified name.
+  ev_type = 0
+  if (keyword_set(r_id)) 	then ev_type = 1
+  if (keyword_set(r_name)) 	then ev_type = 2
+  if (keyword_set(r_full_name))	then ev_type = 3
+
+
+  n = n_elements(desc)
+  ids = lonarr(n)
+  mbars = KEYWORD_SET(mbar)
+  help_kw = KEYWORD_SET(HELP_KW)
+  if mbars then BEGIN
+    base = parent
+    if (keyword_set(uvalue)) then WIDGET_CONTROL, base, SET_UVALUE=uvalue, SET_UNAME=uname
+  ENDIF else BEGIN
+    base = widget_base(parent, COLUMN=column, UNAME = uname, $
+		     ROW=row, UVALUE=uvalue, XOFFSET=xoffset, YOFFSET=yoffset, _EXTRA = ex)
+  ENDELSE
+  WIDGET_CONTROL, base, EVENT_FUNC='CW_PDMENU_EVENT' 
+ CW_PDMENU_BUILD, base, desc, 0, n, ev_type, '', delim, ids, mbars, help_kw, $
+	FONT=font
+  return, base
+END
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro	(revision 51)
@@ -0,0 +1,163 @@
+pro cw_slide_slice_set_value, id, value
+@common
+   topid = findtopid(id)
+   domainid = widget_info(topid, find_by_uname = 'domain')
+   widget_control, domainid, get_value = boxzoom
+   if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x'
+   thickid  = widget_info(topid, find_by_uname = 'thickness')
+   widget_control, thickid, get_uvalue = thicknessuval
+   widget_control, thickid, get_value = thickness
+   thickness = thicknessuval.choix[thickness.droplist_select]
+   sliderid = widget_info(topid, find_by_uname = 'slider')
+   if type EQ 'y' then BEGIN
+      mini = floor(min([glamt, glamf], max = maxi))
+      maxi = ceil(maxi)-thickness
+      widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[0]<maxi}
+      thickness = boxzoom[1]-boxzoom[0]
+   ENDIF ELSE BEGIN 
+      mini = floor(min([gphit, gphif], max = maxi))
+      maxi = ceil(maxi)-thickness
+      widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[2]<maxi}
+      thickness = boxzoom[3]-boxzoom[2]
+   ENDELSE
+   thicknessval = thicknessuval.choix
+   index = where(thicknessval EQ thickness) & index = index[0]
+   if index EQ -1 then BEGIN 
+      index = 20
+      thicknessval[20] = strtrim(thickness, 1)
+      widget_control, thickid, set_value = thicknessval
+      widget_control, thickid, set_uvalue ={name:'thickness', choix:thicknessval}
+   endif
+   widget_control, thickid, set_value = {droplist_select:index}
+   return
+end
+;----------------------------------------------------------------------
+FUNCTION cw_slide_slice_event,  event
+@common
+   widget_control, event.id, get_uvalue=uval
+   domainid = widget_info(event.top, find_by_uname = 'domain')
+   thickid  = widget_info(event.handler, find_by_uname = 'thickness')
+   sliderid = widget_info(event.handler, find_by_uname = 'slider')
+;   uniteid  = widget_info(event.handler, find_by_uname = 'unite')
+   widget_control, domainid, get_value = boxzoom
+   if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x'
+   widget_control, thickid, get_uvalue = thicknessuval
+   widget_control, thickid, get_value = thickness
+   thickness = thicknessuval.choix[thickness.droplist_select]
+   widget_control, sliderid, get_value = slider & slider = slider.value
+
+   if uval.name EQ 'thickness' then begin
+      if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x'
+      if type EQ 'y' then BEGIN
+         mini = floor(min([glamt, glamf], max = maxi))
+         maxi = ceil(maxi)-thickness
+      ENDIF ELSE BEGIN 
+         mini = floor(min([gphit, gphif], max = maxi))
+         maxi = ceil(maxi)-thickness
+      ENDELSE
+      slider = slider<maxi
+      widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:slider}
+   endif
+
+;   widget_control, uniteid, get_value = unite
+;
+;
+;    if uval.name EQ 'unite' then begin
+;       domdef, boxzoom, gridtype = 'T'
+;       if unite EQ 'degre' then BEGIN
+;          if strpos(type,'y') NE -1 then begin
+;             mini = floor(min([glamt, glamf], max = maxi))
+;             maxi = ceil(maxi)
+; print, lon1, mini, maxi
+;             widget_control, sliderid, set_value = {value:lon1, slider_min_max:[mini, maxi]}
+;          ENDIF ELSE BEGIN 
+;             mini = floor(min([gphit, glamf], max = maxi))
+;             maxi = ceil(maxi)
+;             widget_control, sliderid, set_value = {value:lat1, slider_min_max:[mini, maxi]}
+;          ENDELSE
+;       ENDIF ELSE BEGIN
+;          if strpos(type,'y') NE -1 then BEGIN
+; print, 'ds if',firstxt, 0, jpi-1
+;             widget_control, sliderid, set_value = {value:firstxt, slider_min_max:[0, jpi-1]}
+;          ENDIF ELSE BEGIN 
+;             widget_control, sliderid, set_value = {value:firstyt, slider_min_max:[0, jpj-1]}
+;          ENDELSE
+;       ENDELSE
+;    endif
+;
+;   if unite EQ 'degre' then BEGIN
+   if type EQ 'y' then begin
+      boxzoom[0] = slider &  boxzoom[1] = slider+thickness
+   ENDIF ELSE BEGIN 
+      boxzoom[2] = slider &  boxzoom[3] = slider+thickness
+   ENDELSE 
+;    ENDIF ELSE BEGIN
+;       if strpos(type,'y') NE -1 then begin
+;          boxzoom[0] = glamt[slider, 0] &  boxzoom[1] = glamf[slider+thickness, 0]
+;       ENDIF ELSE BEGIN 
+;          boxzoom[2] = gphit[0, slider] &  boxzoom[3] = gphif[0, slider+thickness]
+;       ENDELSE 
+;    ENDELSE
+   widget_control, domainid, set_value = boxzoom
+   return, {CW_SLIDE_SLICE, ID:event.handler, TOP:event.top, HANDLER:0L}
+end
+;--------------------------------------------------------------------------------
+FUNCTION cw_slide_slice, parent, boxzoom = boxzoom, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _extra = ex
+@common
+;------------------------------------------------
+; cheking exclusive keywords
+   column = keyword_set(column)*(1-keyword_set(row))
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+;
+   base = widget_base(parent, ROW = row, COLUMN = column  $
+                      , EVENT_FUNC = 'cw_slide_slice_event' $
+                      , FUNC_GET_VALUE='cw_slide_slice_get_value' $
+                      , PRO_SET_VALUE='cw_slide_slice_set_value' $
+                      , ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname $
+                      , FRAME = frame, _extra = ex)   
+;------------------------------------------------
+   if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2]
+;    rien = cw_bgroup(base, ['degre', 'points'],/exclusive, /column, uname = 'unite', uvalue = {name:'unite'}, /return_name, set_value = 0, /no_release)
+   thicknessval = indgen(21)+1
+   thicknessval = string(thicknessval)
+   for i = 0, n_elements(thicknessval)-1 do thicknessval[i] = strtrim(thicknessval[i], 1)
+   droplistid = cw_droplist_pm(base, value = thicknessval, uname = 'thickness', uvalue = {name:'thickness', choix:thicknessval})
+;
+   if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x'
+   if type EQ 'y' then BEGIN
+      mini = floor(min([glamt, glamf], max = maxi))
+      thickness = boxzoom[1]-boxzoom[0]
+      maxi = ceil(maxi)-thickness
+      rien = cw_slider_pm(base, minimum = mini, maximum = (mini+1) > maxi $
+                          , value = mini > boxzoom[0] < maxi, /column, uname = 'slider' $
+                          , uvalue = {name:'slider'})
+   ENDIF ELSE BEGIN 
+      mini = floor(min([gphit, gphif], max = maxi))
+      thickness = boxzoom[3]-boxzoom[2]
+      maxi = ceil(maxi)-thickness
+      rien = cw_slider_pm(base, minimum = mini, maximum =  (mini+1) > maxi $
+                          , value = mini > boxzoom[2] < maxi, /column, uname = 'slider' $
+                          , uvalue = {name:'slider'})
+   ENDELSE
+   index = where(thicknessval EQ thickness) & index = index[0]
+   if index EQ -1 then BEGIN 
+      index = 20
+      thicknessval[20] = strtrim(thickness, 1)
+      widget_control, droplistid, set_value = thicknessval
+      widget_control, droplistid, set_uvalue ={name:'thickness', choix:thicknessval}
+   endif
+   widget_control, droplistid, set_value = {droplist_select:index}
+   
+;   if type EQ 'xt' then begin
+;       mini = floor(min([glamt,glamf], max = maxi))
+;       maxi = ceil(maxi)
+;    ENDIF ELSE BEGIN 
+;       mini = floor(min([gphit,gphif], max = maxi))
+;       maxi = ceil(maxi)
+;    ENDELSE
+   
+;------------------------------------------------
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro	(revision 51)
@@ -0,0 +1,227 @@
+;------------------------------------------------------------
+;------------------------------------------------------------
+;------------------------------------------------------------
+;+
+; NAME: cw_slider_pm
+;
+; PURPOSE: widget equivalent a WIDGET_SLIDER sauf qu'en plus on
+; dispose de 2 bouttons + et - pour deplacer le widget de +/- 1.
+;
+; CATEGORY: compound widget (aide a l''ecriture des widgets)
+;
+; CALLING SEQUENCE: id=cw_slider_pm(parent)
+; 
+; INPUTS:
+;         Parent: The widget ID of the parent widget.
+;
+; KEYWORD PARAMETERS:tous ceux de WIDGET_SLIDER
+;
+; OUTPUTS:
+;         The returned value of this function is the widget ID of the
+;         newly-created animation widget.
+;
+; COMMON BLOCKS: none
+;
+; SIDE EFFECTS: 
+;
+;  Widget Events Returned by the CW_SLIDER_PM Widget
+;
+;  Slider widgets generate events when the mouse is used to change
+;  their value. The event structure returned by the WIDGET_EVENT
+;  function is defined by the following statement:
+;
+;  {CW_SLIDER_PM, ID:0L, TOP:0L, HANDLER:0L, VALUE:0L, DRAG:0, OUT:0}
+;
+;  ID is the widget ID of the button generating the event. TOP is the
+;  widget ID of the top level widget containing ID.
+;  HANDLER contains the widget ID of the widget associated with the
+;  handler routine.
+;  VALUE returns the new value of the slider.
+;  DRAG returns integer 1 if the slider event was generated as part of
+;  a drag operation, or zero if the event was generated when the user
+;  had finished positioning the slider. Note that the slider widget
+;  only generates events during the drag operation if the DRAG keyword
+;  is set, and if the application is running under Motif. When the
+;  DRAG keyword is set, the DRAG field can be used to avoid
+;  computationally expensive operations until the user releases the
+;  slider.
+;  OUT:c''est un entier qui peut prendre 3 valeurs:
+;      1 : si on appuie sur + alors que le slider est deja aux max. rq:
+;      ds ce cas le slider reste au max
+;      -1: si on appuie sur - alors que le slider est deja aux min. rq:
+;      ds ce cas le slider reste au min
+;      0 : ds les autres cas!
+;
+;   Keywords to WIDGET_CONTROL
+;
+;   A number of keywords to the WIDGET_CONTROL procedure affect the
+;   behavior of cw_slider_pm widget: GET_VALUE and SET_VALUE.
+;       1) GET_VALUE
+;   widget_control,wid_id,get_value=resultat
+;   retourne ds la variable resultat une structure de 2 elements dont
+;   les noms sont inspires des mots cles que l''on peut passer a
+;   widget_control qd on utilise WIDGET_SLIDER:
+;            VALUE:the value setting of the widget
+;            SLIDER_MIN_MAX: a 2 elements array: The minimum and the
+;            maximum value of the range encompassed by the slider
+;       2) SET_VALUE
+;   widget_control,wid_id,set_value=impose
+;   permet de modifier l''etat de la slider bar comme on peut le faire
+;   pour WIDGET_SLIDER. Impose peut etre:
+;       a) un entier: donne la nouvelle  position of the slider.
+;       b) une structure qui peut avoir comme elements (de 1 a 3):
+;            VALUE:un entier qui donne la nouvelle  position of the slider.
+;            SLIDER_MIN:Set to a new minimum value for the specified
+;            slider widget.
+;            SLIDER_MAX:Set to a new minimum value for the specified
+;            slider widget.
+;
+; RESTRICTIONS:
+;
+; EXAMPLE: cf utiliser le programme founit i-dessous: testwid et la
+; procedure associee, testwid_event.
+;
+; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)
+;                      5/9/1999
+;-
+;------------------------------------------------------------
+;------------------------------------------------------------
+;------------------------------------------------------------
+; PRO testwid_event, event
+; ;   help, event, /STRUCT
+;    SliderBarId = widget_info(event.top,find_by_uname = 'c''est lui')
+;    widget_control, event.id, get_uvalue=uval
+;    if n_elements(uval) EQ 0 then return
+;    case uval of
+;       'done':widget_control, event.top, /destroy
+;       'slider_min':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, SliderBarId, set_value = {slider_min:value}
+;       END
+;       'slider_max':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, SliderBarId, set_value = {slider_max:value}
+;       END
+;       'slider_value':BEGIN 
+;          widget_control, event.id, get_value = value
+;          widget_control, SliderBarId, set_value = value
+;       END
+;       'get':BEGIN 
+;          widget_control, SliderBarId, get_value = value
+;          help,  value, /struct
+;          print, value.slider_min_max
+;       END
+;       ELSE:
+;    endcase
+;    return
+; end
+; PRO testwid, _extra = ex
+;    base=widget_base(/COLUMN)
+; print, 'base=', base
+;    nothing = widget_label(base, value = 'beginning of the test')
+; ;
+;    nothing = cw_slider_pm(base, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui')
+; print, 'cw_slider_pm ID =', nothing
+; ;
+;    nothing = widget_label(base, value = 'end of the test')
+;    nothing = widget_text(base, value = '0', uvalue = 'slider_min', /editable)
+;    nothing = widget_text(base, value = '10', uvalue = 'slider_max', /editable)
+;    nothing = widget_text(base, value = '5', uvalue = 'slider_value', /editable)
+;    nothing = widget_button(base, value = 'get', uvalue = 'get')
+;    nothing = widget_button(base, value = 'done', uvalue = 'done')
+;    widget_control, base, /REALIZE
+;    xmanager,'testwid', base
+;    return
+; end
+;----------------------------------------------------------------------
+PRO cw_slider_pm_set_value, id, value
+   SliderBarId = widget_info(id,find_by_uname = 'SliderBar')
+   if size(value, /type) eq 8 then BEGIN ; this is a structure
+      tagnames = tag_names(value)
+      for tag = 0, n_tags(value)-1 do begin
+         case strtrim(strlowcase(tagnames[tag]), 2) of
+            'slider_min':widget_control, SliderBarId, set_slider_min = value.slider_min
+            'slider_max':widget_control, SliderBarId, set_slider_max = value.slider_max
+            'value':widget_control, SliderBarId, set_value = value.value
+            ELSE:ras = report('mauvais nom de l''argument de la structure ds cw_slider_pm_set_value')
+         endcase
+      endfor
+   ENDIF ELSE widget_control, SliderBarId, set_value = value[0]
+   return
+end
+;----------------------------------------------------------------------
+FUNCTION cw_slider_pm_get_value, id
+   SliderBarId = widget_info(id,find_by_uname = 'SliderBar')
+   widget_control, SliderBarId, get_value = value
+   return, {value:value, slider_min_max:widget_info(SliderBarId, /slider_min_max)}
+end
+;----------------------------------------------------------------------
+FUNCTION cw_slider_pm_event, event
+   widget_control, event.id, get_uvalue=uval
+;
+   if uval EQ 'SliderBar' then $
+    return, {CW_SLIDER_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+             , VALUE:event.value, OUT:0}
+;
+   SliderBarId = widget_info(event.handler,find_by_uname = 'SliderBar')
+   minmax = widget_info(SliderBarId, /SLIDER_MIN_MAX)
+   widget_control, SliderBarId, get_value = value
+   case uval OF
+      'plus':BEGIN
+         if value NE minmax[1] then widget_control, SliderBarId,set_value = value+1
+         return, {CW_SLIDER_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+                  , VALUE:(value+1) < minmax[1], OUT:long(value eq minmax[1])}
+      END
+      'minus':BEGIN
+         if value NE minmax[0] then widget_control, SliderBarId,set_value = value-1
+         return, {CW_SLIDER_PM, ID:event.handler, TOP:event.top, HANDLER:0L $
+                  , VALUE:0 > (value-1), OUT:-long(value EQ minmax[0])}
+      END
+   endcase
+end
+;----------------------------------------------------------------------
+FUNCTION cw_slider_pm, parent, ROW = row, COLUMN = column, VERTICAL = vertical, UVALUE = uvalue, UNAME = uname, _extra = ex
+
+   IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments'
+   ON_ERROR, 2                  ;return to caller
+;
+; cheking exclusive keywords
+   column = (keyword_set(column)*(1-keyword_set(row))+keyword_set(vertical)) < 1
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+   base = widget_base(parent, space = 1, xpad = 1, ypad = 1 $
+                      , EVENT_FUNC = 'cw_slider_pm_event' $
+                      , FUNC_GET_VALUE='cw_slider_pm_get_value' $
+                      , PRO_SET_VALUE='cw_slider_pm_set_value' $
+                      , ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, _extra = ex)   
+;
+   if keyword_set(vertical) then BEGIN
+      if keyword_set(row) then begin
+         nothing = widget_slider(base, /VERTICAL, UVALUE = 'SliderBar', UNAME = 'SliderBar', _extra = ex)
+         base1 = widget_base(base, space = 1, xpad = 1, ypad = 1 $
+                             , /column, /align_center)
+         nothing = widget_button(base1,value= '+', uvalue='plus', xsize = 15, ysize = 15)
+         nothing = widget_button(base1,value= '-', uvalue='minus', xsize = 15, ysize = 15)
+      ENDIF ELSE BEGIN 
+         nothing = widget_button(base,value= '+', uvalue='plus', xsize = 15, ysize = 15)
+         nothing = widget_slider(base, /VERTICAL, UVALUE = 'SliderBar', UNAME = 'SliderBar', _extra = ex)
+         nothing = widget_button(base,value= '-', uvalue='minus', xsize = 15, ysize = 15)
+      ENDELSE
+   ENDIF ELSE BEGIN
+      if keyword_set(row) then begin
+         nothing = widget_button(base,value= '-', uvalue='minus', xsize = 15, ysize = 15)
+         nothing = widget_slider(base, UVALUE = 'SliderBar', UNAME = 'SliderBar', _extra = ex)
+         nothing = widget_button(base,value= '+', uvalue='plus', xsize = 15, ysize = 15)
+      ENDIF ELSE BEGIN 
+         nothing = widget_slider(base, UVALUE = 'SliderBar', UNAME = 'SliderBar', _extra = ex)
+         base1 = widget_base(base, space = 1, xpad = 1, ypad = 1 $
+                             , /row, /align_center)
+         nothing = widget_button(base1,value= '-', uvalue='minus', xsize = 15, ysize = 15)
+         nothing = widget_button(base1,value= '+', uvalue='plus', xsize = 15, ysize = 15)
+      ENDELSE
+   ENDELSE
+;
+;
+   return, base
+end
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro	(revision 51)
@@ -0,0 +1,139 @@
+;*****************************************************
+;*****************************************************
+PRO cw_specifie_set_value, id, value
+   if size(value, /type) NE 8 then return
+   widget_control, widget_info(id,find_by_uname='min'), set_value = strtrim(value.min, 2)
+   widget_control, widget_info(id,find_by_uname='max'), set_value = strtrim(value.max, 2)
+   widget_control, widget_info(id,find_by_uname='int'), set_value = strtrim(value.inter, 2)
+   widget_control, widget_info(id,find_by_uname='palnum'), set_value = strtrim(value.lct, 2)
+   autres = extractstru(value, ['min', 'max', 'inter', 'lct', 'nothing', 'xindex', 'yindex'])
+   if size(autres, /type) EQ 8 then BEGIN 
+      autresid = widget_info(id,find_by_uname='autres')
+      widget_control, widget_info(id,find_by_uname='autres'), get_value = autresautres
+      autresautres = autresautres[0]
+      if strtrim(autresautres, 2) NE '' then begin
+         nothing = execute('autresautres = get_extra('+autresautres+')')
+         autres = mixstru(autres, autresautres)
+      endif
+      autres = strkeywd(autres)
+      widget_control, widget_info(id,find_by_uname='autres'), set_value = autres
+   endif
+   return
+end
+;*****************************************************
+;*****************************************************
+FUNCTION cw_specifie_get_value, id
+   widget_control, widget_info(id,find_by_uname='min'), get_value = min
+   min = float(min[0])
+   widget_control, widget_info(id,find_by_uname='max'), get_value = max
+   max = float(max[0])
+   widget_control, widget_info(id,find_by_uname='int'), get_value = int
+   int = float(int[0])
+   widget_control, widget_info(id,find_by_uname='palnum'), get_value = palnum
+   palnum = long(palnum[0])
+   widget_control, widget_info(id,find_by_uname='autres'), get_value = autres
+   autres = autres[0]
+;
+   exextra = {min:min, max:max, inter:int, lct:palnum}
+   if strtrim(autres, 2) NE '' then $
+    rien = execute('exextra = get_extra('+autres+', _extra = exextra)')
+   return, exextra
+end
+;*****************************************************
+;*****************************************************
+FUNCTION cw_specifie_event, event
+;------------------------------------------------------------
+; on recuper les ID des differents widgets 
+;------------------------------------------------------------
+;------------------------------------------------------------
+   widget_control, event.id, get_uvalue = uval
+   widget_control, event.top, get_uvalue = top_uvalue
+   smallin = extractatt(top_uvalue, 'smallin')
+   numdessinin = smallin[2]-1
+   smallout = extractatt(top_uvalue, 'smallout')
+   numdessinout = smallout[2]-1
+;------------------------------------------------------------
+   case uval of
+      'default':BEGIN 
+;---------------
+; on trouve le nom de la variable:
+;---------------
+         champid = widget_info(event.top, find_by_uname = 'champ')
+         currentfile = extractatt(top_uvalue, 'currentfile')
+         listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar
+         varname = listvar[widget_info(champid, /droplist_select)]
+;---------------
+         exextra = definedefaultextra(varname)
+         widget_control, widget_info(event.handler,find_by_uname='min'), set_value = strtrim(exextra.min, 1)
+         widget_control, widget_info(event.handler,find_by_uname='max'), set_value = strtrim(exextra.max, 1)
+         widget_control, widget_info(event.handler,find_by_uname='int'), set_value = strtrim(exextra.inter, 1)
+         widget_control, widget_info(event.handler,find_by_uname='palnum'), set_value = strtrim(exextra.lct, 1)
+         widget_control, widget_info(event.handler,find_by_uname='autres'), set_value = ''
+      END
+      'palcol':BEGIN 
+         ind = fix(strmid(event.value, 0, strpos(event.value, '-')))
+         widget_control, widget_info(event.handler,find_by_uname='palnum'), set_value = strtrim(ind, 1)
+      END
+      'ok':
+      ELSE:
+   endcase
+   return,{ID:event.handler, TOP:event.top, HANDLER:0L, OK:uval EQ 'ok'}
+end
+;*****************************************************
+;*****************************************************
+FUNCTION cw_specifie, parent, ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, FRAME = frame, FORXXX = forxxx, _extra = ex
+; cheking exclusive keywords
+   column = keyword_set(column)*(1-keyword_set(row))
+   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 
+;------------------------------------------------
+   if NOT keyword_set(uvalue) then uvalue = ''
+   if NOT keyword_set(uname) then uname = ''
+   base = widget_base(parent, ROW = row, COLUMN = column  $
+                      , EVENT_FUNC = 'cw_specifie_event' $
+                      , FUNC_GET_VALUE='cw_specifie_get_value' $
+                      , PRO_SET_VALUE='cw_specifie_set_value' $
+                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
+; base1 pour specifier le min, le max et l''intervalle
+   base1 = widget_base(base, /row, /frame)
+   rien = widget_label(base1, value = 'Min')
+   rien = widget_text(base1, value = '', /editable, xsize = 5, uname = 'min', uvalue = 'min')
+   rien = widget_label(base1, value = 'Max')
+   rien = widget_text(base1, value = '', /editable, xsize = 5, uname = 'max', uvalue = 'max')
+   rien = widget_label(base1, value = 'Int')
+   rien = widget_text(base1, value = '', /editable, xsize = 5, uname = 'int', uvalue = 'int')
+; base2 por specifier la palette de couleur (soit par numero soit ds
+; un menu deroulant)
+   if keyword_set(FORXXX) then base2 = widget_base(base, /row, /frame) ELSE base2 = base1
+   rien = widget_label(base2, value = 'Pal Numb')
+   if keyword_set(forxxx) then colvalue = '' ELSE colvalue = '39'
+   rien = widget_text(base2, value = colvalue, /editable, xsize = 3, uname = 'palnum', uvalue = 'palnum')
+   lct,  get_name = nomcouleur
+   nbrligne = 30
+   nbrlist = n_elements(nomcouleur)/nbrligne
+   nomcouleur = strtrim(sindgen(n_elements(nomcouleur)), 1)+'- '+nomcouleur
+   nomcouleur = '0\'+nomcouleur
+   nomcouleur = ['1\color palette', nomcouleur]
+   if nbrlist GT 1 then for i = 1,nbrlist do $
+    nomcouleur = [nomcouleur[0:nbrligne*i-1+i], '1\ ', nomcouleur[nbrligne*i+i:n_elements(nomcouleur)-1]]
+   rien = cw_pdmenu(base2,nomcouleur, /RETURN_NAME , uvalue = 'palcol', uname = 'palcol')
+
+; baseavantfin pour passer tous les mots cles possibles...
+; widget text contennant les autres mots cles passe ds top_uvalue.exextra
+; en reste-t-il? si oui, il faut les mettres sous forme de string
+
+   baseavantfin = widget_base(base, /row, /frame)
+   rien = widget_label(baseavantfin, value = 'Keywords')
+   rien = widget_text(baseavantfin, value = '  ', /editable, uname = 'autres', uvalue = 'autres', scr_xsize = 400)
+   if keyword_set(forxxx)  then begin
+; basefin pour en finir, 2 boutons: Default/OK
+      basefin = widget_base(base, /row, /frame, /align_center)
+      rien = widget_button(basefin,value='Default', uvalue = 'default')
+      rien = widget_button(basefin,value='OK', uvalue = 'ok')
+; on intialise les widget_text:
+      cw_specifie_set_value, base, definedefaultextra('rien_du_tout')
+   endif
+
+;------------------------------------------------
+   return, base
+end
+
Index: /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/testwid.pro
===================================================================
--- /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/testwid.pro	(revision 51)
+++ /trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/testwid.pro	(revision 51)
@@ -0,0 +1,34 @@
+PRO testwid_event, event
+    DroplistId = widget_info(event.top,find_by_uname = 'c''est lui')
+   widget_control, event.id, get_uvalue=uval
+   if n_elements(uval) EQ 0 then return
+   case uval of
+      'done':widget_control, event.top, /destroy
+      'set':BEGIN 
+         widget_control, event.id, get_value = value
+         widget_control, DroplistId, set_value = value
+      END
+      'get':BEGIN 
+         widget_control, DroplistId, get_value = value
+         help,  value, /struct
+      END
+      ELSE:
+   endcase
+   return
+end
+PRO testwid, calendar, date0, _extra = ex
+   base=widget_base(/COLUMN)
+print, 'base=', base
+   nothing = widget_label(base, value = 'beginning of the test')
+;
+   nothing = cw_calendar(base,calendar, date0, _extra = ex, uname = 'c''est lui', uvalue = 'c''est lui' )
+print, 'cw_calendar ID =', nothing
+;
+   nothing = widget_label(base, value = 'end of the test')
+    nothing = widget_text(base, value = string(calendar[0]), uvalue = 'set', /editable)
+    nothing = widget_button(base, value = 'get', uvalue = 'get')
+    nothing = widget_button(base, value = 'done', uvalue = 'done')
+   widget_control, base, /REALIZE
+   xmanager,'testwid', base
+   return
+end
