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

Last change on this file since 367 was 325, checked in by pinsard, 16 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • 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;-
26PRO doubleclickaction, event
27;
28  compile_opt idl2, strictarrsubs
29;
30   widget_control, event.id , get_uvalue = uval
31   widget_control, event.top, get_uvalue = top_uvalue
32; We activate the right window
33   widget_control, event.id, get_value = win
34   wset, win
35; What is the selected drawing?
36   smallin = extractatt(top_uvalue, 'smallin')
37   smallout = extractatt(top_uvalue, 'smallout')
38   x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0]
39   y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1]
40   numcolonne = n_elements(where(findgen(smallin[0])/smallin[0] lt x))-1
41   numligne = n_elements(where(findgen(smallin[1])/smallin[1] lt 1-y))-1
42   numdessin = numcolonne+numligne*smallin[0]+1
43; Choice of the type of action.
44   case uval.press of
45      1:BEGIN
46;         if top_uvalue.smallin[2] NE numdessin then begin
47         tracecadre, smallin, /erase
48         if total(smallin EQ smallout) EQ 3 then $
49          tracecadre, smallout, /out
50         smallin = [smallin[0:1], numdessin]
51         *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
52         tracecadre, smallin
53         !p = (extractatt(top_uvalue, 'penvs'))[numdessin-1]
54         !x = (extractatt(top_uvalue, 'xenvs'))[numdessin-1]
55         !y = (extractatt(top_uvalue, 'yenvs'))[numdessin-1]
56;
57      END
58      2:BEGIN
59;         if top_uvalue.smallout[2] NE numdessin then begin
60         tracecadre, smallout, /erase
61         if total(smallin EQ smallout) EQ 3 then $
62          tracecadre, smallin
63         smallout = [smallin[0:1], numdessin]
64         *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout
65         tracecadre, smallout, /out
66;         endif
67      END
68      4:BEGIN
69         tracecadre, [smallin[0:1], numdessin], /fill
70         inserthistory, event.top, ';', '; beginning of '+strtrim(numdessin, 2) $
71          , '; end of '+strtrim(numdessin, 2)
72; Putting at 0 of attributes of the value concerning the drawing
73
74         numdessin = numdessin-1
75         (*top_uvalue[1, findline(top_uvalue, 'varinfo')])[*, numdessin] = ['', '']
76         (*top_uvalue[1, findline(top_uvalue, 'dates')])[*, numdessin] = [0l, 0l]
77         (*top_uvalue[1, findline(top_uvalue, 'nameprocedures')])[numdessin] = ''
78         (*top_uvalue[1, findline(top_uvalue, 'types')])[numdessin] = ''
79         (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessin] = fltarr(6)
80         (*top_uvalue[1, findline(top_uvalue, 'txtcmd')])[numdessin] = ''
81
82         if numdessin EQ smallin[2] then $
83          tracecadre, smallin
84         if numdessin EQ smallout[2] then $
85          tracecadre, smallout, /out
86       END
87       ELSE:
88   endcase
89   updatewidget, event.top
90;------------------------------------------------------------
91   return
92end
Note: See TracBrowser for help on using the repository browser.