;********************************************************************* ;********************************************************************* FUNCTION cw_pagelayout_event, event ; compile_opt idl2, strictarrsubs ; 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') flag = flags[*, numdessinin] ; ; update and reset all values of the 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) ; *top_uvalue[1, findline(top_uvalue, 'nameprocedures')] = strarr(nbredessin) *top_uvalue[1, findline(top_uvalue, 'types')] = strarr(nbredessin) *top_uvalue[1, findline(top_uvalue, 'varinfo')] = strarr(2, nbredessin) *top_uvalue[1, findline(top_uvalue, 'domaines')] = fltarr(6, nbredessin) *top_uvalue[1, findline(top_uvalue, 'dates')] = lonarr(2, nbredessin) *top_uvalue[1, findline(top_uvalue, 'txtcmd')] = strarr(nbredessin) *top_uvalue[1, findline(top_uvalue, 'optionsflag')] = flag#replicate(1, nbredessin) ; 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_pagelayout, parent, small, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, COLUMN = column, ROW = row, _extra = ex ;------------------------------------------------ ; compile_opt idl2, strictarrsubs ; row = keyword_set(row)*(1-keyword_set(column)) if NOT keyword_set(uvalue) then uvalue = '' if NOT keyword_set(uname) then uname = '' base = widget_base(parent $ , EVENT_FUNC = 'cw_pagelayout_event' $ , FUNC_GET_VALUE = 'cw_pagelayout_get_value' $ , PRO_SET_VALUE = 'cw_pagelayout_set_value' $ , UVALUE = uvalue, UNAME = uname, space = 0, _extra = ex) ;------------------------------------------------ IF n_elements(small) eq 0 then small = [1, 1, 1] ; dummy = widget_label(base, value = 'cln', yoffset = 3) id = widget_combobox(base, value = strtrim(indgen(9)+1, 1), uvalue = {name:'column'} $ , uname = 'column', xoffset = 20, xsize = 40) widget_control, id, set_combobox_select = small[0]-1 ; IF keyword_set(row) THEN BEGIN xoff = 60 yoff = 0 ENDIF ELSE BEGIN xoff = 0 yoff = 20 ENDELSE dummy = widget_label(base, value = 'row', xoffset = xoff, yoffset = yoff+3) id = widget_combobox(base, value = strtrim(indgen(9)+1, 1), uvalue = {name:'row'} $ , uname = 'row', xoffset = xoff+20, xsize = 40, yoffset = yoff) widget_control, id, set_combobox_select = small[1]-1 ;------------------------------------------------ ;------------------------------------------------ return, base end ;*********************************************************************