1 | PRO doubleclickaction, event |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ; |
---|
4 | compile_opt idl2, strictarrsubs |
---|
5 | ; |
---|
6 | widget_control, event.id , get_uvalue = uval |
---|
7 | widget_control, event.top, get_uvalue = top_uvalue |
---|
8 | ; on active la bonne fenetre |
---|
9 | widget_control, event.id, get_value = win |
---|
10 | wset, win |
---|
11 | ; quel est le dessin selectionne?? |
---|
12 | smallin = extractatt(top_uvalue, 'smallin') |
---|
13 | smallout = extractatt(top_uvalue, 'smallout') |
---|
14 | x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0] |
---|
15 | y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1] |
---|
16 | numcolonne = n_elements(where(findgen(smallin[0])/smallin[0] lt x))-1 |
---|
17 | numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1 |
---|
18 | numdessin = numcolonne+numligne*smallin[0]+1 |
---|
19 | ; choix du type d''action |
---|
20 | case uval.press of |
---|
21 | 1:BEGIN |
---|
22 | ; if top_uvalue.smallin[2] NE numdessin then begin |
---|
23 | tracecadre, smallin, /erase |
---|
24 | if total(smallin EQ smallout) EQ 3 then $ |
---|
25 | tracecadre, smallout, /out |
---|
26 | smallin = [smallin[0:1], numdessin] |
---|
27 | *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin |
---|
28 | tracecadre, smallin |
---|
29 | !p = (extractatt(top_uvalue, 'penvs'))[numdessin-1] |
---|
30 | !x = (extractatt(top_uvalue, 'xenvs'))[numdessin-1] |
---|
31 | !y = (extractatt(top_uvalue, 'yenvs'))[numdessin-1] |
---|
32 | ; |
---|
33 | END |
---|
34 | 2:BEGIN |
---|
35 | ; if top_uvalue.smallout[2] NE numdessin then begin |
---|
36 | tracecadre, smallout, /erase |
---|
37 | if total(smallin EQ smallout) EQ 3 then $ |
---|
38 | tracecadre, smallin |
---|
39 | smallout = [smallin[0:1], numdessin] |
---|
40 | *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout |
---|
41 | tracecadre, smallout, /out |
---|
42 | ; endif |
---|
43 | END |
---|
44 | 4:BEGIN |
---|
45 | tracecadre, [smallin[0:1], numdessin], /fill |
---|
46 | inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $ |
---|
47 | , '; end of '+strtrim(numdessin, 2) |
---|
48 | ; remise a 0 des attributs de la uvalue concernant ce dessin: |
---|
49 | |
---|
50 | numdessin = numdessin-1 |
---|
51 | (*top_uvalue[1, findline(top_uvalue, 'varinfo')])[*, numdessin] = ['', ''] |
---|
52 | (*top_uvalue[1, findline(top_uvalue, 'dates')])[*, numdessin] = [0l, 0l] |
---|
53 | (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessin] = '' |
---|
54 | (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessin] = '' |
---|
55 | (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessin] = fltarr(6) |
---|
56 | (*top_uvalue[1, findline(top_uvalue, 'txtcmd')])[numdessin] = '' |
---|
57 | |
---|
58 | if numdessin EQ smallin[2] then $ |
---|
59 | tracecadre, smallin |
---|
60 | if numdessin EQ smallout[2] then $ |
---|
61 | tracecadre, smallout, /out |
---|
62 | END |
---|
63 | ELSE: |
---|
64 | endcase |
---|
65 | updatewidget, event.top |
---|
66 | ;------------------------------------------------------------ |
---|
67 | return |
---|
68 | end |
---|