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