;+ ; ; @file_comments ; ; @categories ; ; @param EVENT ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ; ; @todo ; seb ; ;- PRO longclickaction, event ; compile_opt idl2, strictarrsubs ; widget_control, event.id, get_uvalue = uval widget_control, event.top, get_uvalue = top_uvalue ; What is the selected drawing? smallout = extractatt(top_uvalue, 'smallout') smallin = extractatt(top_uvalue, 'smallin') small = smallin x = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[0] y = (convert_coord(uval.x[0], uval.y[0], /device, /to_normal))[1] numcolonne = n_elements(where(findgen(small[0])/small[0] lt x))-1 numligne = n_elements(where(findgen(small[1])/small[1] lt 1-y))-1 numdessin = numcolonne+numligne*small[0] ; we put on numdessin as the leader plot tracecadre, smallin, /erase if total(smallin EQ smallout) EQ 3 then $ tracecadre, smallout, /out smallin = [smallin[0:1], numdessin+1] *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin tracecadre, smallin !p = (extractatt(top_uvalue, 'penvs'))[numdessin] !x = (extractatt(top_uvalue, 'xenvs'))[numdessin] !y = (extractatt(top_uvalue, 'yenvs'))[numdessin] ;------------------------------------------------------------ actionid = widget_info(event.top, find_by_uname = 'action') type = widget_info(actionid, /combobox_gettext) ;------------------------------------------------------------ ; Change the domain box: ;------------------------------------------------------------ coor = (convert_coord(uval.x, uval.y, /device, /to_data)) x = [coor[0, 0], coor[0, 1]] y = [coor[1, 0], coor[1, 1]] domainid = widget_info(event.top, find_by_uname = 'domain') IF type EQ 'pltv' THEN BEGIN currentfile = extractatt(top_uvalue, 'currentfile') listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar vlstid = widget_info(event.top, find_by_uname = 'varlist') namevar = widget_info(vlstid, /combobox_gettext) indexvar = where(listvar EQ namevar) vargrid = strupcase(listgrid[indexvar]) grille, -1, glam, gphi boxzoom = [glam[x[0], y[0]], glam[x[1], y[1]], gphi[x[0], y[0]], gphi[x[1], y[1]]] ENDIF ELSE boxzoom = [x, y] ; Do we have to pass the boxzoom in indexes ??? currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 options = extractatt(top_uvalue, 'options') flags = extractatt(top_uvalue, 'optionsflag') flags = flags[*, currentplot] changex = (flags[where(options EQ 'Longitude / x index')])[0] EQ 1 changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1 if changex OR changey then begin ; We want to find the type of grid which is used currentfile = extractatt(top_uvalue, 'currentfile') listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar vlstid = widget_info(event.top, find_by_uname = 'varlist') namevar = widget_info(vlstid, /combobox_gettext) indexvar = where(listvar EQ namevar) vargrid = strupcase(listgrid[indexvar]) domdef, boxzoom, gridtype = vargrid grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz if changex then boxzoom[0:1] = [firstx, lastx] if changey then boxzoom[2:3] = [firsty, lasty] endif ; widget_control, domainid, set_value = boxzoom ; case uval.press of 1:BEGIN nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't') updatewidget, event.top, /noboxzoom, nodates = nodates, notype = type NE 'plt' letsdraw, event.top END 2:BEGIN IF type EQ 'plt' THEN BEGIN (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltz' forcetype = 'pltz' ENDIF updatewidget, event.top, /noboxzoom letsdraw, event.top, forcetype = forcetype END 4:BEGIN IF type EQ 'plt' THEN BEGIN (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltt' forcetype = 'pltt' ENDIF updatewidget, event.top, /noboxzoom, /nodates letsdraw, event.top, forcetype = forcetype END endcase ;------------------------------------------------------------ return end