;********************************************************************* ;********************************************************************* FUNCTION cw_miseenpage_event, event widget_control, event.id, get_uvalue=uval widget_control, event.top, get_uvalue=top_uvalue ; petitin = extractatt(top_uvalue, 'petitin') numdessinin = petitin[2]-1 petitout = extractatt(top_uvalue, 'petitout') ; 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 petitin[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 petitin[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 petitin = [event.index+1, petitin[1], 1] petitout = [event.index+1, petitout[1], 1] END 'row':BEGIN petitin = [petitin[0], event.index+1, 1] petitout = [petitout[0], event.index+1, 1] END endcase nbredessin = petitin[0]*petitin[1] ; ; on remet tout a 0 en ce qui concerne les postscripts createhistory, event.top, petitin ; 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, 'petitin')] = petitin *top_uvalue[1, findline(top_uvalue, 'petitout')] = petitout ; *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, petit, 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(petit) eq 0 then petit = [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 = petit[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 = petit[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 ;*********************************************************************