source: trunk/WIDGET/AUTOUR_de_XXX/doubleclickaction.pro @ 2

Last change on this file since 2 was 2, checked in by opalod, 22 years ago

Initial revision

  • 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   petitin = extractatt(top_uvalue, 'petitin')
10   petitout = extractatt(top_uvalue, 'petitout')
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(petitin[0])/petitin[0] lt x))-1
14   numligne = n_elements(where(findgen(petitin[1])/petitin[1] lt 1-y))-1
15   numdessin = numcolonne+numligne*petitin[0]+1
16; choix du type d''action
17   case uval.press of
18      1:BEGIN
19;         if top_uvalue.petitin[2] NE numdessin then begin
20         tracecadre, petitin, /erase
21         if total(petitin EQ petitout) EQ 3 then $
22          tracecadre, petitout, /out
23         petitin = [petitin[0:1], numdessin]
24         *top_uvalue[1, findline(top_uvalue, 'petitin')] = petitin
25         tracecadre, petitin
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.petitout[2] NE numdessin then begin
33         tracecadre, petitout, /erase
34         if total(petitin EQ petitout) EQ 3 then $
35          tracecadre, petitin
36         petitout = [petitin[0:1], numdessin]
37         *top_uvalue[1, findline(top_uvalue, 'petitout')] = petitout
38         tracecadre, petitout, /out
39;         endif
40      END
41      4:BEGIN
42         tracecadre, [petitin[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, 'champs')])[*, 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, 'prefixes')])[numdessin] = ''
54
55         if numdessin EQ petitin[2] then $
56          tracecadre, petitin
57         if numdessin EQ petitout[2] then $
58          tracecadre, petitout, /out
59      END
60   endcase
61   updatewidget, event.top
62;------------------------------------------------------------
63   return
64end
Note: See TracBrowser for help on using the repository browser.