source: trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/changefield.pro @ 69

Last change on this file since 69 was 69, checked in by smasson, 18 years ago

debug + new xxx

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1PRO changefield, base, newfieldname, BOXZOOM = boxzoom
2;
3  widget_control, base, get_uvalue = top_uvalue
4;
5; Change exextra :
6  exextra = definedefaultextra(newfieldname)
7  specifieid = widget_info(base, find_by_uname = 'specifie')
8  widget_control, specifieid, set_value = exextra
9; Change the variable -> Do we need to change the vertical axis
10; according to the tye of points (T or W)?
11  dthlv1id = widget_info(base, find_by_uname = 'dthlv1')
12  widget_control, dthlv1id, get_uvalue = dthlv1_uval
13  oldzgridt = dthlv1_uval.grid_t
14; get the type of point
15  currentfile = extractatt(top_uvalue, 'currentfile')
16  listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid
17  listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar
18;   for i = 0,  n_elements(listvar)-1 do print,  listvar[i], '/', listgrid[i]
19  indexvar = where(listvar EQ newfieldname)
20  indexvar = 0 > indexvar[0]
21  zgridt = strupcase(listgrid[indexvar]) NE 'W'
22; if we change the type of point
23  if zgridt NE oldzgridt then BEGIN
24; update dthlv1_uval.grid_t
25    dthlv1_uval.grid_t = zgridt
26    widget_control, dthlv1id, set_uvalue = dthlv1_uval
27; update cw_domain
28    if NOT keyword_set(boxzoom) THEN $
29       widget_control, widget_info(base, find_by_uname = 'domain'), get_value = boxzoom
30    widget_control, widget_info(base, find_by_uname = 'domain'), set_value = boxzoom
31  endif
32;
33  return
34end
Note: See TracBrowser for help on using the repository browser.