- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
r172 r226 12 12 ; widget_control, Id, set_value = boxzoom 13 13 ; END 14 ; 'get':BEGIN 14 ; 'get':BEGIN 15 15 ; widget_control, Id, get_value = value 16 16 ; print, value … … 45 45 ; @categories 46 46 ; Compound widget 47 ; 47 ; 48 48 ; @param ID 49 49 ; … … 53 53 ; 54 54 ; @returns 55 ; 56 ; 55 ; 57 56 ; @uses 58 ; 59 ; 57 ; 60 58 ; @restrictions 61 ; 62 ; 59 ; 63 60 ; @examples 64 ; 65 ; 61 ; 66 62 ; @history 67 ; 68 ; 69 ; @version 63 ; 64 ; @version 70 65 ; $Id$ 71 66 ;- … … 86 81 ; What is the type of boxzoom ? 87 82 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 88 options = extractatt(top_uvalue, 'options') 83 options = extractatt(top_uvalue, 'options') 89 84 flags = extractatt(top_uvalue, 'optionsflag') 90 85 flags = flags[*, currentplot] … … 119 114 Case N_Elements(Value) OF 120 115 0:boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] 121 1:BEGIN 116 1:BEGIN 122 117 if value EQ -1 then boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] $ 123 118 ELSE boxzoom=[lonn1, lonn2, latt1, latt2, 0.,value[0]] … … 127 122 5:boxzoom=[Value[0:3], 0, Value[4]] 128 123 6:boxzoom = Value 129 Else:BEGIN 124 Else:BEGIN 130 125 rien = report('Wrong Definition of Boxzoom') 131 126 END … … 151 146 min = floor(min([glamt,glamf], max = max)) 152 147 max = ceil(max) 153 ENDIF ELSE BEGIN 148 ENDIF ELSE BEGIN 154 149 min = 0 155 150 max = jpi-1 … … 195 190 min = floor(min([gphit,gphif], max = max)) 196 191 max = ceil(max) 197 ENDIF ELSE BEGIN 192 ENDIF ELSE BEGIN 198 193 min = 0 199 194 max = jpj-1 … … 250 245 widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} 251 246 ENDIF ELSE gdep2 = gdep1+1 252 ; We make sure that given depth es containat least one level.247 ; We make sure that given depths contains at least one level. 253 248 if boxzoom[4] GT boxzoom[5] then begin 254 249 rien = boxzoom[4] … … 256 251 boxzoom[5] = rien 257 252 endif 258 ; 253 ; 259 254 rien = where(gdep1 LT boxzoom[4], indice1) 260 255 indice1 = indice1 < (jpk-1) … … 279 274 widget_control, depth1id, set_value = {slider_min:min1, slider_max:max1, value:boxzoom[4]} 280 275 min2 = gdep2[indice1] 281 if indice2 EQ jpk-1 then BEGIN 276 if indice2 EQ jpk-1 then BEGIN 282 277 max2 = max([gdept, gdepw]) 283 278 max2 = strtrim(string(max2,format='(e8.0)'), 1) … … 295 290 ; @categories 296 291 ; Compound widget 297 ; 292 ; 298 293 ; @param ID 299 294 ; 300 295 ; 301 296 ; @returns 302 ; 303 ; 297 ; 304 298 ; @uses 305 ; 306 ; 299 ; 307 300 ; @restrictions 308 ; 309 ; 301 ; 310 302 ; @examples 311 ; 312 ; 303 ; 313 304 ; @history 314 ; 315 ; 316 ; @version 305 ; 306 ; @version 317 307 ; $Id$ 318 308 ;- … … 337 327 ; @categories 338 328 ; Compound widget 339 ; 329 ; 340 330 ; @param EVENT 341 331 ; 342 332 ; 343 333 ; @returns 344 ; 345 ; 334 ; 346 335 ; @uses 347 ; 348 ; 336 ; 349 337 ; @restrictions 350 ; 351 ; 338 ; 352 339 ; @examples 353 ; 354 ; 340 ; 355 341 ; @history 356 ; 357 ; 358 ; @version 342 ; 343 ; @version 359 344 ; $Id$ 360 345 ;- … … 408 393 widget_control, dthlv2id, set_value = {combobox_select:event.index} 409 394 ; So we redefine the value and the max of the slider 2 410 if event.index EQ jpk-1 then BEGIN 395 if event.index EQ jpk-1 then BEGIN 411 396 max = max([gdept, gdepw]) 412 397 max = strtrim(string(max,format='(e8.0)'), 1) … … 417 402 ; So we redefine the max of the slider 1 418 403 widget_control, depth1id, set_value = {slider_max:gdep1[event.index]} 419 END 420 ; We redefine the value and the min of the slider depth1 404 END 405 ; We redefine the value and the min of the slider depth1 421 406 if event.index EQ 0 then min = 0 ELSE min = gdep1[event.index-1]+1 422 407 widget_control, depth1id, set_value = {slider_min:min, value:gdep1[event.index]} … … 443 428 ; Se we redefine the min of the slider 2 444 429 widget_control, depth2id, set_value = {slider_min:gdep2[event.index]} 445 END 430 END 446 431 ; We redefine the value and the max of the slider depth 2 447 if event.index EQ jpk-1 then BEGIN 432 if event.index EQ jpk-1 then BEGIN 448 433 max = max([gdept, gdepw]) 449 434 max = strtrim(string(max,format='(e8.0)'), 1) … … 488 473 widget_control, dthlv2id, set_value = {combobox_select:indice} 489 474 ; So we redefine the min of the slider 2 490 if indice EQ jpk-1 then BEGIN 475 if indice EQ jpk-1 then BEGIN 491 476 max = max([gdept, gdepw]) 492 477 max = strtrim(string(max,format='(e8.0)'), 1) … … 510 495 ; @categories 511 496 ; Compound widget 512 ; 497 ; 513 498 ; @param PARENT {in}{required} 514 499 ; The widget ID of the parent widget. 515 ; 500 ; 516 501 ; @keyword UVALUE 517 502 ; The user value to be associated with the widget. 518 ; 503 ; 519 504 ; @keyword UNAME 520 505 ; The user name to be associated with the widget. 521 ; 506 ; 522 507 ; @keyword STRICT 523 508 ; … … 527 512 ; 528 513 ; @keyword BOXZOOM 529 ; Vector indicating the geographic zone on which we want to cut the map. 530 ; If BOXZOOM has : 514 ; Vector indicating the geographic zone on which we want to cut the map. 515 ; If BOXZOOM has : 531 516 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 532 517 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 533 518 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 534 519 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 535 ; 6 elements: The extraction is made on Boxzoom 520 ; 6 elements: The extraction is made on Boxzoom 536 521 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 537 522 ; 538 523 ; @keyword _EXTRA 539 524 ; Used to pass your keywords 540 ; 525 ; 541 526 ; @returns 542 ; 543 ; 527 ; 544 528 ; @uses 545 ; 546 ; 529 ; 547 530 ; @restrictions 548 ; 549 ; 531 ; 550 532 ; @examples 551 ; 552 ; 533 ; 553 534 ; @history 554 ; 555 ; 556 ; @version 535 ; 536 ; @version 557 537 ; $Id$ 558 538 ; 559 539 ; @todo 560 540 ; seb: Documenter 561 ; 541 ; 562 542 ;- 563 543 FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, _extra = ex … … 596 576 , FUNC_GET_VALUE = 'cw_domain_get_value' $ 597 577 , PRO_SET_VALUE = 'cw_domain_set_value' $ 598 , UVALUE = uvalue, UNAME = uname, _extra = ex) 578 , UVALUE = uvalue, UNAME = uname, _extra = ex) 599 579 ;------------------------------------------------ 600 580 baseh = widget_base(base, column = 1+keyword_set(unzoom), space = 0)
Note: See TracChangeset
for help on using the changeset viewer.