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

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

typo

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1;+
2;
3; @file_comments
4;
5; @categories
6;
7; @param BASE {in}{required}
8; The id of the widget where apply the drawing.
9;
10; @keyword NOBOXZOOM
11;
12; @keyword NODATES
13;
14; @keyword NOTYPE
15;
16; @returns
17;
18; @uses
19;
20; @restrictions
21;
22; @examples
23;
24; @history
25;
26; @version
27; $Id$
28;
29; @todo
30; seb
31;
32;-
33;
34PRO updatewidget, base, NOBOXZOOM = noboxzoom, NODATES = nodates, NOTYPE = notype
35;
36  compile_opt idl2, strictarrsubs
37;
38   widget_control,base, get_uvalue = top_uvalue
39   smallin = extractatt(top_uvalue, 'smallin')
40   numdessinin = smallin[2]-1
41;
42;----------------------------------------------------------------------
43   widget_control, base, update = 0
44;--------------
45; date1 and date2
46;--------------
47   if keyword_set(nodates) then begin
48      date1 = 0
49      date2 = 0
50   ENDIF ELSE BEGIN
51      dates = (extractatt(top_uvalue, 'dates'))[*, numdessinin]
52      date1 = dates[0] & date2 = dates[1]
53   ENDELSE
54;--------------
55; domain
56;--------------
57   boxzoom = (extractatt(top_uvalue, 'domaines'))[*, numdessinin]
58   if total(boxzoom) EQ 0 then boxzoom = -1
59   if keyword_set(noboxzoom) then boxzoom = 0
60;--------------
61; varinfo: filename & namevar
62;--------------
63   varinfo = (extractatt(top_uvalue, 'varinfo'))[*, numdessinin]
64   filename = varinfo[0] & nomvar = varinfo[1]
65;
66   if filename NE '' OR nomvar NE '' THEN BEGIN
67      changefile, base, filename, fieldname = nomvar, BOXZOOM = boxzoom, DATE1 = date1, DATE2 = date2
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
77      if keyword_set(boxzoom) then BEGIN
78         domainid = widget_info(base, find_by_uname = 'domain')
79         widget_control, domainid, set_value = boxzoom
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;--------------
91; text command
92;--------------
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
97   endif
98;--------------
99; graphtype
100;--------------
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')
105         widget_control, actionid, get_value = action_value
106         widget_control, actionid, set_combobox_select = (where(action_value EQ graphtype))[0]
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.