source: trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.pro @ 69

Last change on this file since 69 was 69, checked in by smasson, 18 years ago

debug + new xxx

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