1 | ;+ |
---|
2 | ; @file_comments |
---|
3 | ; |
---|
4 | ; |
---|
5 | ; @categories |
---|
6 | ; |
---|
7 | ; |
---|
8 | ; @param EVENT |
---|
9 | ; |
---|
10 | ; |
---|
11 | ; @returns |
---|
12 | ; |
---|
13 | ; |
---|
14 | ; @uses |
---|
15 | ; |
---|
16 | ; |
---|
17 | ; @restrictions |
---|
18 | ; |
---|
19 | ; |
---|
20 | ; @examples |
---|
21 | ; |
---|
22 | ; |
---|
23 | ; @history |
---|
24 | ; |
---|
25 | ; |
---|
26 | ; @version |
---|
27 | ; $Id$ |
---|
28 | ; |
---|
29 | ; @todo |
---|
30 | ; seb |
---|
31 | ; |
---|
32 | ;- |
---|
33 | PRO longclickaction, event |
---|
34 | ; |
---|
35 | compile_opt idl2, strictarrsubs |
---|
36 | ; |
---|
37 | widget_control, event.id, get_uvalue = uval |
---|
38 | widget_control, event.top, get_uvalue = top_uvalue |
---|
39 | ; What is the selected drawing? |
---|
40 | smallout = extractatt(top_uvalue, 'smallout') |
---|
41 | smallin = extractatt(top_uvalue, 'smallin') |
---|
42 | small = smallin |
---|
43 | x = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[0] |
---|
44 | y = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[1] |
---|
45 | numcolonne = n_elements(where(findgen(small[0])/small[0] lt x))-1 |
---|
46 | numligne = n_elements(where(findgen(small[1])/small[1] lt 1-y))-1 |
---|
47 | numdessin = numcolonne+numligne*small[0] |
---|
48 | ; we put on numdessin as the leader plot |
---|
49 | tracecadre, smallin, /erase |
---|
50 | if total(smallin EQ smallout) EQ 3 then $ |
---|
51 | tracecadre, smallout, /out |
---|
52 | smallin = [smallin[0:1], numdessin+1] |
---|
53 | *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin |
---|
54 | tracecadre, smallin |
---|
55 | !p = (extractatt(top_uvalue, 'penvs'))[numdessin] |
---|
56 | !x = (extractatt(top_uvalue, 'xenvs'))[numdessin] |
---|
57 | !y = (extractatt(top_uvalue, 'yenvs'))[numdessin] |
---|
58 | ;------------------------------------------------------------ |
---|
59 | ; Change the domain box: |
---|
60 | ;------------------------------------------------------------ |
---|
61 | coor = (convert_coord(uval.x, uval.y, /device, /to_data)) |
---|
62 | x = [coor[0, 0], coor[0, 1]] |
---|
63 | y = [coor[1, 0], coor[1, 1]] |
---|
64 | domainid = widget_info(event.top, find_by_uname = 'domain') |
---|
65 | boxzoom = [x, y] |
---|
66 | ; Do we have to pass the boxzoom in indexes ??? |
---|
67 | currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 |
---|
68 | options = extractatt(top_uvalue, 'options') |
---|
69 | flags = extractatt(top_uvalue, 'optionsflag') |
---|
70 | flags = flags[*, currentplot] |
---|
71 | changex = (flags[where(options EQ 'Longitude / x index')])[0] EQ 1 |
---|
72 | changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1 |
---|
73 | if changex OR changey then begin |
---|
74 | ; We want to find the type of grid which is used |
---|
75 | currentfile = extractatt(top_uvalue, 'currentfile') |
---|
76 | listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid |
---|
77 | listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar |
---|
78 | vlstid = widget_info(event.top, find_by_uname = 'varlist') |
---|
79 | namevar = widget_info(vlstid, /combobox_gettext) |
---|
80 | indexvar = where(listvar EQ namevar) |
---|
81 | vargrid = strupcase(listgrid[indexvar]) |
---|
82 | domdef, boxzoom, gridtype = vargrid |
---|
83 | grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz |
---|
84 | if changex then boxzoom[0:1] = [firstx, lastx] |
---|
85 | if changey then boxzoom[2:3] = [firsty, lasty] |
---|
86 | endif |
---|
87 | ; |
---|
88 | widget_control, domainid, set_value = boxzoom |
---|
89 | ; |
---|
90 | ;------------------------------------------------------------ |
---|
91 | actionid = widget_info(event.top, find_by_uname = 'action') |
---|
92 | type = widget_info(actionid, /combobox_gettext) |
---|
93 | case uval.press of |
---|
94 | 1:BEGIN |
---|
95 | nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't') |
---|
96 | updatewidget, event.top, /noboxzoom, nodates = nodates, notype = type NE 'plt' |
---|
97 | letsdraw, event.top |
---|
98 | END |
---|
99 | 2:BEGIN |
---|
100 | IF type EQ 'plt' THEN BEGIN |
---|
101 | (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltz' |
---|
102 | forcetype = 'pltz' |
---|
103 | ENDIF |
---|
104 | updatewidget, event.top, /noboxzoom |
---|
105 | letsdraw, event.top |
---|
106 | END |
---|
107 | 4:BEGIN |
---|
108 | IF type EQ 'plt' THEN BEGIN |
---|
109 | (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltt' |
---|
110 | forcetype = 'pltt' |
---|
111 | ENDIF |
---|
112 | updatewidget, event.top, /noboxzoom, /nodates |
---|
113 | letsdraw, event.top, forcetype = forcetype |
---|
114 | END |
---|
115 | endcase |
---|
116 | ;------------------------------------------------------------ |
---|
117 | return |
---|
118 | end |
---|