PRO changefield, base, newfieldname, BOXZOOM = boxzoom ; ; compile_opt idl2, strictarrsubs ; widget_control, base, get_uvalue = top_uvalue ; ; Change exextra : exextra = definedefaultextra(newfieldname) specifieid = widget_info(base, find_by_uname = 'specifie') widget_control, specifieid, set_value = exextra ; Change the variable -> Do we need to change the vertical axis ; according to the tye of points (T or W)? dthlv1id = widget_info(base, find_by_uname = 'dthlv1') widget_control, dthlv1id, get_uvalue = dthlv1_uval oldzgridt = dthlv1_uval.grid_t ; get the type of point currentfile = extractatt(top_uvalue, 'currentfile') listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar ; for i = 0, n_elements(listvar)-1 do print, listvar[i], '/', listgrid[i] indexvar = where(listvar EQ newfieldname) indexvar = 0 > indexvar[0] zgridt = strupcase(listgrid[indexvar]) NE 'W' ; if we change the type of point if zgridt NE oldzgridt then BEGIN ; update dthlv1_uval.grid_t dthlv1_uval.grid_t = zgridt widget_control, dthlv1id, set_uvalue = dthlv1_uval ; update cw_domain if NOT keyword_set(boxzoom) THEN $ widget_control, widget_info(base, find_by_uname = 'domain'), get_value = boxzoom widget_control, widget_info(base, find_by_uname = 'domain'), set_value = boxzoom endif ; return end