Ignore:
Timestamp:
05/11/06 12:35:53 (18 years ago)
Author:
smasson
Message:

debug + new xxx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.pro

    r49 r69  
    11PRO longclickaction, event 
    2    widget_control, event.id, get_uvalue=uval 
    3    widget_control,event.top, get_uvalue = top_uvalue 
     2  widget_control, event.id, get_uvalue = uval 
     3  widget_control, event.top, get_uvalue = top_uvalue 
    44; 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 ; on met ce cadrant en leader 
    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] 
     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 
    2354; 
    2455;------------------------------------------------------------ 
    25 ; changement de domaine: 
     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 
    2681;------------------------------------------------------------ 
    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    boxzoom = [x, y] 
    32 ; faut-il passer la boxzoom en indexes ??? 
    33    currentplot = (extractatt(top_uvalue, 'smallin'))[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, boxzoom, gridtype = vargrid 
    46       grille, -1, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 
    47       if changex then boxzoom[0:1] = [firstx, lastx] 
    48       if changey then boxzoom[2:3] = [firsty, lasty] 
    49    endif 
    50 ; 
    51    widget_control, domainid, set_value = boxzoom 
    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, /noboxzoom, 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, /noboxzoom 
    66          forpltz = type EQ 'plt' 
    67          letsdraw, event.top, forpltz = forpltz 
    68       END 
    69       4:BEGIN 
    70          updatewidget, event.top, /noboxzoom, /nodates 
    71          forpltt = type EQ 'plt' 
    72          letsdraw, event.top, forpltt = forpltt 
    73       END 
    74    endcase 
    75 ;------------------------------------------------------------ 
    76    return 
     82  return 
    7783end 
Note: See TracChangeset for help on using the changeset viewer.