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

Last change on this file since 297 was 262, checked in by pinsard, 17 years ago

corrections of some headers and parameters and keywords case. change of pro2href to replace proidl

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