source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/doubleclickaction.pro @ 150

Last change on this file since 150 was 150, checked in by navarro, 18 years ago

english and nicer header (3a)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1;+
2; @file_comments
3;
4;
5; @categories
6;
7;
8; @param EVENT
9;
10;
11; @returns
12;
13;
14; @uses
15;
16;
17; @restrictions
18;
19;
20; @examples
21;
22;
23; @history
24;
25;
26; @version
27; $Id$
28;
29; @todo
30; seb
31;
32;-
33PRO doubleclickaction, event
34;------------------------------------------------------------
35;
36  compile_opt idl2, strictarrsubs
37;
38   widget_control, event.id , get_uvalue = uval
39   widget_control, event.top, get_uvalue = top_uvalue
40; We activate the right window
41   widget_control, event.id, get_value = win
42   wset, win
43; What is the selected drawing?
44   smallin = extractatt(top_uvalue, 'smallin')
45   smallout = extractatt(top_uvalue, 'smallout')
46   x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0]
47   y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1]
48   numcolonne = n_elements(where(findgen(smallin[0])/smallin[0] lt x))-1
49   numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1
50   numdessin = numcolonne+numligne*smallin[0]+1
51; Choice of the type of action.
52   case uval.press of
53      1:BEGIN
54;         if top_uvalue.smallin[2] NE numdessin then begin
55         tracecadre, smallin, /erase
56         if total(smallin EQ smallout) EQ 3 then $
57          tracecadre, smallout, /out
58         smallin = [smallin[0:1], numdessin]
59         *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
60         tracecadre, smallin
61         !p = (extractatt(top_uvalue, 'penvs'))[numdessin-1]
62         !x = (extractatt(top_uvalue, 'xenvs'))[numdessin-1]
63         !y = (extractatt(top_uvalue, 'yenvs'))[numdessin-1]
64;
65      END
66      2:BEGIN
67;         if top_uvalue.smallout[2] NE numdessin then begin
68         tracecadre, smallout, /erase
69         if total(smallin EQ smallout) EQ 3 then $
70          tracecadre, smallin
71         smallout = [smallin[0:1], numdessin]
72         *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout
73         tracecadre, smallout, /out
74;         endif
75      END
76      4:BEGIN
77         tracecadre, [smallin[0:1], numdessin], /fill
78         inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $
79          , '; end of '+strtrim(numdessin, 2)
80; Putting at 0 of attributes of the value concerning the drawing:
81
82         numdessin = numdessin-1
83         (*top_uvalue[1, findline(top_uvalue, 'varinfo')])[*, numdessin] = ['', '']
84         (*top_uvalue[1, findline(top_uvalue, 'dates')])[*, numdessin] = [0l, 0l]
85         (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessin] = ''
86         (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessin] = ''
87         (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessin] = fltarr(6)
88         (*top_uvalue[1, findline(top_uvalue, 'txtcmd')])[numdessin] = ''
89
90         if numdessin EQ smallin[2] then $
91          tracecadre, smallin
92         if numdessin EQ smallout[2] then $
93          tracecadre, smallout, /out
94       END
95       ELSE:
96   endcase
97   updatewidget, event.top
98;------------------------------------------------------------
99   return
100end
Note: See TracBrowser for help on using the repository browser.