source: trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro @ 69

Last change on this file since 69 was 69, checked in by smasson, 18 years ago

debug + new xxx

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 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  smallout = extractatt(top_uvalue, 'smallout')
6  smallin = extractatt(top_uvalue, 'smallin')
7  small = smallin
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(small[0])/small[0] lt x))-1
11  numligne = n_elements(where(findgen(small[1])/small[1] lt 1-y))-1
12  numdessin = numcolonne+numligne*small[0]
13; we put on numdessin as the leader plot
14  tracecadre, smallin, /erase
15  if total(smallin EQ smallout) EQ 3 then $
16     tracecadre, smallout, /out
17  smallin = [smallin[0:1], numdessin+1]
18  *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
19  tracecadre, smallin
20  !p = (extractatt(top_uvalue, 'penvs'))[numdessin]
21  !x = (extractatt(top_uvalue, 'xenvs'))[numdessin]
22  !y = (extractatt(top_uvalue, 'yenvs'))[numdessin]
23;------------------------------------------------------------
24; Change the domain box:
25;------------------------------------------------------------
26  coor = (convert_coord(uval.x, uval.y, /device, /to_data))
27  x = [coor[0, 0], coor[0, 1]]
28  y = [coor[1, 0], coor[1, 1]]
29  domainid = widget_info(event.top, find_by_uname = 'domain')
30  boxzoom = [x, y]
31; faut-il passer la boxzoom en indexes ???
32  currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1
33  options = extractatt(top_uvalue, 'options')   
34  flags = extractatt(top_uvalue, 'optionsflag')
35  flags = flags[*, currentplot]
36  changex = (flags[where(options EQ 'Longitude / x index')])[0] EQ 1
37  changey = (flags[where(options EQ 'Latitude / y index')])[0] EQ 1
38  if changex OR changey then begin
39; on veut retrouver le type de grille qui est utilisee
40    currentfile = extractatt(top_uvalue, 'currentfile')
41    listgrid = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listgrid
42    listvar = (*(extractatt(top_uvalue, 'fileparameters'))[currentfile]).listvar
43    vlstid = widget_info(event.top, find_by_uname = 'varlist')
44    namevar = widget_info(vlstid, /combobox_gettext)
45    indexvar = where(listvar EQ namevar)
46    vargrid = strupcase(listgrid[indexvar])
47    domdef, boxzoom, gridtype = vargrid
48    grille, -1, -1, -1, -1, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz
49    if changex then boxzoom[0:1] = [firstx, lastx]
50    if changey then boxzoom[2:3] = [firsty, lasty]
51  endif
52;
53  widget_control, domainid, set_value = boxzoom
54;
55;------------------------------------------------------------
56  actionid = widget_info(event.top, find_by_uname = 'action')
57  type = widget_info(actionid, /combobox_gettext)
58  case uval.press of
59    1:BEGIN
60      nodates = (type EQ 'xt' OR type EQ 'yt' OR type EQ 'zt' OR type EQ 't')
61      updatewidget, event.top, /noboxzoom, nodates = nodates, notype = type NE 'plt'
62      letsdraw, event.top
63    END
64    2:BEGIN
65      IF type EQ 'plt' THEN BEGIN
66        (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltz'
67        forcetype = 'pltz'
68      ENDIF
69      updatewidget, event.top, /noboxzoom
70      letsdraw, event.top
71    END
72    4:BEGIN
73      IF type EQ 'plt' THEN BEGIN
74        (*top_uvalue[1, findline(top_uvalue, 'types')])[smallout[2]-1] = 'pltt'
75        forcetype = 'pltt'
76      ENDIF
77      updatewidget, event.top, /noboxzoom, /nodates
78      letsdraw, event.top, forcetype = forcetype
79    END
80  endcase
81;------------------------------------------------------------
82  return
83end
Note: See TracBrowser for help on using the repository browser.