Changeset 51
- Timestamp:
- 05/09/06 13:04:45 (18 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 11 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
r49 r51 197 197 if n_elements(calendar) GT 1 then begin 198 198 if total(daycal eq 15) EQ n_elements(calendar) then monthly = 1 199 if total(monthcal EQ 6) EQ n_elements(calendar) then BEGIN & monthly = 1 & yearly = 1 & endif199 if total(monthcal EQ 6) EQ n_elements(calendar) AND n_elements(uniq(daycal, sort(daycal))) EQ 1 then BEGIN & monthly = 1 & yearly = 1 & endif 200 200 if total(yearcal EQ 50) EQ n_elements(calendar) then BEGIN & monthly = 1 & yearly = 1 & centuryly = 1 & ENDIF 201 201 endif -
trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
r49 r51 9 9 ; 'set':BEGIN 10 10 ; widget_control, event.id, get_value = value & value = value[0] 11 ; nothing = execute('bo ite='+value)12 ; widget_control, Id, set_value = bo ite11 ; nothing = execute('boxzoom ='+value) 12 ; widget_control, Id, set_value = boxzoom 13 13 ; END 14 14 ; 'get':BEGIN … … 42 42 @common 43 43 ;------------------------------------------------ 44 ; quel est le type de bo ite?44 ; quel est le type de boxzoom? 45 45 topid = findtopid(id) 46 46 widget_control, topid, get_uvalue=top_uvalue 47 currentplot = (extractatt(top_uvalue, ' petitin'))[2]-147 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 48 48 options = extractatt(top_uvalue, 'options') 49 49 flags = extractatt(top_uvalue, 'optionsflag') … … 54 54 ytype = 'geographic' ELSE ytype = 'index' 55 55 ;------------------------------------------------ 56 ; comment completer la bo ite?56 ; comment completer la boxzoom? 57 57 IF xtype EQ 'geographic' then begin 58 58 lonn1 = lon1 … … 60 60 xtitle = 'lon' 61 61 ENDIF ELSE BEGIN 62 lonn1 = premierxt63 lonn2 = dernierxt62 lonn1 = firstxt 63 lonn2 = lastxt 64 64 xtitle = 'x index' 65 65 ENDELSE … … 69 69 ytitle = 'lat' 70 70 ENDIF ELSE BEGIN 71 latt1 = premieryt72 latt2 = dernieryt71 latt1 = firstyt 72 latt2 = lastyt 73 73 ytitle = 'y index' 74 74 ENDELSE 75 75 ;------------------------------------------------ 76 proff1 = floor(min([gdepw[0], gdept[0]]))77 proff2 = ceil(max([gdepw[0], gdept[0]]))76 vertf1 = floor(min([gdepw[0], gdept[0]])) 77 vertf2 = ceil(max([gdepw[0], gdept[0]])) 78 78 ;------------------------------------------------ 79 79 Case N_Elements(Value) OF 80 0:bo ite = [lonn1, lonn2, latt1, latt2, proff1, proff2]80 0:boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] 81 81 1:BEGIN 82 if value EQ -1 then bo ite = [lonn1, lonn2, latt1, latt2, proff1, proff2] $83 ELSE bo ite=[lonn1, lonn2, latt1, latt2, 0.,value[0]]84 END 85 2:bo ite=[lonn1, lonn2, latt1, latt2, value[0],value[1]]86 4:bo ite=[Value]87 5:bo ite=[Value[0:3], 0, Value[4]]88 6:bo ite= Value82 if value EQ -1 then boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] $ 83 ELSE boxzoom=[lonn1, lonn2, latt1, latt2, 0.,value[0]] 84 END 85 2:boxzoom=[lonn1, lonn2, latt1, latt2, value[0],value[1]] 86 4:boxzoom=[Value] 87 5:boxzoom=[Value[0:3], 0, Value[4]] 88 6:boxzoom = Value 89 89 Else:BEGIN 90 rien = report('Mauvaise Definition de Bo ite')90 rien = report('Mauvaise Definition de Boxzoom') 91 91 END 92 92 ENDCASE 93 93 ;------------------------------------------------ 94 bo ite[0] = floor(boite[0])95 bo ite[1] = ceil(boite[1])96 bo ite[2] = floor(boite[2])97 bo ite[3] = ceil(boite[3])98 if n_elements(bo iteGE 5) then begin99 bo ite[4] = floor(boite[4])100 bo ite[5] = ceil(boite[5])94 boxzoom[0] = floor(boxzoom[0]) 95 boxzoom[1] = ceil(boxzoom[1]) 96 boxzoom[2] = floor(boxzoom[2]) 97 boxzoom[3] = ceil(boxzoom[3]) 98 if n_elements(boxzoom GE 5) then begin 99 boxzoom[4] = floor(boxzoom[4]) 100 boxzoom[5] = ceil(boxzoom[5]) 101 101 endif 102 102 ;------------------------------------------------ … … 108 108 ; 109 109 ; min et max possible 110 if xtype EQ 'geographic' then begin111 min = floor(min([glamt,glam u,glamv], max = max))110 if xtype EQ 'geographic' then BEGIN 111 min = floor(min([glamt,glamf], max = max)) 112 112 max = ceil(max) 113 113 ENDIF ELSE BEGIN … … 127 127 widget_control, lon2id, /destroy 128 128 ; on reconstruit 129 lon1id = cw_slider_pm(lonbase,value=min > bo ite[0] < ((boite[1] < max)-keyword_set(strict)) $129 lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 130 130 , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $ 131 131 , title = xtitle+'1', minimum = min $ 132 , maximum = (bo ite[1] < max)-keyword_set(strict))133 lon2id = cw_slider_pm(lonbase,value=((min > bo ite[0])+keyword_set(strict)) > boite[1] < max $132 , maximum = (boxzoom[1] < max)-keyword_set(strict)) 133 lon2id = cw_slider_pm(lonbase,value=((min > boxzoom[0])+keyword_set(strict)) > boxzoom[1] < max $ 134 134 , uvalue={name:'lon2', strict:keyword_set(strict)} $ 135 135 , uname='lon2', title = xtitle+'2', maximum = max $ 136 , minimum = (min > bo ite[0])+keyword_set(strict))136 , minimum = (min > boxzoom[0])+keyword_set(strict)) 137 137 widget_control, lonbase, set_uvalue = {name:xtype} 138 138 widget_control, lonbase, update = 1 139 139 ENDIF ELSE BEGIN 140 140 ; la nouvelle valeur qu''ils vont avoir 141 cursorvalue1 = min > bo ite[0] < ((boite[1] < max)-strict)142 cursorvalue2 = ((min > bo ite[0])+strict) > boite[1] < max141 cursorvalue1 = min > boxzoom[0] < ((boxzoom[1] < max)-strict) 142 cursorvalue2 = ((min > boxzoom[0])+strict) > boxzoom[1] < max 143 143 ; on change les bornes des slider 144 144 widget_control, lon1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict} … … 153 153 ; min et max possible 154 154 if ytype EQ 'geographic' then begin 155 min = floor(min([gphit,gphi u,gphiv], max = max))155 min = floor(min([gphit,gphif], max = max)) 156 156 max = ceil(max) 157 157 ENDIF ELSE BEGIN … … 168 168 widget_control, lat1id, /destroy 169 169 widget_control, lat2id, /destroy 170 lat1id = cw_slider_pm(latbase,value=min > bo ite[2] < ((boite[3] < max)-keyword_set(strict)) $170 lat1id = cw_slider_pm(latbase,value=min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $ 171 171 , uvalue={name:'lat1', strict:keyword_set(strict)},uname ='lat1' $ 172 172 , title = ytitle+'1', minimum =min $ 173 , maximum = ((bo ite[3] < max)-keyword_set(strict)))174 lat2id = cw_slider_pm(latbase,value=((min > bo ite[2])+keyword_set(strict)) > boite[3] < max $173 , maximum = ((boxzoom[3] < max)-keyword_set(strict))) 174 lat2id = cw_slider_pm(latbase,value=((min > boxzoom[2])+keyword_set(strict)) > boxzoom[3] < max $ 175 175 , uvalue={name:'lat2', strict:keyword_set(strict)} $ 176 176 , uname ='lat2', title = ytitle+'2' ,maximum = max $ 177 , minimum =(min > bo ite[2])+keyword_set(strict))177 , minimum =(min > boxzoom[2])+keyword_set(strict)) 178 178 widget_control, latbase, set_uvalue = {name:ytype} 179 179 widget_control, latbase, update = 1 180 180 ENDIF ELSE BEGIN 181 cursorvalue1 = min > bo ite[2] < ((boite[3] < max)-strict)182 cursorvalue2 = ((min > bo ite[2])+strict) > boite[3] < max181 cursorvalue1 = min > boxzoom[2] < ((boxzoom[3] < max)-strict) 182 cursorvalue2 = ((min > boxzoom[2])+strict) > boxzoom[3] < max 183 183 widget_control, lat1id, set_value = {slider_min:min, slider_max:cursorvalue2-strict} 184 184 widget_control, lat2id, set_value = {slider_min:cursorvalue1+strict, slider_max:max} … … 188 188 ; 189 189 ; 190 if n_elements(bo ite) EQ 4 then return190 if n_elements(boxzoom) EQ 4 then return 191 191 ; 192 192 ; la profondeur … … 225 225 ; on s''assure que les profs donnees contiennent bien au moins un 226 226 ; niveau. 227 if bo ite[4] GT boite[5] then begin228 rien = bo ite[4]229 bo ite[4] = boite[5]230 bo ite[5] = rien227 if boxzoom[4] GT boxzoom[5] then begin 228 rien = boxzoom[4] 229 boxzoom[4] = boxzoom[5] 230 boxzoom[5] = rien 231 231 endif 232 232 ; 233 rien = where(gdep1 LT bo ite[4], indice1)233 rien = where(gdep1 LT boxzoom[4], indice1) 234 234 indice1 = indice1 < (jpk-1) 235 rien = where(gdep2 LE bo ite[5], indice2)235 rien = where(gdep2 LE boxzoom[5], indice2) 236 236 indice2 = indice1 > (indice2-1) 237 237 ; 238 238 if indice1 EQ indice2 then BEGIN 239 if (where(gdep1 GE bo ite[4] AND gdep2 LE boite[5]))[0] EQ -1 then begin239 if (where(gdep1 GE boxzoom[4] AND gdep2 LE boxzoom[5]))[0] EQ -1 then begin 240 240 indice1 = 0 > (indice1-(grid_t EQ 1)) 241 241 indice2 = indice1 242 242 endif 243 bo ite[4] = gdep1[indice1]244 bo ite[5] = boite[4]+1243 boxzoom[4] = gdep1[indice1] 244 boxzoom[5] = boxzoom[4]+1 245 245 endif 246 246 ; maintenant que les values et les indexes sont definis proprement, … … 251 251 if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 252 252 max1 = (min1+1) > gdep1[indice2] 253 widget_control, depth1id, set_value = {slider_min:min1, slider_max:max1, value:bo ite[4]}253 widget_control, depth1id, set_value = {slider_min:min1, slider_max:max1, value:boxzoom[4]} 254 254 min2 = gdep2[indice1] 255 255 if indice2 EQ jpk-1 then BEGIN … … 258 258 max2 = float('1'+strmid(max2, 1))+float(max2) 259 259 ENDIF ELSE max2 = gdep1[indice2+1] 260 widget_control, depth2id, set_value = {slider_min:min2, slider_max:max2, value:bo ite[5]}260 widget_control, depth2id, set_value = {slider_min:min2, slider_max:max2, value:boxzoom[5]} 261 261 ; 262 262 return … … 412 412 end 413 413 ;********************************************************************* 414 FUNCTION cw_domain, parent, BO ITE = boite, STRICT = strict, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex414 FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex 415 415 ; 416 416 @common … … 418 418 column = keyword_set(column)*(1-keyword_set(row)) 419 419 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 420 ; def de la bo ite421 if NOT keyword_set(bo ite) then boite= [lon1, lon2, lat1, lat2 $420 ; def de la boxzoom 421 if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2 $ 422 422 , min([gdepw[0], gdept[0]]), max([gdepw[0], gdept[0]]) ] 423 Case N_Elements(Bo ite) OF424 0:bo ite = [lon1, lon2, lat1, lat2, prof1, prof2]425 1:bo ite=[lon1, lon2, lat1, lat2, 0.,boite[0]]426 2:bo ite=[lon1, lon2, lat1, lat2, boite[0],boite[1]]427 4:bo ite=[Boite, prof1, prof2]428 5:bo ite=[Boite[0:3], 0, Boite[4]]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 429 6: 430 Else: return, report('Mauvaise Definition de Bo ite')430 Else: return, report('Mauvaise Definition de Boxzoom') 431 431 ENDCASE 432 432 ; 433 bo ite[0] = floor(boite[0])434 bo ite[1] = ceil(boite[1])435 bo ite[2] = floor(boite[2])436 bo ite[3] = ceil(boite[3])437 bo ite[4] = floor(boite[4])438 bo ite[5] = ceil(boite[5])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 439 ;------------------------------------------------ 440 440 if NOT keyword_set(uvalue) then uvalue = '' … … 449 449 basehori = widget_base(base, ROW = row, COLUMN = column) 450 450 ;-------------longitude--------------------------- 451 min = floor(min([glamt,glam u,glamv], max = max))451 min = floor(min([glamt,glamf], max = max)) 452 452 max = ceil(max) 453 453 lonbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'lonbase') 454 lon1id = cw_slider_pm(lonbase,value=min > bo ite[0] < ((boite[1] < max)-keyword_set(strict)) $454 lon1id = cw_slider_pm(lonbase,value=min > boxzoom[0] < ((boxzoom[1] < max)-keyword_set(strict)) $ 455 455 , uvalue={name:'lon1', strict:keyword_set(strict)},uname ='lon1' $ 456 456 , title = 'lon1', minimum = min $ 457 , maximum = (bo ite[1] < max)-keyword_set(strict))458 lon2id = cw_slider_pm(lonbase,value=((min > bo ite[0])+keyword_set(strict)) > boite[1] < max $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 459 , uvalue={name:'lon2', strict:keyword_set(strict)} $ 460 460 , uname='lon2', title = 'lon2', maximum = max $ 461 , minimum = (min > bo ite[0])+keyword_set(strict))461 , minimum = (min > boxzoom[0])+keyword_set(strict)) 462 462 widget_control, lonbase, set_uvalue = {name:'geographic'} 463 463 ;---------------latitude------------------------- 464 min = floor(min([gphit,gphi u,gphiv], max = max))464 min = floor(min([gphit,gphif], max = max)) 465 465 max = ceil(max) 466 466 latbase = widget_base(basehori, /ROW, space = 1, xpad = 1, ypad = 1, uname = 'latbase') 467 lat1id = cw_slider_pm(latbase,value=min > bo ite[2] < ((boite[3] < max)-keyword_set(strict)) $467 lat1id = cw_slider_pm(latbase,value=min > boxzoom[2] < ((boxzoom[3] < max)-keyword_set(strict)) $ 468 468 , uvalue={name:'lat1', strict:keyword_set(strict)},uname ='lat1' $ 469 469 , title = 'lat1', minimum =min $ 470 , maximum = ((bo ite[3] < max)-keyword_set(strict)))471 lat2id = cw_slider_pm(latbase,value=((min > bo ite[2])+keyword_set(strict)) > boite[3] < max $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 472 , uvalue={name:'lat2', strict:keyword_set(strict)} $ 473 473 , uname ='lat2', title = 'lat2' ,maximum = max $ 474 , minimum =(min > bo ite[2])+keyword_set(strict))474 , minimum =(min > boxzoom[2])+keyword_set(strict)) 475 475 widget_control, latbase, set_uvalue = {name:'geographic'} 476 476 ;----------------unzoom------------------------ … … 491 491 ; 492 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 bo ite[4], indice1)493 rien = where(gdep1 LT boxzoom[4], indice1) 494 494 indice1 = indice1 < (jpk-1) 495 495 widget_control, dephtid, set_value = {droplist_select:indice1} 496 496 ; 497 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 bo ite[5], indice2)498 rien = where(gdep2 LE boxzoom[5], indice2) 499 499 indice2 = indice1 > (indice2-1) 500 500 widget_control, dephtid, set_value = {droplist_select:indice2} … … 504 504 if indice1 EQ 0 then min1 = 0 ELSE min1 = gdep2[indice1-1] 505 505 max1 = (min1+1) > gdep1[indice2] 506 rien = cw_slider_pm(basedepthslid, value= min1 > bo ite[4] < (boite[5] < max1) $506 rien = cw_slider_pm(basedepthslid, value= min1 > boxzoom[4] < (boxzoom[5] < max1) $ 507 507 , uvalue = {name:'depth1'}, uname = 'depth1' $ 508 508 , title = 'depth1', minimum = min1, maximum = max1) … … 515 515 ENDIF ELSE max2 = gdep1[indice2+1] 516 516 if max2 EQ min2 then max2 = min2+1 517 rien = cw_slider_pm(basedepthslid, value= (min2 > bo ite[4]) > boite[5] < max2 $517 rien = cw_slider_pm(basedepthslid, value= (min2 > boxzoom[4]) > boxzoom[5] < max2 $ 518 518 , uvalue={name:'depth2'}, minimum = min2 $ 519 519 , uname = 'depth2', title = 'depth2' ,maximum = max2) -
trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_miseenpage.pro
r49 r51 6 6 widget_control, event.top, get_uvalue=top_uvalue 7 7 ; 8 petitin = extractatt(top_uvalue, 'petitin')9 numdessinin = petitin[2]-110 petitout = extractatt(top_uvalue, 'petitout')8 smallin = extractatt(top_uvalue, 'smallin') 9 numdessinin = smallin[2]-1 10 smallout = extractatt(top_uvalue, 'smallout') 11 11 ; 12 12 if uval.name EQ 'undo' then begin … … 17 17 ; si on ne change pas le nombre de colonnes, on sort 18 18 if uval.name EQ 'column' then $ 19 if event.index+1 EQ petitin[0] THEN $19 if event.index+1 EQ smallin[0] THEN $ 20 20 return,{ID:event.handler, TOP:event.top, HANDLER:0L} 21 21 ; si on ne change pas le nombre de lignes, on sort 22 22 if uval.name EQ 'row' then $ 23 if event.index+1 EQ petitin[1] THEN $23 if event.index+1 EQ smallin[1] THEN $ 24 24 return,{ID:event.handler, TOP:event.top, HANDLER:0L} 25 25 ; … … 33 33 'clear': 34 34 'column':BEGIN 35 petitin = [event.index+1, petitin[1], 1]36 petitout = [event.index+1, petitout[1], 1]35 smallin = [event.index+1, smallin[1], 1] 36 smallout = [event.index+1, smallout[1], 1] 37 37 END 38 38 'row':BEGIN 39 petitin = [petitin[0], event.index+1, 1]40 petitout = [petitout[0], event.index+1, 1]39 smallin = [smallin[0], event.index+1, 1] 40 smallout = [smallout[0], event.index+1, 1] 41 41 END 42 42 endcase 43 nbredessin = petitin[0]*petitin[1]43 nbredessin = smallin[0]*smallin[1] 44 44 ; 45 45 ; on remet tout a 0 en ce qui concerne les postscripts 46 createhistory, event.top, petitin46 createhistory, event.top, smallin 47 47 ; 48 48 options = extractatt(top_uvalue, 'options') … … 59 59 ; actualisation de la top_uvalue... 60 60 ; 61 *top_uvalue[1, findline(top_uvalue, ' petitin')] = petitin62 *top_uvalue[1, findline(top_uvalue, ' petitout')] = petitout61 *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin 62 *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout 63 63 ; 64 64 *top_uvalue[1, findline(top_uvalue, 'penvs')] = replicate(!p, nbredessin) … … 108 108 end 109 109 ;********************************************************************* 110 FUNCTION cw_miseenpage, parent, petit, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex110 FUNCTION cw_miseenpage, parent, small, UVALUE = uvalue, UNAME = uname, ROW = row, COLUMN = column, UNZOOM = unzoom, _extra = ex 111 111 ; cheking exclusive keywords 112 112 column = keyword_set(column)*(1-keyword_set(row)) … … 121 121 , UVALUE = uvalue, UNAME = uname, _extra = ex) 122 122 ;------------------------------------------------ 123 IF n_elements( petit) eq 0 then petit= [1, 1, 1]123 IF n_elements(small) eq 0 then small = [1, 1, 1] 124 124 basedroplist = widget_base(base, /column, /align_center) 125 125 id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title ='column' $ 126 126 , uvalue ={name:'column'}, uname='column') 127 widget_control, id, set_droplist_select = petit[0]-1127 widget_control, id, set_droplist_select = small[0]-1 128 128 id=widget_droplist(basedroplist, value=strtrim(indgen(10)+1, 1), title =' row ' $ 129 129 , uvalue ={name:'row'}, uname='row') 130 widget_control, id, set_droplist_select = petit[1]-1130 widget_control, id, set_droplist_select = small[1]-1 131 131 basebutton = widget_base(base, /column, /align_center) 132 132 rien = widget_button(basebutton, value = 'Clear', uvalue ={name:'clear'}, uname='clear') -
trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro
r49 r51 3 3 topid = findtopid(id) 4 4 domainid = widget_info(topid, find_by_uname = 'domain') 5 widget_control, domainid, get_value = bo ite6 if bo ite[1]-boite[0] LT boite[3]-boite[2] then type = 'y' ELSE type = 'x'5 widget_control, domainid, get_value = boxzoom 6 if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' 7 7 thickid = widget_info(topid, find_by_uname = 'thickness') 8 8 widget_control, thickid, get_uvalue = thicknessuval … … 11 11 sliderid = widget_info(topid, find_by_uname = 'slider') 12 12 if type EQ 'y' then BEGIN 13 mini = floor(min([glamt, glam u], max = maxi))13 mini = floor(min([glamt, glamf], max = maxi)) 14 14 maxi = ceil(maxi)-thickness 15 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:bo ite[0]<maxi}16 thickness = bo ite[1]-boite[0]15 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[0]<maxi} 16 thickness = boxzoom[1]-boxzoom[0] 17 17 ENDIF ELSE BEGIN 18 mini = floor(min([gphit, gphi v], max = maxi))18 mini = floor(min([gphit, gphif], max = maxi)) 19 19 maxi = ceil(maxi)-thickness 20 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:bo ite[2]<maxi}21 thickness = bo ite[3]-boite[2]20 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[2]<maxi} 21 thickness = boxzoom[3]-boxzoom[2] 22 22 ENDELSE 23 23 thicknessval = thicknessuval.choix … … 40 40 sliderid = widget_info(event.handler, find_by_uname = 'slider') 41 41 ; uniteid = widget_info(event.handler, find_by_uname = 'unite') 42 widget_control, domainid, get_value = bo ite43 if bo ite[1]-boite[0] LT boite[3]-boite[2] then type = 'y' ELSE type = 'x'42 widget_control, domainid, get_value = boxzoom 43 if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' 44 44 widget_control, thickid, get_uvalue = thicknessuval 45 45 widget_control, thickid, get_value = thickness … … 48 48 49 49 if uval.name EQ 'thickness' then begin 50 if bo ite[1]-boite[0] LT boite[3]-boite[2] then type = 'y' ELSE type = 'x'50 if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' 51 51 if type EQ 'y' then BEGIN 52 mini = floor(min([glamt, glam u], max = maxi))52 mini = floor(min([glamt, glamf], max = maxi)) 53 53 maxi = ceil(maxi)-thickness 54 54 ENDIF ELSE BEGIN 55 mini = floor(min([gphit, gphi v], max = maxi))55 mini = floor(min([gphit, gphif], max = maxi)) 56 56 maxi = ceil(maxi)-thickness 57 57 ENDELSE … … 64 64 ; 65 65 ; if uval.name EQ 'unite' then begin 66 ; domdef, bo ite, grille = 'T'66 ; domdef, boxzoom, gridtype = 'T' 67 67 ; if unite EQ 'degre' then BEGIN 68 68 ; if strpos(type,'y') NE -1 then begin 69 ; mini = floor(min([glamt, glam u], max = maxi))69 ; mini = floor(min([glamt, glamf], max = maxi)) 70 70 ; maxi = ceil(maxi) 71 71 ; print, lon1, mini, maxi 72 72 ; widget_control, sliderid, set_value = {value:lon1, slider_min_max:[mini, maxi]} 73 73 ; ENDIF ELSE BEGIN 74 ; mini = floor(min([gphit, glam v], max = maxi))74 ; mini = floor(min([gphit, glamf], max = maxi)) 75 75 ; maxi = ceil(maxi) 76 76 ; widget_control, sliderid, set_value = {value:lat1, slider_min_max:[mini, maxi]} … … 78 78 ; ENDIF ELSE BEGIN 79 79 ; if strpos(type,'y') NE -1 then BEGIN 80 ; print, 'ds if', premierxt, 0, jpi-181 ; widget_control, sliderid, set_value = {value: premierxt, slider_min_max:[0, jpi-1]}80 ; print, 'ds if',firstxt, 0, jpi-1 81 ; widget_control, sliderid, set_value = {value:firstxt, slider_min_max:[0, jpi-1]} 82 82 ; ENDIF ELSE BEGIN 83 ; widget_control, sliderid, set_value = {value: premieryt, slider_min_max:[0, jpj-1]}83 ; widget_control, sliderid, set_value = {value:firstyt, slider_min_max:[0, jpj-1]} 84 84 ; ENDELSE 85 85 ; ENDELSE … … 88 88 ; if unite EQ 'degre' then BEGIN 89 89 if type EQ 'y' then begin 90 bo ite[0] = slider & boite[1] = slider+thickness90 boxzoom[0] = slider & boxzoom[1] = slider+thickness 91 91 ENDIF ELSE BEGIN 92 bo ite[2] = slider & boite[3] = slider+thickness92 boxzoom[2] = slider & boxzoom[3] = slider+thickness 93 93 ENDELSE 94 94 ; ENDIF ELSE BEGIN 95 95 ; if strpos(type,'y') NE -1 then begin 96 ; bo ite[0] = glamt[slider, 0] & boite[1] = glamu[slider+thickness, 0]96 ; boxzoom[0] = glamt[slider, 0] & boxzoom[1] = glamf[slider+thickness, 0] 97 97 ; ENDIF ELSE BEGIN 98 ; bo ite[2] = gphit[0, slider] & boite[3] = gphiv[0, slider+thickness]98 ; boxzoom[2] = gphit[0, slider] & boxzoom[3] = gphif[0, slider+thickness] 99 99 ; ENDELSE 100 100 ; ENDELSE 101 widget_control, domainid, set_value = bo ite101 widget_control, domainid, set_value = boxzoom 102 102 return, {CW_SLIDE_SLICE, ID:event.handler, TOP:event.top, HANDLER:0L} 103 103 end 104 104 ;-------------------------------------------------------------------------------- 105 FUNCTION cw_slide_slice, parent, bo ite = boite, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _extra = ex105 FUNCTION cw_slide_slice, parent, boxzoom = boxzoom, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _extra = ex 106 106 @common 107 107 ;------------------------------------------------ … … 119 119 , FRAME = frame, _extra = ex) 120 120 ;------------------------------------------------ 121 if NOT keyword_set(bo ite) then boite= [lon1, lon2, lat1, lat2]121 if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2] 122 122 ; rien = cw_bgroup(base, ['degre', 'points'],/exclusive, /column, uname = 'unite', uvalue = {name:'unite'}, /return_name, set_value = 0, /no_release) 123 123 thicknessval = indgen(21)+1 … … 126 126 droplistid = cw_droplist_pm(base, value = thicknessval, uname = 'thickness', uvalue = {name:'thickness', choix:thicknessval}) 127 127 ; 128 if bo ite[1]-boite[0] LT boite[3]-boite[2] then type = 'y' ELSE type = 'x'128 if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' 129 129 if type EQ 'y' then BEGIN 130 mini = floor(min([glamt, glam u], max = maxi))131 thickness = bo ite[1]-boite[0]130 mini = floor(min([glamt, glamf], max = maxi)) 131 thickness = boxzoom[1]-boxzoom[0] 132 132 maxi = ceil(maxi)-thickness 133 133 rien = cw_slider_pm(base, minimum = mini, maximum = (mini+1) > maxi $ 134 , value = mini > bo ite[0] < maxi, /column, uname = 'slider' $134 , value = mini > boxzoom[0] < maxi, /column, uname = 'slider' $ 135 135 , uvalue = {name:'slider'}) 136 136 ENDIF ELSE BEGIN 137 mini = floor(min([gphit, gphi v], max = maxi))138 thickness = bo ite[3]-boite[2]137 mini = floor(min([gphit, gphif], max = maxi)) 138 thickness = boxzoom[3]-boxzoom[2] 139 139 maxi = ceil(maxi)-thickness 140 140 rien = cw_slider_pm(base, minimum = mini, maximum = (mini+1) > maxi $ 141 , value = mini > bo ite[2] < maxi, /column, uname = 'slider' $141 , value = mini > boxzoom[2] < maxi, /column, uname = 'slider' $ 142 142 , uvalue = {name:'slider'}) 143 143 ENDELSE … … 152 152 153 153 ; if type EQ 'xt' then begin 154 ; mini = floor(min([glamt,glam u,glamv], max = maxi))154 ; mini = floor(min([glamt,glamf], max = maxi)) 155 155 ; maxi = ceil(maxi) 156 156 ; ENDIF ELSE BEGIN 157 ; mini = floor(min([gphit,gphi u,gphiv], max = maxi))157 ; mini = floor(min([gphit,gphif], max = maxi)) 158 158 ; maxi = ceil(maxi) 159 159 ; ENDELSE -
trunk/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro
r49 r51 49 49 widget_control, event.id, get_uvalue = uval 50 50 widget_control, event.top, get_uvalue = top_uvalue 51 petitin = extractatt(top_uvalue, 'petitin')52 numdessinin = petitin[2]-153 petitout = extractatt(top_uvalue, 'petitout')54 numdessinout = petitout[2]-151 smallin = extractatt(top_uvalue, 'smallin') 52 numdessinin = smallin[2]-1 53 smallout = extractatt(top_uvalue, 'smallout') 54 numdessinout = smallout[2]-1 55 55 ;------------------------------------------------------------ 56 56 case uval of
Note: See TracChangeset
for help on using the changeset viewer.