source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/updatewidget.pro @ 231

Last change on this file since 231 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
RevLine 
[150]1;+
[231]2;
[150]3; @file_comments
4;
5; @categories
6;
7; @param BASE {in}{required}
8; The id of the widget where apply the drawing.
[231]9;
[150]10; @keyword NOBOXZOOM
11;
12; @keyword NODATES
13;
[231]14; @keyword NOTYPE
[150]15;
16; @returns
[231]17;
[150]18; @uses
[231]19;
[150]20; @restrictions
[231]21;
[150]22; @examples
[231]23;
[150]24; @history
[231]25;
[150]26; @version
[231]27; $Id$
28;
[150]29; @todo
30; seb
31;
32;-
[231]33;
[49]34PRO updatewidget, base, NOBOXZOOM = noboxzoom, NODATES = nodates, NOTYPE = notype
[114]35;
36  compile_opt idl2, strictarrsubs
37;
[2]38   widget_control,base, get_uvalue = top_uvalue
[49]39   smallin = extractatt(top_uvalue, 'smallin')
40   numdessinin = smallin[2]-1
[2]41;
42;----------------------------------------------------------------------
43   widget_control, base, update = 0
44;--------------
45; date1 et date2
46;--------------
47   if keyword_set(nodates) then begin
48      date1 = 0
[231]49      date2 = 0
50   ENDIF ELSE BEGIN
[2]51      dates = (extractatt(top_uvalue, 'dates'))[*, numdessinin]
52      date1 = dates[0] & date2 = dates[1]
53   ENDELSE
54;--------------
[69]55; domain
[2]56;--------------
[49]57   boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin]
58   if total(boxzoom) EQ 0 then boxzoom = -1
59   if keyword_set(noboxzoom) then boxzoom = 0
[2]60;--------------
[69]61; varinfo: filename & namevar
[2]62;--------------
[69]63   varinfo = (extractatt(top_uvalue, 'varinfo'))[*, numdessinin]
64   filename = varinfo[0] & nomvar = varinfo[1]
[2]65;
66   if filename NE '' OR nomvar NE '' THEN BEGIN
[49]67      changefile, base, filename, fieldname = nomvar, BOXZOOM = boxzoom, DATE1 = date1, DATE2 = date2
[2]68   ENDIF ELSE BEGIN
69      if date1 NE 0 then begin
70         date1id = widget_info(base, find_by_uname = 'calendar1')
71         widget_control, date1id, set_value = date1
72      endif
73      if date2 NE 0 then begin
74         date2id = widget_info(base, find_by_uname = 'calendar2')
75         widget_control, date2id, set_value = date2
76      endif
[231]77      if keyword_set(boxzoom) then BEGIN
[2]78         domainid = widget_info(base, find_by_uname = 'domain')
[49]79         widget_control, domainid, set_value = boxzoom
[2]80      endif
81   ENDELSE
82;--------------
83; exextra
84;--------------
85   if n_elements(*((extractatt(top_uvalue, 'exextra'))[numdessinin])) NE 0 then begin
86      exextra = *((extractatt(top_uvalue, 'exextra'))[numdessinin])
87      specifieid = widget_info(base,find_by_uname = 'specifie')
88      widget_control, specifieid, set_value = exextra
89   endif
90;--------------
[69]91; text command
[2]92;--------------
[69]93   txtcmd = (extractatt(top_uvalue,  'txtcmd'))[numdessinin]
94   if txtcmd NE '' then begin
95      txtcmdid = widget_info(base, find_by_uname = 'txtcmd')
96      widget_control, txtcmdid, set_value = txtcmd
[2]97   endif
98;--------------
99; graphtype
[231]100;--------------
[2]101   if NOT keyword_set(notype) then BEGIN
102      graphtype = (extractatt(top_uvalue, 'types'))[numdessinin]
103      if graphtype NE '' then begin
104         actionid = widget_info(base,find_by_uname = 'action')
[69]105         widget_control, actionid, get_value = action_value
106         widget_control, actionid, set_combobox_select = (where(action_value EQ graphtype))[0]
[2]107      endif
108   endif
109;--------------
110   widget_control, base, update = 1
111;--------------
112;----------------------------------------------------------------------
113   return
114end
Note: See TracBrowser for help on using the repository browser.