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

Last change on this file since 150 was 150, checked in by navarro, 18 years ago

english and nicer header (3a)

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