source: trunk/WIDGET/AUTOUR_de_XXX/longclickaction.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: 3.3 KB
Line 
1PRO longclickaction, event
2   widget_control, event.id, get_uvalue=uval
3   widget_control,event.top, get_uvalue = top_uvalue
4; quel est le dessin selectionne??
5   petitout = extractatt(top_uvalue, 'petitout')
6   petitin = extractatt(top_uvalue, 'petitin')
7   petit = petitin
8   x = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[0]
9   y = (convert_coord(uval.x[0],uval.y[0], /device, /to_normal))[1]
10   numcolonne = n_elements(where(findgen(petit[0])/petit[0] lt x))-1
11   numligne = n_elements(where(findgen(petit[1])/petit[1] lt 1-y))-1
12   numdessin = numcolonne+numligne*petit[0]
13; on met ce cadrant en leader
14   tracecadre, petitin, /erase
15   if total(petitin EQ petitout) EQ 3 then $
16    tracecadre, petitout, /out
17   petitin = [petitin[0:1], numdessin+1]
18   *top_uvalue[1, findline(top_uvalue, 'petitin')] = petitin
19   tracecadre, petitin
20   !p = (extractatt(top_uvalue, 'penvs'))[numdessin]
21   !x = (extractatt(top_uvalue, 'xenvs'))[numdessin]
22   !y = (extractatt(top_uvalue, 'yenvs'))[numdessin]
23;
24;------------------------------------------------------------
25; changement de domaine:
26;------------------------------------------------------------
27   coor = (convert_coord(uval.x,uval.y, /device, /to_data))
28   x = [coor[0, 0],coor[0, 1]]
29   y = [coor[1, 0],coor[1, 1]]
30   domainid = widget_info(event.top,find_by_uname = 'domain')
31   boite = [x, y]
32; faut-il passer la boite en indexes ???
33   currentplot = (extractatt(top_uvalue, 'petitin'))[2]-1
34   options = extractatt(top_uvalue, 'options')   
35   flags = extractatt(top_uvalue, 'optionsflag')
36   flags = flags[*, currentplot]
37   changex = (flags[where(options EQ 'Longitude / x index')])[0] EQ 1
38   changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1
39   if changex OR changey then begin
40; on veut retrouver le type de grille qui est utilisee
41      currentfile = extractatt(top_uvalue, 'currentfile')
42      listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid
43      indexvar = widget_info(widget_info(event.top, find_by_uname = 'champ'), /droplist_select)
44      vargrid = strupcase(listgrid[indexvar])
45      domdef, boite, grille = vargrid
46      grille, mask,glam,gphi,gdep,nx,ny,nz,premierx,premiery,premierz,dernierx,derniery,dernierz
47      if changex then boite[0:1] = [premierx, dernierx]
48      if changey then boite[2:3] = [premiery, derniery]
49   endif
50;
51   widget_control, domainid, set_value = boite
52;
53;------------------------------------------------------------
54   graphtypeid = widget_info(event.top, find_by_uname = 'action')
55   widget_control,graphtypeid, get_uvalue = graphtype_uvalue
56   type = graphtype_uvalue.choix[widget_info(graphtypeid, /droplist_select)]
57   case uval.press of
58      1:BEGIN
59         nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't')
60         updatewidget, event.top, /noboite, nodates = nodates, notype = type NE 'plt'
61         forplth = type EQ 'plt'
62         letsdraw, event.top, forplth = forplth
63      END
64      2:BEGIN
65         updatewidget, event.top, /noboite
66         forpltz = type EQ 'plt'
67         letsdraw, event.top, forpltz = forpltz
68      END
69      4:BEGIN
70         updatewidget, event.top, /noboite, /nodates
71         forpltt = type EQ 'plt'
72         letsdraw, event.top, forpltt = forpltt
73      END
74   endcase
75;------------------------------------------------------------
76   return
77end
Note: See TracBrowser for help on using the repository browser.