1 | ;********************************************************************* |
---|
2 | ;********************************************************************* |
---|
3 | FUNCTION cw_miseenpage_event, event |
---|
4 | |
---|
5 | widget_control, event.id, get_uvalue=uval |
---|
6 | widget_control, event.top, get_uvalue=top_uvalue |
---|
7 | ; |
---|
8 | petitin = extractatt(top_uvalue, 'petitin') |
---|
9 | numdessinin = petitin[2]-1 |
---|
10 | petitout = extractatt(top_uvalue, 'petitout') |
---|
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 petitin[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 petitin[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 | petitin = [event.index+1, petitin[1], 1] |
---|
36 | petitout = [event.index+1, petitout[1], 1] |
---|
37 | END |
---|
38 | 'row':BEGIN |
---|
39 | petitin = [petitin[0], event.index+1, 1] |
---|
40 | petitout = [petitout[0], event.index+1, 1] |
---|
41 | END |
---|
42 | endcase |
---|
43 | nbredessin = petitin[0]*petitin[1] |
---|
44 | ; |
---|
45 | ; on remet tout a 0 en ce qui concerne les postscripts |
---|
46 | createhistory, event.top, petitin |
---|
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, 'petitin')] = petitin |
---|
62 | *top_uvalue[1, findline(top_uvalue, 'petitout')] = petitout |
---|
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} |
---|
108 | end |
---|
109 | ;********************************************************************* |
---|
110 | FUNCTION cw_miseenpage, parent, petit, 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(petit) eq 0 then petit = [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 = petit[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 = petit[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 |
---|
137 | end |
---|
138 | ;********************************************************************* |
---|