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/COMPOUND_WIDGET/cw_domain.pro

    r51 r69  
    4040;********************************************************************* 
    4141pro cw_domain_set_value, id, value 
    42 @common 
     42@cm_4mesh 
     43; 
     44   topid = findtopid(id) 
     45   widget_control, topid, get_uvalue = top_uvalue 
     46;------------------------------------------------ 
     47; make sure that we have the good grid stored in the cm_4mesh common parameters. 
     48   currentfile = extractatt(top_uvalue, 'currentfile') 
     49   currentgrid = *(extractatt(top_uvalue, 'meshparameters'))[currentfile] 
     50   change = changegrid(currentgrid) 
    4351;------------------------------------------------ 
    4452; quel est le type de boxzoom? 
    45    topid = findtopid(id) 
    46    widget_control, topid, get_uvalue=top_uvalue 
    4753   currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 
    4854   options = extractatt(top_uvalue, 'options')    
     
    6268      lonn1 = firstxt 
    6369      lonn2 = lastxt 
    64       xtitle = 'x index' 
     70      xtitle = 'x ind' 
    6571   ENDELSE 
    6672   IF ytype EQ  'geographic' then begin 
     
    7177      latt1 = firstyt 
    7278      latt2 = lastyt 
    73       ytitle = 'y index' 
     79      ytitle = 'y ind' 
    7480   ENDELSE 
    7581;------------------------------------------------ 
     
    8894      6:boxzoom = Value 
    8995      Else:BEGIN  
    90          rien = report('Mauvaise Definition de Boxzoom') 
     96         rien = report('Wrong Definition of Boxzoom') 
    9197      END 
    9298   ENDCASE 
     
    187193   ENDELSE 
    188194; 
    189 ; 
    190195   if n_elements(boxzoom) EQ 4 then return 
    191196; 
    192 ; la profondeur 
    193 ; 
    194    depthlev1id = widget_info(id,find_by_uname = 'depthlev1') 
    195    depthlev2id = widget_info(id,find_by_uname = 'depthlev2') 
    196    depth1id = widget_info(id,find_by_uname = 'depth1') 
    197    depth2id = widget_info(id,find_by_uname = 'depth2') 
    198    widget_control, depthlev1id, get_uvalue = depthlev1_uval 
    199 ; a-t-on change de type de grille ?, faut=il changerl''axe verticale? 
    200    widget_control, findtopid(id),  get_uvalue = top_uvalue 
    201    zgrid = extractatt(top_uvalue, 'zgrid') 
    202    grid_t = zgrid EQ 'T' 
    203    if grid_t NE depthlev1_uval.grid_t then BEGIN 
    204       widget_control, depthlev2id, get_uvalue = depthlev2_uval 
    205       depthlev1_uval.grid_t = grid_t 
    206       depthlev2_uval.grid_t = grid_t 
    207 ; 
    208       if grid_t then gdep = gdept ELSE gdep = gdepw 
     197; depth 
     198; 
     199   dthlv1id = widget_info(id, find_by_uname = 'dthlv1') 
     200   dthlv2id = widget_info(id, find_by_uname = 'dthlv2') 
     201   depth1id = widget_info(id, find_by_uname = 'depth1') 
     202   depth2id = widget_info(id, find_by_uname = 'depth2') 
     203; which type of point? 
     204   widget_control, dthlv1id, get_uvalue = dthlv1_uval 
     205; get the new axis 
     206   if dthlv1_uval.grid_t EQ 1 then gdep = gdept ELSE gdep = gdepw 
     207 ; Did we change the vertical axis? 
     208   widget_control, dthlv1id, get_value = dthlv1_value 
     209   gdep1 = floor(fix(dthlv1_value.combobox_value)) 
     210   IF array_equal(gdep1, floor(gdep)) NE 1 THEN BEGIN 
    209211      gdep1 = floor(gdep) 
    210212      gdep2 = ceil(gdep) 
    211       identique = where(gdep2-gdep1 EQ 0) 
    212       if identique[0] NE -1 then gdep2[identique] = gdep2[identique] +1 
    213       depthlev1_uval.value = gdep1 
    214       depthlev2_uval.value = gdep2 
    215 ; 
    216       widget_control, depthlev1id, set_value = {value:strtrim(gdep1, 1)} 
    217       widget_control, depthlev2id, set_value = {value:strtrim(gdep2, 1)} 
    218 ; 
    219       widget_control, depthlev1id, set_uvalue = depthlev1_uval 
    220       widget_control, depthlev2id, set_uvalue = depthlev2_uval 
    221    ENDIF ELSE BEGIN  
    222       gdep1 = depthlev1_uval.value 
    223       gdep2 = gdep1+1 
    224    ENDELSE 
     213      same = where(gdep2-gdep1 EQ 0) 
     214      if same[0] NE -1 then gdep2[same] = gdep2[same] + 1 
     215      widget_control, dthlv1id, set_value = {value:strtrim(gdep1, 1)} 
     216      widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} 
     217   ENDIF ELSE gdep2 = gdep1+1 
    225218; on s''assure que les profs donnees contiennent bien au moins un 
    226219; niveau. 
     
    238231   if indice1 EQ indice2 then BEGIN 
    239232      if (where(gdep1 GE boxzoom[4] AND gdep2 LE boxzoom[5]))[0]  EQ -1 then begin 
    240          indice1 = 0 > (indice1-(grid_t EQ 1)) 
     233         indice1 = 0 > (indice1-(dthlv1_uval.grid_t EQ 1)) 
    241234         indice2 = indice1 
    242235      endif 
     
    246239; maintenant que les values et les indexes sont definis proprement, 
    247240; on peut les appliquer 
    248    widget_control, depthlev1id, set_value = {droplist_select:indice1} 
    249    widget_control, depthlev2id, set_value = {droplist_select:indice2} 
     241   widget_control, dthlv1id, set_value = {combobox_select:indice1} 
     242   widget_control, dthlv2id, set_value = {combobox_select:indice2} 
    250243; controler les min et les max des sliders... 
    251244   if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 
     
    265258FUNCTION cw_domain_get_value, id 
    266259   box = lonarr(6) 
    267    possiblecase = ['lon1', 'lon2','lat1', 'lat2','depth1','depth2'] 
     260   possiblecase = ['lon1', 'lon2', 'lat1', 'lat2', 'depth1', 'depth2'] 
    268261   for i = 0, 5 do begin 
    269       widget_control,widget_info(id,find_by_uname = possiblecase[i]) $ 
     262      widget_control, widget_info(id, find_by_uname = possiblecase[i]) $ 
    270263       , get_value = value 
    271264      box[i] = value.value 
     
    278271; help,  /struct, event 
    279272   if (where(tag_names(event) EQ 'OUT'))[0] NE -1 then if event.out NE 0 then return,  -1 
    280    widget_control, event.id, get_uvalue=uval 
     273   widget_control, event.id, get_uvalue = uval 
    281274   case uval.name of 
    282275      'lon1':widget_control,widget_info(event.handler,find_by_uname = 'lon2') $ 
     
    306299         widget_control, id, set_value = value.slider_min_max[1] 
    307300      END 
    308       'depthlev1':BEGIN 
     301      'dthlv1':BEGIN 
    309302; ids... 
    310303         depth1id = widget_info(event.handler,find_by_uname = 'depth1') 
    311304         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    312          depthlev2id = widget_info(event.handler,find_by_uname = 'depthlev2') 
    313 ; faut-il changer depthlev2 ? 
    314          widget_control, depthlev2id, get_value = depthlev2_value 
    315          if depthlev2_value.droplist_select LT event.index then BEGIN 
    316 ; on redefinie la valeur de depthlev2id 
    317             widget_control, depthlev2id, set_value = {droplist_select:event.index} 
     305         dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 
     306; faut-il changer dthlv2 ? 
     307         widget_control, event.id, get_value = dthlv1_value 
     308         gdep1 = fix(dthlv1_value.combobox_value) 
     309         widget_control, dthlv2id, get_value = dthlv2_value 
     310         gdep2 = fix(dthlv2_value.combobox_value) 
     311         if dthlv2_value.combobox_index LT event.index then BEGIN 
     312; on redefinie la valeur de dthlv2id 
     313            widget_control, dthlv2id, set_value = {combobox_select:event.index} 
    318314; donc on redefinit la valeur et le max du slider 2 
    319             widget_control, depthlev2id, get_uvalue = depthlev2_uval 
    320315            if event.index EQ jpk-1 then BEGIN  
    321316               max = max([gdept, gdepw]) 
    322317               max = strtrim(string(max,format='(e8.0)'), 1) 
    323318               max = float('1'+strmid(max, 1))+float(max) 
    324             ENDIF ELSE max = depthlev2_uval.value[event.index+1]-1 
     319            ENDIF ELSE max = gdep2[event.index+1]-1 
    325320            widget_control, depth2id $ 
    326              , set_value = {slider_max:max, value:depthlev2_uval.value[event.index]} 
     321             , set_value = {slider_max:max, value:gdep2[event.index]} 
    327322; du coup on redefinie donc le max du slider 1  
    328             widget_control, depth1id, set_value = {slider_max:uval.value[event.index]} 
     323            widget_control, depth1id, set_value = {slider_max:gdep1[event.index]} 
    329324         END  
    330325; on redefinie la valeur et le min du slider depth 1 
    331          if event.index EQ 0 then min = 0 ELSE min = uval.value[event.index-1]+1 
    332          widget_control, depth1id, set_value = {slider_min:min, value:uval.value[event.index]} 
     326         if event.index EQ 0 then min = 0 ELSE min = gdep1[event.index-1]+1 
     327         widget_control, depth1id, set_value = {slider_min:min, value:gdep1[event.index]} 
    333328; du coup on change aussi la valeur du min du slider depth 2 
    334          widget_control, depth2id, set_value = {slider_min:uval.value[event.index]+1} 
    335       END 
    336       'depthlev2':BEGIN 
     329         widget_control, depth2id, set_value = {slider_min:gdep1[event.index]+1} 
     330      END 
     331      'dthlv2':BEGIN 
    337332; ids... 
    338333         depth1id = widget_info(event.handler,find_by_uname = 'depth1') 
    339334         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    340          depthlev1id = widget_info(event.handler,find_by_uname = 'depthlev1') 
    341 ; faut-il changer depthlev1 ? 
    342          widget_control, depthlev1id, get_value = depthlev1_value 
    343          if depthlev1_value.droplist_select GT event.index then BEGIN 
    344 ; on redefinie la valeur de depthlev1id 
    345             widget_control, depthlev1id, set_value = {droplist_select:event.index} 
     335         dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 
     336; faut-il changer dthlv1 ? 
     337         widget_control, dthlv1id, get_value = dthlv1_value 
     338         gdep1 = fix(dthlv1_value.combobox_value) 
     339         widget_control, event.id, get_value = dthlv2_value 
     340         gdep2 = fix(dthlv2_value.combobox_value) 
     341         if dthlv1_value.combobox_index GT event.index then BEGIN 
     342; on redefinie la valeur de dthlv1id 
     343            widget_control, dthlv1id, set_value = {combobox_select:event.index} 
    346344; donc on redefinit la valeur et le min du slider 1 
    347             widget_control, depthlev1id, get_uvalue = depthlev1_uval 
    348             if event.index EQ 0 then min = 0 ELSE min = uval.value[event.index-1] 
     345            if event.index EQ 0 then min = 0 ELSE min = gdep2[event.index-1] 
    349346            widget_control, depth1id $ 
    350              , set_value = {slider_min:min, value:depthlev1_uval.value[event.index]} 
     347             , set_value = {slider_min:min, value:gdep1[event.index]} 
    351348; du coup on redefinie donc le min du slider 2 
    352             widget_control, depth2id, set_value = {slider_min:uval.value[event.index]} 
     349            widget_control, depth2id, set_value = {slider_min:gdep2[event.index]} 
    353350         END  
    354351; on redefinie la valeur et le max du slider depth 2 
     
    357354            max = strtrim(string(max,format='(e8.0)'), 1) 
    358355            max = float('1'+strmid(max, 1))+float(max) 
    359          ENDIF ELSE max = uval.value[event.index+1]-1 
    360          widget_control, depth2id, set_value = {slider_max:max, value:uval.value[event.index]} 
     356         ENDIF ELSE max = gdep2[event.index+1]-1 
     357         widget_control, depth2id, set_value = {slider_max:max, value:gdep2[event.index]} 
    361358; du coup on change aussi la valeur du max du slider depth 1 
    362          widget_control, depth1id, set_value = {slider_max:uval.value[event.index]-1} 
     359         widget_control, depth1id, set_value = {slider_max:gdep2[event.index]-1} 
    363360      END 
    364361      'depth1':BEGIN 
    365362; ids... 
    366363         depth2id = widget_info(event.handler,find_by_uname = 'depth2') 
    367          depthlev1id = widget_info(event.handler,find_by_uname = 'depthlev1') 
    368 ; doit-on changer depthlev1 ? 
    369          widget_control, depthlev1id, get_value = depthlev1_value 
    370          widget_control, depthlev1id, get_uvalue = depthlev1_uval 
    371          rien = where(depthlev1_uval.value LT event.value, indice) 
     364         dthlv1id = widget_info(event.handler,find_by_uname = 'dthlv1') 
     365; doit-on changer dthlv1 ? 
     366         widget_control, dthlv1id, get_value = dthlv1_value 
     367         gdep1 = fix(dthlv1_value.combobox_value) 
     368         rien = where(gdep1 LT event.value, indice) 
    372369         indice = indice < (jpk-1) 
    373          if indice NE depthlev1_value.droplist_select then begin 
     370         if indice NE dthlv1_value.combobox_index then begin 
    374371; on change le min de depth2 
    375             widget_control, depth2id, set_value = {slider_min:depthlev1_uval.value[indice]+1} 
    376 ; on redefinie la valeur de depthlev1id 
    377             widget_control, depthlev1id, set_value = {droplist_select:indice} 
     372            widget_control, depth2id, set_value = {slider_min:gdep1[indice]+1} 
     373; on redefinie la valeur de dthlv1id 
     374            widget_control, dthlv1id, set_value = {combobox_select:indice} 
    378375; donc on redefinit le min du slider 1 
    379             if indice EQ 0 then min = 0 ELSE min = depthlev1_uval.value[indice-1]+1 
     376            if indice EQ 0 then min = 0 ELSE min = gdep1[indice-1]+1 
    380377            widget_control, event.id, set_value = {slider_min:min} 
    381378         endif 
     
    384381; ids... 
    385382         depth1id = widget_info(event.handler,find_by_uname = 'depth1') 
    386          depthlev2id = widget_info(event.handler,find_by_uname = 'depthlev2') 
    387 ; doit-on changer depthlev2 ? 
    388          widget_control, depthlev2id, get_value = depthlev2_value 
    389          widget_control, depthlev2id, get_uvalue = depthlev2_uval 
    390          rien = where(depthlev2_uval.value LE event.value, indice) 
     383         dthlv2id = widget_info(event.handler,find_by_uname = 'dthlv2') 
     384; doit-on changer dthlv2 ? 
     385         widget_control, dthlv2id, get_value = dthlv2_value 
     386         gdep2 = fix(dthlv2_value.combobox_value) 
     387         rien = where(gdep2 LE event.value, indice) 
    391388         indice = 0 > (indice-1) 
    392          if indice NE depthlev2_value.droplist_select then begin 
     389         if indice NE dthlv2_value.combobox_index then begin 
    393390; on change le max de depth1 
    394             widget_control, depth1id, set_value = {slider_max:depthlev2_uval.value[indice]-1} 
    395 ; on redefinie la valeur de depthlev2id 
    396             widget_control, depthlev2id, set_value = {droplist_select:indice} 
     391            widget_control, depth1id, set_value = {slider_max:gdep2[indice]-1} 
     392; on redefinie la valeur de dthlv2id 
     393            widget_control, dthlv2id, set_value = {combobox_select:indice} 
    397394; donc on redefinit le max du slider 2 
    398395            if indice EQ jpk-1 then BEGIN  
     
    400397               max = strtrim(string(max,format='(e8.0)'), 1) 
    401398               max = float('1'+strmid(max, 1))+float(max) 
    402             ENDIF ELSE max = depthlev2_uval.value[indice+1]-1 
     399            ENDIF ELSE max = gdep2[indice+1]-1 
    403400            widget_control, event.id, set_value = {slider_max:max} 
    404401         endif 
     
    412409end 
    413410;********************************************************************* 
    414 FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex 
    415 ; 
    416 @common 
    417 ; cheking exclusive keywords 
    418    column = keyword_set(column)*(1-keyword_set(row)) 
    419    row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column)  
     411FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, _extra = ex 
     412; 
     413@cm_4mesh 
     414@cm_4data 
     415; 
    420416; def de la boxzoom 
    421    if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2 $ 
    422                                            , min([gdepw[0], gdept[0]]), max([gdepw[0], gdept[0]]) ] 
    423    Case N_Elements(Boxzoom) OF 
    424       0:boxzoom = [lon1, lon2, lat1, lat2, vert1, vert2] 
    425       1:boxzoom=[lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 
    426       2:boxzoom=[lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 
    427       4:boxzoom=[Boxzoom, vert1, vert2] 
    428       5:boxzoom=[Boxzoom[0:3], 0, Boxzoom[4]] 
    429       6: 
    430       Else: return, report('Mauvaise Definition de Boxzoom') 
    431    ENDCASE 
    432 ; 
    433    boxzoom[0] = floor(boxzoom[0]) 
    434    boxzoom[1] = ceil(boxzoom[1]) 
    435    boxzoom[2] = floor(boxzoom[2]) 
    436    boxzoom[3] = ceil(boxzoom[3]) 
    437    boxzoom[4] = floor(boxzoom[4]) 
    438    boxzoom[5] = ceil(boxzoom[5]) 
    439 ;------------------------------------------------ 
    440    if NOT keyword_set(uvalue) then uvalue = '' 
    441    if NOT keyword_set(uname) then uname = '' 
    442    base = widget_base(parent, /row  $ 
    443                       , space = 1,  xpad = 1,  ypad = 1 $ 
    444                       , EVENT_FUNC = 'cw_domain_event' $ 
    445                       , FUNC_GET_VALUE='cw_domain_get_value' $ 
    446                       , PRO_SET_VALUE='cw_domain_set_value' $ 
    447                       , UVALUE = uvalue, UNAME = uname, _extra = ex)    
     417  Case N_Elements(Boxzoom) OF 
     418    0:boxzoom = [lon1, lon2, lat1, lat2 $ 
     419                 , min([gdepw[0], gdept[0]]), max([gdepw[0], gdept[0]]) ] 
     420    1:boxzoom = [lon1, lon2, lat1, lat2, 0., boxzoom[0]] 
     421    2:boxzoom = [lon1, lon2, lat1, lat2, boxzoom[0], boxzoom[1]] 
     422    4:boxzoom = [Boxzoom, vert1, vert2] 
     423    5:boxzoom = [Boxzoom[0:3], 0, Boxzoom[4]] 
     424    6: 
     425    Else: return, report('Mauvaise Definition de Boxzoom') 
     426  ENDCASE 
     427  IF total(Boxzoom) EQ 0 THEN $ 
     428     boxzoom = [lon1, lon2, lat1, lat2, min([gdepw[0], gdept[0]]), max([gdepw[0], gdept[0]])] 
     429; 
     430  boxzoom[0] = floor(boxzoom[0]) 
     431  boxzoom[1] = ceil(boxzoom[1]) 
     432  boxzoom[2] = floor(boxzoom[2]) 
     433  boxzoom[3] = ceil(boxzoom[3]) 
     434  boxzoom[4] = floor(boxzoom[4]) 
     435  boxzoom[5] = ceil(boxzoom[5]) 
     436;------------------------------------------------ 
     437  if NOT keyword_set(uvalue) then uvalue = '' 
     438  if NOT keyword_set(uname) then uname = '' 
     439  base = widget_base(parent, row = 2, space = 0 $ 
     440                     , EVENT_FUNC = 'cw_domain_event' $ 
     441                     , FUNC_GET_VALUE = 'cw_domain_get_value' $ 
     442                     , PRO_SET_VALUE = 'cw_domain_set_value' $ 
     443                     , UVALUE = uvalue, UNAME = uname, _extra = ex)    
     444;------------------------------------------------ 
     445  baseh = widget_base(base, column = 1+keyword_set(unzoom), space = 0) 
     446;------------------------------------------------ 
     447  baseh1 = widget_base(baseh, row = 2, space = 0) 
    448448;-------------longitude--------------------------- 
    449    basehori = widget_base(base, ROW = row, COLUMN = column) 
    450 ;-------------longitude--------------------------- 
    451    min = floor(min([glamt,glamf], max = max)) 
    452    max = ceil(max) 
    453    lonbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'lonbase') 
    454    lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 
    455                        , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $ 
    456                        , title = 'lon1', minimum = min $ 
    457                        , maximum = (boxzoom[1] < max)-keyword_set(strict)) 
    458    lon2id = cw_slider_pm(lonbase,value=((min > boxzoom[0])+keyword_set(strict)) > boxzoom[1] < max $ 
    459                        , uvalue={name:'lon2', strict:keyword_set(strict)} $ 
    460                        , uname='lon2', title = 'lon2', maximum = max $ 
    461                        , minimum = (min > boxzoom[0])+keyword_set(strict)) 
    462    widget_control, lonbase, set_uvalue = {name:'geographic'} 
     449  min = floor(min([glamt, glamf], max = max)) 
     450  max = ceil(max) 
     451  IF max-min EQ 361 AND keyword_set(key_periodic) THEN max = max-1 
     452  lonbase = widget_base(baseh1, column = 2, space = 0, uname = 'lonbase', uvalue = {name:'geographic'}) 
     453  lon1id = cw_slider_pm(lonbase, value = min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 
     454                        , uvalue = {name:'lon1', strict:keyword_set(strict)}, uname = 'lon1' $ 
     455                        , title = 'lon1', minimum = min $ 
     456                        , maximum = (boxzoom[1] < max)-keyword_set(strict)) 
     457  lon2id = cw_slider_pm(lonbase, value = ((min > boxzoom[0])+keyword_set(strict)) > boxzoom[1] < max $ 
     458                        , uvalue = {name:'lon2', strict:keyword_set(strict)} $ 
     459                        , uname = 'lon2', title = 'lon2', maximum = max $ 
     460                        , minimum = (min > boxzoom[0])+keyword_set(strict)) 
    463461;---------------latitude------------------------- 
    464    min = floor(min([gphit,gphif], max = max)) 
    465    max = ceil(max) 
    466    latbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'latbase') 
    467    lat1id = cw_slider_pm(latbase,value=min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $ 
    468                        , uvalue={name:'lat1', strict:keyword_set(strict)},uname ='lat1' $ 
    469                        , title = 'lat1', minimum =min $ 
    470                        , maximum = ((boxzoom[3] < max)-keyword_set(strict))) 
    471    lat2id = cw_slider_pm(latbase,value=((min > boxzoom[2])+keyword_set(strict)) > boxzoom[3] < max $ 
    472                        , uvalue={name:'lat2', strict:keyword_set(strict)} $ 
    473                        , uname ='lat2', title = 'lat2' ,maximum =  max $ 
    474                        , minimum =(min > boxzoom[2])+keyword_set(strict)) 
    475    widget_control, latbase, set_uvalue = {name:'geographic'} 
     462  min = floor(min([gphit, gphif], max = max)) 
     463  max = ceil(max) 
     464  latbase = widget_base(baseh1, column = 2, space = 0, uname = 'latbase', uvalue = {name:'geographic'}) 
     465  lat1id = cw_slider_pm(latbase, value = min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $ 
     466                        , uvalue = {name:'lat1', strict:keyword_set(strict)}, uname = 'lat1' $ 
     467                        , title = 'lat1', minimum = min $ 
     468                        , maximum = ((boxzoom[3] < max)-keyword_set(strict))) 
     469  lat2id = cw_slider_pm(latbase, value = ((min > boxzoom[2])+keyword_set(strict)) > boxzoom[3] < max $ 
     470                        , uvalue = {name:'lat2', strict:keyword_set(strict)} $ 
     471                        , uname = 'lat2', title = 'lat2', maximum =  max $ 
     472                        , minimum = (min > boxzoom[2])+keyword_set(strict)) 
    476473;----------------unzoom------------------------ 
    477    if keyword_set(unzoom) then rien = widget_button(basehori,value='unzoom', uvalue={name:'unzoom'}) 
     474  if keyword_set(unzoom) then rien = widget_button(baseh, value = 'unzoom', uvalue = {name:'unzoom'}, xsize = 60, ysize = 110) 
    478475;----------------depth------------------------ 
    479    basevert = widget_base(base, ROW = row, COLUMN = column) 
    480    basedepth = widget_base(basevert, /row) 
    481 ; 
    482    if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept 
    483    gdep1 = floor(gdep) 
    484    gdep2 = ceil(gdep) 
    485    identique = where(gdep2-gdep1 EQ 0) 
    486    if identique[0] NE -1 then gdep2[identique] = gdep2[identique] +1 
    487    sgdep1 = strtrim(gdep1, 1) 
    488    sgdep2 = strtrim(gdep2, 1) 
    489 ; 
    490    basedepthdrop = widget_base(basedepth, column = column,  row = row) 
    491 ; 
    492    dephtid=cw_droplist_pm(basedepthdrop,value=''+sgdep1, uvalue={name:'depthlev1', value:gdep1, grid_t:strupcase(vargrid) NE 'W'}, uname='depthlev1') 
    493    rien = where(gdep1 LT boxzoom[4], indice1) 
    494    indice1 = indice1 < (jpk-1) 
    495    widget_control, dephtid, set_value = {droplist_select:indice1} 
    496 ; 
    497    dephtid=cw_droplist_pm(basedepthdrop,value=''+sgdep2, uvalue={name:'depthlev2', value:gdep2, grid_t:strupcase(vargrid) NE 'W'}, uname='depthlev2') 
    498    rien = where(gdep2 LE boxzoom[5], indice2) 
    499    indice2 = indice1 > (indice2-1) 
    500    widget_control, dephtid, set_value = {droplist_select:indice2} 
    501 ; 
    502    basedepthslid = widget_base(basedepth, column = column,  row = row) 
    503 ; 
    504    if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 
    505    max1 = (min1+1) > gdep1[indice2] 
    506    rien = cw_slider_pm(basedepthslid, value= min1 > boxzoom[4] < (boxzoom[5] < max1) $ 
    507                        , uvalue = {name:'depth1'}, uname = 'depth1' $ 
    508                        , title = 'depth1', minimum = min1, maximum = max1) 
    509 ; 
    510    min2 = gdep2[indice1] 
    511    if indice2 EQ jpk-1 then BEGIN  
    512       max2 = max([gdept, gdepw]) 
    513       max2 = strtrim(string(max2,format='(e8.0)'), 1) 
    514       max2 = float('1'+strmid(max2, 1))+float(max2) 
    515    ENDIF ELSE max2 = gdep1[indice2+1] 
    516    if max2 EQ min2 then max2 = min2+1 
    517    rien = cw_slider_pm(basedepthslid, value= (min2 > boxzoom[4]) > boxzoom[5] < max2 $ 
    518                        , uvalue={name:'depth2'}, minimum = min2 $ 
    519                        , uname = 'depth2', title = 'depth2' ,maximum =  max2) 
     476  basez = widget_base(base, column = 3, space = 0, /base_align_center) 
     477;------------------------------------------------ 
     478  basezdrp = widget_base(basez, row = 2, space = 0) 
     479; 
     480  if strupcase(vargrid) EQ 'W' then gdep = gdepw ELSE gdep = gdept 
     481  gdep1 = floor(gdep) 
     482  gdep2 = ceil(gdep) 
     483  same = where(gdep2-gdep1 EQ 0) 
     484  if same[0] NE -1 then gdep2[same] = gdep2[same] +1 
     485  sgdep1 = strtrim(gdep1, 1) 
     486  sgdep2 = strtrim(gdep2, 1) 
     487; 
     488  dephtid = cw_combobox_pm(basezdrp, value = ''+sgdep1, uvalue = {name:'dthlv1', grid_t:strupcase(vargrid) NE 'W'}, uname = 'dthlv1') 
     489  rien = where(gdep1 LT boxzoom[4], indice1) 
     490  indice1 = indice1 < (jpk-1) 
     491  widget_control, dephtid, set_value = {combobox_select:indice1} 
     492; 
     493  dephtid = cw_combobox_pm(basezdrp, value = ''+sgdep2, uvalue = {name:'dthlv2'}, uname = 'dthlv2') 
     494  rien = where(gdep2 LE boxzoom[5], indice2) 
     495  indice2 = indice1 > (indice2-1) 
     496  widget_control, dephtid, set_value = {combobox_select:indice2} 
     497; 
     498;------ 
     499;   basedepthslid = widget_base(base, column = 2, space = 0) 
     500  strminlen = max(strlen(strtrim(round([gdept, gdepw]), 1))) 
     501; 
     502  if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 
     503  max1 = (min1+1) > gdep1[indice2] 
     504  rien = cw_slider_pm(basez, value = min1 > boxzoom[4] < (boxzoom[5] < max1) $ 
     505                      , uvalue = {name:'depth1'}, uname = 'depth1', strminlen = strminlen $ 
     506                      , title = 'z1', minimum = min1, maximum = max1) 
     507; 
     508  min2 = gdep2[indice1] 
     509  if indice2 EQ jpk-1 then BEGIN  
     510    max2 = max([gdept, gdepw]) 
     511    max2 = strtrim(string(max2, format = '(e8.0)'), 1) 
     512    max2 = float('1'+strmid(max2, 1))+float(max2) 
     513  ENDIF ELSE max2 = gdep1[indice2+1] 
     514  if max2 EQ min2 then max2 = min2+1 
     515  rien = cw_slider_pm(basez, value = (min2 > boxzoom[4]) > boxzoom[5] < max2 $ 
     516                      , uvalue = {name:'depth2'}, minimum = min2, maximum =  max2 $ 
     517                      , uname = 'depth2', title = 'z2', strminlen = strminlen) 
    520518;-------------------------------------------- 
    521519; 
    522 ; 
    523 ; 
    524    return, base 
     520  return, base 
    525521end 
Note: See TracChangeset for help on using the changeset viewer.