;+ ; ; @file_comments ; ; @categories ; ; @param EVENT ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ; ; @todo ; seb ; ;- PRO doubleclickaction, event ; compile_opt idl2, strictarrsubs ; widget_control, event.id , get_uvalue = uval widget_control, event.top, get_uvalue = top_uvalue ; We activate the right window widget_control, event.id, get_value = win wset, win ; What is the selected drawing? smallin = extractatt(top_uvalue, 'smallin') smallout = extractatt(top_uvalue, 'smallout') 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(smallin[0])/smallin[0] lt x))-1 numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1 numdessin = numcolonne+numligne*smallin[0]+1 ; Choice of the type of action. case uval.press of 1:BEGIN ; if top_uvalue.smallin[2] NE numdessin then begin tracecadre, smallin, /erase if total(smallin EQ smallout) EQ 3 then $ tracecadre, smallout, /out smallin = [smallin[0:1], numdessin] *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin tracecadre, smallin !p = (extractatt(top_uvalue, 'penvs'))[numdessin-1] !x = (extractatt(top_uvalue, 'xenvs'))[numdessin-1] !y = (extractatt(top_uvalue, 'yenvs'))[numdessin-1] ; END 2:BEGIN ; if top_uvalue.smallout[2] NE numdessin then begin tracecadre, smallout, /erase if total(smallin EQ smallout) EQ 3 then $ tracecadre, smallin smallout = [smallin[0:1], numdessin] *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout tracecadre, smallout, /out ; endif END 4:BEGIN tracecadre, [smallin[0:1], numdessin], /fill inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $ , '; end of '+strtrim(numdessin, 2) ; Putting at 0 of attributes of the value concerning the drawing numdessin = numdessin-1 (*top_uvalue[1, findline(top_uvalue, 'varinfo')])[*, numdessin] = ['', ''] (*top_uvalue[1, findline(top_uvalue, 'dates')])[*, numdessin] = [0l, 0l] (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessin] = '' (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessin] = '' (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessin] = fltarr(6) (*top_uvalue[1, findline(top_uvalue, 'txtcmd')])[numdessin] = '' if numdessin EQ smallin[2] then $ tracecadre, smallin if numdessin EQ smallout[2] then $ tracecadre, smallout, /out END ELSE: endcase updatewidget, event.top ;------------------------------------------------------------ return end