source: trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_miseenpage.pro @ 51

Last change on this file since 51 was 51, checked in by pinsard, 18 years ago

upgrade of COMPOUND_WIDGET according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 5.7 KB
Line 
1;*********************************************************************
2;*********************************************************************
3FUNCTION cw_miseenpage_event, event
4
5   widget_control, event.id, get_uvalue=uval
6   widget_control, event.top, get_uvalue=top_uvalue
7;
8   smallin = extractatt(top_uvalue, 'smallin')
9   numdessinin = smallin[2]-1
10   smallout = extractatt(top_uvalue, 'smallout')
11;
12   if uval.name EQ 'undo' then begin
13      return,{ID:event.handler, TOP:event.top, HANDLER:0L}
14   ENDIF ELSE BEGIN
15;
16@common
17; si on ne change pas le nombre de colonnes, on sort
18      if uval.name EQ 'column' then $
19       if event.index+1 EQ smallin[0] THEN $
20       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
21; si on ne change pas le nombre de lignes, on sort
22      if uval.name EQ 'row' then $
23       if event.index+1 EQ smallin[1] THEN $
24       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
25;
26; on efface la page
27;      graphid = widget_info(event.top,find_by_uname = 'graph')
28      graphid = extractatt(top_uvalue, 'graphid')
29      widget_control,graphid,get_value=win
30      wset, win
31      erase, 255
32      case uval.name of
33         'clear':
34         'column':BEGIN
35            smallin = [event.index+1, smallin[1], 1]
36            smallout = [event.index+1, smallout[1], 1]
37         END
38         'row':BEGIN
39            smallin = [smallin[0], event.index+1, 1]
40            smallout = [smallout[0], event.index+1, 1]
41         END
42      endcase
43      nbredessin = smallin[0]*smallin[1]
44;         
45; on remet tout a 0 en ce qui concerne les postscripts
46      createhistory, event.top, smallin
47;         
48         options = extractatt(top_uvalue, 'options')   
49         flags = extractatt(top_uvalue, 'optionsflag')
50         xlonindex = where(options EQ 'Longitude / x index')
51         xlonflag = flags[xlonindex, numdessinin] & xlonflag = xlonflag[0]
52         ylatindex = where(options EQ 'Latitude / y index')
53         ylatflag = flags[ylatindex, numdessinin] & ylatflag = ylatflag[0]
54;         
55      flag = [1, key_portrait, 0, 0, 0, 0]
56      flag[xlonindex] = xlonflag
57      flag[ylatindex] = ylatflag
58;         
59; actualisation de la top_uvalue...
60;
61      *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
62      *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout
63;
64      *top_uvalue[1, findline(top_uvalue, 'penvs')] = replicate(!p, nbredessin)
65      *top_uvalue[1, findline(top_uvalue, 'xenvs')] = replicate(!x, nbredessin)
66      *top_uvalue[1, findline(top_uvalue, 'yenvs')] = replicate(!y, nbredessin)
67;
68      old = (extractatt(top_uvalue, 'nameprocedures'))[numdessinin]
69      new = strarr(nbredessin)
70      new[0] = old
71      *top_uvalue[1, findline(top_uvalue, 'nameprocedures')] = new
72;
73      old = (extractatt(top_uvalue, 'types'))[numdessinin]
74      new = strarr(nbredessin)
75      new[0] = old
76      *top_uvalue[1, findline(top_uvalue, 'types')] = new
77;
78      old = (extractatt(top_uvalue,  'champs'))[*, numdessinin]
79      new = strarr(2, nbredessin)
80      new[*, 0] = old
81      *top_uvalue[1, findline(top_uvalue, 'champs')] = new
82;
83      old = (extractatt(top_uvalue, 'domaines'))[*, numdessinin]
84      new = fltarr(6, nbredessin)
85      new[*, 0] = old
86      *top_uvalue[1, findline(top_uvalue, 'domaines')] = new
87;
88      old = (extractatt(top_uvalue, 'dates'))[*, numdessinin]
89      new = lonarr(2, nbredessin)
90      new[*, 0] = old
91      *top_uvalue[1, findline(top_uvalue, 'dates')] = new
92;
93      old = (extractatt(top_uvalue,  'prefixes'))[numdessinin]
94      new = strarr(nbredessin)
95      new[0] = old
96      *top_uvalue[1, findline(top_uvalue, 'prefixes')] = new
97;
98      new = flag#replicate(1, nbredessin)
99      *top_uvalue[1, findline(top_uvalue, 'optionsflag')] = new
100;
101      ptr_free, extractatt(top_uvalue, 'exextra')
102      *top_uvalue[1, findline(top_uvalue, 'exextra')] = ptrarr(nbredessin, /allocate_heap)
103;      *top_uvalue[1, findline(top_uvalue, '')] =
104;
105   ENDELSE
106
107   return,{ID:event.handler, TOP:event.top, HANDLER:0L}
108end
109;*********************************************************************
110FUNCTION cw_miseenpage, parent, small, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex
111; cheking exclusive keywords
112   column = keyword_set(column)*(1-keyword_set(row))
113   row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column)
114;------------------------------------------------
115   if NOT keyword_set(uvalue) then uvalue = ''
116   if NOT keyword_set(uname) then uname = ''
117   base = widget_base(parent, ROW = row, COLUMN = column  $
118                      , EVENT_FUNC = 'cw_miseenpage_event' $
119                      , FUNC_GET_VALUE='cw_miseenpage_get_value' $
120                      , PRO_SET_VALUE='cw_miseenpage_set_value' $
121                      , UVALUE = uvalue, UNAME = uname, _extra = ex)   
122;------------------------------------------------
123   IF n_elements(small) eq 0 then small = [1, 1, 1]
124   basedroplist = widget_base(base, /column, /align_center)
125   id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title ='column' $
126                        , uvalue ={name:'column'}, uname='column')
127   widget_control, id, set_droplist_select = small[0]-1
128   id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title =' row ' $
129                        , uvalue ={name:'row'}, uname='row')
130   widget_control, id, set_droplist_select = small[1]-1
131   basebutton = widget_base(base, /column, /align_center)
132   rien = widget_button(basebutton, value = 'Clear', uvalue ={name:'clear'}, uname='clear')
133   rien = widget_button(basebutton, value = 'Undo', uvalue ={name:'undo'}, uname='undo')
134;------------------------------------------------
135;------------------------------------------------
136   return, base
137end
138;*********************************************************************
Note: See TracBrowser for help on using the repository browser.