1 | PRO longclickaction, event |
---|
2 | ; |
---|
3 | compile_opt idl2, strictarrsubs |
---|
4 | ; |
---|
5 | widget_control, event.id, get_uvalue = uval |
---|
6 | widget_control, event.top, get_uvalue = top_uvalue |
---|
7 | ; quel est le dessin selectionne?? |
---|
8 | smallout = extractatt(top_uvalue, 'smallout') |
---|
9 | smallin = extractatt(top_uvalue, 'smallin') |
---|
10 | small = smallin |
---|
11 | x = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[0] |
---|
12 | y = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[1] |
---|
13 | numcolonne = n_elements(where(findgen(small[0])/small[0] lt x))-1 |
---|
14 | numligne = n_elements(where(findgen(small[1])/small[1] lt 1-y))-1 |
---|
15 | numdessin = numcolonne+numligne*small[0] |
---|
16 | ; we put on numdessin as the leader plot |
---|
17 | tracecadre, smallin, /erase |
---|
18 | if total(smallin EQ smallout) EQ 3 then $ |
---|
19 | tracecadre, smallout, /out |
---|
20 | smallin = [smallin[0:1], numdessin+1] |
---|
21 | *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin |
---|
22 | tracecadre, smallin |
---|
23 | !p = (extractatt(top_uvalue, 'penvs'))[numdessin] |
---|
24 | !x = (extractatt(top_uvalue, 'xenvs'))[numdessin] |
---|
25 | !y = (extractatt(top_uvalue, 'yenvs'))[numdessin] |
---|
26 | ;------------------------------------------------------------ |
---|
27 | ; Change the domain box: |
---|
28 | ;------------------------------------------------------------ |
---|
29 | coor = (convert_coord(uval.x, uval.y, /device, /to_data)) |
---|
30 | x = [coor[0, 0], coor[0, 1]] |
---|
31 | y = [coor[1, 0], coor[1, 1]] |
---|
32 | domainid = widget_info(event.top, find_by_uname = 'domain') |
---|
33 | boxzoom = [x, y] |
---|
34 | ; faut-il passer la boxzoom en indexes ??? |
---|
35 | currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 |
---|
36 | options = extractatt(top_uvalue, 'options') |
---|
37 | flags = extractatt(top_uvalue, 'optionsflag') |
---|
38 | flags = flags[*, currentplot] |
---|
39 | changex = (flags[where(options EQ 'Longitude / x index')])[0] EQ 1 |
---|
40 | changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1 |
---|
41 | if changex OR changey then begin |
---|
42 | ; on veut retrouver le type de grille qui est utilisee |
---|
43 | currentfile = extractatt(top_uvalue, 'currentfile') |
---|
44 | listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid |
---|
45 | listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar |
---|
46 | vlstid = widget_info(event.top, find_by_uname = 'varlist') |
---|
47 | namevar = widget_info(vlstid, /combobox_gettext) |
---|
48 | indexvar = where(listvar EQ namevar) |
---|
49 | vargrid = strupcase(listgrid[indexvar]) |
---|
50 | domdef, boxzoom, gridtype = vargrid |
---|
51 | grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz |
---|
52 | if changex then boxzoom[0:1] = [firstx, lastx] |
---|
53 | if changey then boxzoom[2:3] = [firsty, lasty] |
---|
54 | endif |
---|
55 | ; |
---|
56 | widget_control, domainid, set_value = boxzoom |
---|
57 | ; |
---|
58 | ;------------------------------------------------------------ |
---|
59 | actionid = widget_info(event.top, find_by_uname = 'action') |
---|
60 | type = widget_info(actionid, /combobox_gettext) |
---|
61 | case uval.press of |
---|
62 | 1:BEGIN |
---|
63 | nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't') |
---|
64 | updatewidget, event.top, /noboxzoom, nodates = nodates, notype = type NE 'plt' |
---|
65 | letsdraw, event.top |
---|
66 | END |
---|
67 | 2:BEGIN |
---|
68 | IF type EQ 'plt' THEN BEGIN |
---|
69 | (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltz' |
---|
70 | forcetype = 'pltz' |
---|
71 | ENDIF |
---|
72 | updatewidget, event.top, /noboxzoom |
---|
73 | letsdraw, event.top |
---|
74 | END |
---|
75 | 4:BEGIN |
---|
76 | IF type EQ 'plt' THEN BEGIN |
---|
77 | (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltt' |
---|
78 | forcetype = 'pltt' |
---|
79 | ENDIF |
---|
80 | updatewidget, event.top, /noboxzoom, /nodates |
---|
81 | letsdraw, event.top, forcetype = forcetype |
---|
82 | END |
---|
83 | endcase |
---|
84 | ;------------------------------------------------------------ |
---|
85 | return |
---|
86 | end |
---|