Changeset 226 for trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
r157 r226 7 7 ; case uval of 8 8 ; 'done':widget_control, event.top, /destroy 9 ; 'set':BEGIN 9 ; 'set':BEGIN 10 10 ; widget_control, event.id, get_value = value 11 11 ; widget_control, ComboboxId, set_value = value 12 12 ; END 13 ; 'get':BEGIN 13 ; 'get':BEGIN 14 14 ; widget_control, ComboboxId, get_value = value 15 15 ; help, value, /struct … … 40 40 ; @file_comments 41 41 ; 42 ; 43 ; @categories 44 ; Compound widget 45 ; 42 ; @categories 43 ; Compound widget 44 ; 46 45 ; @param ID 47 46 ; … … 51 50 ; 52 51 ; @returns 53 ; 54 ; 55 ; @uses 56 ; 57 ; 58 ; @restrictions 59 ; 60 ; 61 ; @examples 62 ; 63 ; 64 ; @history 65 ; 66 ; 67 ; @version 52 ; 53 ; @uses 54 ; 55 ; @restrictions 56 ; 57 ; @examples 58 ; 59 ; @history 60 ; 61 ; @version 68 62 ; $Id$ 69 63 ;- … … 71 65 PRO cw_calendar_set_value, id, value 72 66 ; 73 compile_opt strictarr, strictarrsubs 67 compile_opt strictarr, strictarrsubs 74 68 ; 75 69 ; … … 79 73 widget_control, winfo_id, get_uvalue = infowid 80 74 key_caltype = infowid.caltype 81 75 82 76 ; high freqeuncy calendar 83 77 IF keyword_set(infowid.fakecal) THEN BEGIN 84 78 value2 = date2jul(long(value)) - infowid.fakecal 85 IF value2 LT n_elements(infowid.calendar) AND value2 GE 0 THEN BEGIN 79 IF value2 LT n_elements(infowid.calendar) AND value2 GE 0 THEN BEGIN 86 80 stepid = widget_info(id, find_by_uname = 'step') 87 81 widget_control, stepid, set_value = {combobox_select:value2} … … 89 83 widget_control, winfo_id, set_uvalue = infowid 90 84 ENDIF 91 ENDIF ELSE BEGIN 85 ENDIF ELSE BEGIN 92 86 ; 93 87 value = long(value[0]) … … 122 116 ; @categories 123 117 ; Compound widget 124 ; 118 ; 125 119 ; @param ID 126 120 ; 127 121 ; 128 122 ; @returns 129 ; 130 ; 131 ; @uses 132 ; 133 ; 134 ; @restrictions 135 ; 136 ; 137 ; @examples 138 ; 139 ; 140 ; @history 141 ; 142 ; 143 ; @version 123 ; 124 ; @uses 125 ; 126 ; @restrictions 127 ; 128 ; @examples 129 ; 130 ; @history 131 ; 132 ; @version 144 133 ; $Id$ 145 134 ;- 146 135 FUNCTION cw_calendar_get_value, id 147 136 ; 148 compile_opt strictarr, strictarrsubs 137 compile_opt strictarr, strictarrsubs 149 138 ; 150 139 winfo_id = widget_info(id, find_by_uname = 'infocal') … … 159 148 ; @categories 160 149 ; Compound widget 161 ; 150 ; 162 151 ; @param ID 163 152 ; … … 167 156 ; 168 157 ; @returns 169 ; 170 ; 171 ; @uses 172 ; 173 ; 174 ; @restrictions 175 ; 176 ; 177 ; @examples 178 ; 179 ; 180 ; @history 181 ; 182 ; 183 ; @version 184 ; $Id$ 185 ;- 186 FUNCTION get_cal_value, id, winfoid 187 ; 188 compile_opt strictarr, strictarrsubs 158 ; 159 ; @uses 160 ; 161 ; @restrictions 162 ; 163 ; @examples 164 ; 165 ; @history 166 ; 167 ; @version 168 ; $Id$ 169 ;- 170 FUNCTION get_cal_value, id, winfoid 171 ; 172 compile_opt strictarr, strictarrsubs 189 173 ; 190 174 winfo_id = widget_info(id, find_by_uname = 'infocal') … … 202 186 widget_control, wid_id, get_value = wid_value 203 187 allmonths = string(format = '(C(CMoA))', 31*(indgen(12))) 204 month = (where(allmonths EQ wid_value.combobox_gettext))[0] + 1 188 month = (where(allmonths EQ wid_value.combobox_gettext))[0] + 1 205 189 date = date + 100L * long(month) 206 190 ENDIF ELSE date = date + (oldate MOD 10000L)/100L*100L … … 224 208 ; @categories 225 209 ; Compound widget 226 ; 210 ; 227 211 ; @param EVENT 228 212 ; … … 235 219 ; 236 220 ; @returns 237 ; 238 ; 239 ; @uses 240 ; 241 ; 242 ; @restrictions 243 ; 244 ; 245 ; @examples 246 ; 247 ; 248 ; @history 249 ; 250 ; 251 ; @version 221 ; 222 ; @uses 223 ; 224 ; @restrictions 225 ; 226 ; @examples 227 ; 228 ; @history 229 ; 230 ; @version 252 231 ; $Id$ 253 232 ;- 254 233 PRO set_cal_combobox, event, casename, date0 255 234 ; 256 compile_opt strictarr, strictarrsubs 235 compile_opt strictarr, strictarrsubs 257 236 ; 258 237 ; casename: Which widget shall we move: 'day', 'month' or 'year' ? … … 269 248 ; index of days/months/years according to date0 270 249 case casename of 271 'day':BEGIN 250 'day':BEGIN 272 251 ; list of days corresponding to month0 and year0 273 252 index = where(monthcal EQ month0 AND yearcal EQ year0) 274 253 current = daycal[index] 275 254 END 276 'month':BEGIN 255 'month':BEGIN 277 256 ; list of months corresponding to year0 278 257 index = where(yearcal EQ year0) … … 283 262 current = current[indexbis] 284 263 END 285 'year':BEGIN 264 'year':BEGIN 286 265 ; keep only the uniq years 287 266 index = uniq(yearcal) … … 297 276 if casename EQ 'month' then begin 298 277 widget_control, wid_id, set_value = string(format = '(C(CMoA))', 31*(current-1)) 299 ENDIF ELSE BEGIN 278 ENDIF ELSE BEGIN 300 279 widget_control, wid_id, set_value = strtrim(current, 1) 301 280 ENDELSE … … 310 289 1:selected = 0 311 290 ; 2: a new date has been specified... 312 2:BEGIN 291 2:BEGIN 313 292 case casename of 314 293 'day':selected = (where(current EQ day0))[0] … … 325 304 end 326 305 ;---------------------------------------------------------------------- 327 ; move cyclic ly the calendar to the306 ; move cyclically the calendar to the 328 307 ; value 0 if event.out=1 or combobox_number-1 if event.out=-1 329 308 ;+ … … 333 312 ; @categories 334 313 ; Compound widget 335 ; 314 ; 336 315 ; @param EVENT 337 316 ; … … 341 320 ; 342 321 ; @returns 343 ; 344 ; 345 ; @uses 346 ; 347 ; 348 ; @restrictions 349 ; 350 ; 351 ; @examples 352 ; 353 ; 354 ; @history 355 ; 356 ; 357 ; @version 322 ; 323 ; @uses 324 ; 325 ; @restrictions 326 ; 327 ; @examples 328 ; 329 ; @history 330 ; 331 ; @version 358 332 ; $Id$ 359 333 ;- 360 334 PRO move, event, casename 361 335 ; 362 compile_opt strictarr, strictarrsubs 336 compile_opt strictarr, strictarrsubs 363 337 ; 364 338 possiblecase = ['day', 'month', 'year', 'impossiblecase'] … … 391 365 ; @categories 392 366 ; Compound widget 393 ; 367 ; 394 368 ; @param EVENT 395 369 ; 396 370 ; 397 371 ; @returns 398 ; 399 ; 400 ; @uses 401 ; 402 ; 403 ; @restrictions 404 ; 405 ; 406 ; @examples 407 ; 408 ; 409 ; @history 410 ; 411 ; 412 ; @version 372 ; 373 ; @uses 374 ; 375 ; @restrictions 376 ; 377 ; @examples 378 ; 379 ; @history 380 ; 381 ; @version 413 382 ; $Id$ 414 383 ;- … … 416 385 ; 417 386 @cm_4cal 418 compile_opt strictarr, strictarrsubs 387 compile_opt strictarr, strictarrsubs 419 388 ; 420 389 winfo_id = widget_info(event.handler, find_by_uname = 'infocal') … … 424 393 widget_control, event.id, get_uvalue = uval 425 394 ; high frequency calendar 426 IF uval.name EQ 'step' THEN BEGIN 395 IF uval.name EQ 'step' THEN BEGIN 427 396 infowid.date = jul2date(event.index + infowid.fakecal) 428 397 ENDIF ELSE BEGIN … … 434 403 ; we try to move the combobox just right, with name: possiblecase[whichcase+1] 435 404 if widget_info(event.handler, find_by_uname = possiblecase[whichcase+1]) EQ 0 then BEGIN 436 ; this widget do not exist we set cyclic ly the current widget to the405 ; this widget do not exist we set cyclically the current widget to the 437 406 ; value 0 if event.out=1 or combobox_number-1 if event.out=-1 438 407 widget_control, event.id, get_value = widvalue … … 451 420 ; we update the date 452 421 infowid = get_cal_value(event.handler, winfo_id) 453 ENDELSE 422 ENDELSE 454 423 ; 455 424 widget_control, winfo_id, set_uvalue = infowid … … 465 434 ; @categories 466 435 ; Compound widget 467 ; 436 ; 468 437 ; @param PARENT {in}{required} 469 438 ; The widget ID of the parent widget. … … 474 443 ; @param JDATE0 475 444 ; 476 ;477 445 ; @keyword CALTYPE 478 ; 479 ; 446 ; 480 447 ; @keyword FAKECAL 481 448 ; 482 ; 449 ; 483 450 ; @keyword UVALUE 484 451 ; 485 ;486 452 ; @keyword UNAME 487 453 ; 488 ; 454 ; 489 455 ; @keyword _EXTRA 490 456 ; Used to pass your keywords 491 ; 492 ; @returns 493 ; 494 ; 495 ; @uses 496 ; 497 ; 498 ; @restrictions 499 ; 500 ; 501 ; @examples 502 ; 503 ; 504 ; @history 505 ; 506 ; 507 ; @version 457 ; 458 ; @returns 459 ; 460 ; @uses 461 ; 462 ; @restrictions 463 ; 464 ; @examples 465 ; 466 ; @history 467 ; 468 ; @version 508 469 ; $Id$ 509 470 ; 510 471 ; @todo 511 472 ; seb 512 ; 473 ; 513 474 ;- 514 475 FUNCTION cw_calendar, parent, calendar, jdate0, CALTYPE = CALTYPE, FAKECAL = fakecal, UVALUE = uvalue, UNAME = uname, _extra = ex … … 516 477 @cm_4cal 517 478 ; 518 compile_opt strictarr, strictarrsubs 479 compile_opt strictarr, strictarrsubs 519 480 ; 520 481 if keyword_set(caltype) then key_caltype = caltype … … 547 508 , uvalue = {calendar:calendar, date:jul2date(jdate0), fakecal:fakecal, caltype: key_caltype}) 548 509 ; 549 IF keyword_set(fakecal) THEN BEGIN 510 IF keyword_set(fakecal) THEN BEGIN 550 511 cmbbid = cw_combobox_pm(base, UVALUE = {name:'step'}, UNAME = 'step' $ 551 512 , value = strtrim(indgen(n_elements(calendar)), 1)) 552 513 widget_control, cmbbid, set_value = {combobox_select:(where(calendar EQ jdate0))[0]} 553 ENDIF ELSE BEGIN 514 ENDIF ELSE BEGIN 554 515 ; 555 516 vallen = widget_info(base, string_size = 'm') -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro
r157 r226 7 7 ; case uval of 8 8 ; 'done':widget_control, event.top, /destroy 9 ; 'dynamic_resize':BEGIN 9 ; 'dynamic_resize':BEGIN 10 10 ; widget_control, event.id, get_value = value 11 11 ; widget_control, ComboboxId, set_value = {dynamic_resize:value} 12 12 ; END 13 ; 'combobox_select':BEGIN 13 ; 'combobox_select':BEGIN 14 14 ; widget_control, event.id, get_value = value 15 15 ; widget_control, ComboboxId, set_value = {combobox_select:value} 16 16 ; END 17 ; 'value':BEGIN 17 ; 'value':BEGIN 18 18 ; widget_control, event.id, get_value = value 19 19 ; widget_control, ComboboxId, set_value = value 20 20 ; END 21 ; 'get':BEGIN 21 ; 'get':BEGIN 22 22 ; widget_control, ComboboxId, get_value = value 23 23 ; help, value, /struct … … 52 52 ; @categories 53 53 ; Compound widget 54 ; 54 ; 55 55 ; @param ID 56 56 ; … … 60 60 ; 61 61 ; @returns 62 ; 63 ; 62 ; 64 63 ; @uses 65 ; 66 ; 64 ; 67 65 ; @restrictions 68 ; 69 ; 66 ; 70 67 ; @examples 71 ; 72 ; 68 ; 73 69 ; @history 74 ; 75 ; 76 ; @version 70 ; 71 ; @version 77 72 ; $Id$ 78 73 ;- … … 104 99 ; @categories 105 100 ; Compound widget 106 ; 101 ; 107 102 ; @param ID 108 103 ; 109 ;110 104 ; @returns 111 ; 112 ; 105 ; 113 106 ; @uses 114 ; 115 ; 107 ; 116 108 ; @restrictions 117 ; 118 ; 109 ; 119 110 ; @examples 120 ; 121 ; 111 ; 122 112 ; @history 123 ; 124 ; 125 ; @version 113 ; 114 ; @version 126 115 ; $Id$ 127 116 ;- … … 147 136 ; @categories 148 137 ; Compound widget 149 ; 138 ; 150 139 ; @param EVENT 151 140 ; 152 ;153 141 ; @returns 154 ; 155 ; 142 ; 156 143 ; @uses 157 ; 158 ; 144 ; 159 145 ; @restrictions 160 ; 161 ; 146 ; 162 147 ; @examples 163 ; 164 ; 148 ; 165 149 ; @history 166 ; 167 ; 168 ; @version 150 ; 151 ; @version 169 152 ; $Id$ 170 153 ;- … … 187 170 case uval OF 188 171 'plus':BEGIN 189 if index LT (cmbbnumb - 1) then BEGIN 172 if index LT (cmbbnumb - 1) then BEGIN 190 173 index = index + 1 191 174 widget_control, ComboboxId, set_combobox_select = index … … 193 176 END 194 177 'minus':BEGIN 195 if index GT 0 then BEGIN 178 if index GT 0 then BEGIN 196 179 index = index - 1 197 180 widget_control, ComboboxId, set_combobox_select = index … … 212 195 ; @categories 213 196 ; Compound widget 214 ; 197 ; 215 198 ; @param PARENT {in}{required} 216 199 ; The widget ID of the parent widget. … … 219 202 ; Buttons will be arranged in the number of columns 220 203 ; specified by this keyword. 221 ; 204 ; 222 205 ; @keyword ROW 223 206 ; Buttons will be arranged in the number of rows 224 207 ; specified by this keyword. 225 ; 208 ; 226 209 ; @keyword UVALUE 227 210 ; The user value to be associated with the widget. 228 ; 211 ; 229 212 ; @keyword UNAME 230 213 ; The user name to be associated with the widget. 231 ; 214 ; 232 215 ; @keyword VALUE 233 216 ; … … 258 241 ; index the array of names originally used to set the widget''s 259 242 ; value 260 ; OUT:It is an integer which can take 3 values: 243 ; OUT:It is an integer which can take 3 values: 261 244 ; 1 : If we press + when the index is already at the max 262 245 ; Comment: In this case, the index stay at the max … … 271 254 ; 1) GET_VALUE 272 255 ; widget_control,wid_id,get_value=resultat 273 ; Send back, in the result variable, a structure of 3 elements whose 256 ; Send back, in the result variable, a structure of 3 elements whose 274 257 ; names are inspired by keywords we can pass at widget_control when 275 258 ; we use WIDGET_COMBOBOX: … … 285 268 ; 2) SET_VALUE 286 269 ; widget_control,wid_id,set_value=impose 287 ; Allows to modify the state of the combobox like we can do it for 288 ; WIDGET_COMBOBOX. May impose: 270 ; Allows to modify the state of the combobox like we can do it for 271 ; WIDGET_COMBOBOX. May impose: 289 272 ; a) The contents of the list widget (string or string array) 290 ; b) A structure which can have for elements (from 1 to 3): 273 ; b) A structure which can have for elements (from 1 to 3): 291 274 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 292 275 ; or deactivate (if set to 0) dynamic resizing of the … … 323 306 IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 324 307 ON_ERROR, 2 ;return to caller 325 ; che king for row and column keywords326 row = keyword_set(row)*(1-keyword_set(column)) 327 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 308 ; checking for row and column keywords 309 row = keyword_set(row)*(1-keyword_set(column)) 310 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 328 311 if NOT keyword_set(uvalue) then uvalue = '' 329 312 if NOT keyword_set(uname) then uname = '' … … 333 316 , FUNC_GET_VALUE='cw_combobox_pm_get_value' $ 334 317 , PRO_SET_VALUE='cw_combobox_pm_set_value' $ 335 , UVALUE = uvalue, UNAME = uname, _extra = ex) 318 , UVALUE = uvalue, UNAME = uname, _extra = ex) 336 319 ; 337 320 vallen = widget_info(base, string_size = 'm') 338 321 vallen = 35 + (vallen[0]-1)*max(strlen(value)) 339 if keyword_set(row) THEN BEGIN 322 if keyword_set(row) THEN BEGIN 340 323 nothing = widget_button(base, value = '-', uvalue = 'minus', xoffset = 0 $ 341 324 , yoffset = 5, xsize = 15, ysize = 15) … … 345 328 , xoffset = vallen+11, yoffset = 5 $ 346 329 , xsize = 15, ysize = 15) 347 ENDIF ELSE BEGIN 330 ENDIF ELSE BEGIN 348 331 nothing = widget_combobox(base, VALUE = value, UVALUE = 'Combobox', UNAME = 'Combobox' $ 349 332 , xoffset = 0, yoffset = 0, xsize = vallen) … … 354 337 , xoffset = vallen/2 $ 355 338 , yoffset = 24, xsize = 15, ysize = 15) 356 ENDELSE 339 ENDELSE 357 340 ; 358 341 ; widget_control,base,/realize -
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) -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro
r157 r226 6 6 ; case uval of 7 7 ; 'done':widget_control, event.top, /destroy 8 ; 'dynamic_resize':BEGIN 8 ; 'dynamic_resize':BEGIN 9 9 ; widget_control, event.id, get_value = value 10 10 ; widget_control, DroplistId, set_value = {dynamic_resize:value} 11 11 ; END 12 ; 'droplist_select':BEGIN 12 ; 'droplist_select':BEGIN 13 13 ; widget_control, event.id, get_value = value 14 14 ; widget_control, DroplistId, set_value = {droplist_select:value} 15 15 ; END 16 ; 'value':BEGIN 16 ; 'value':BEGIN 17 17 ; widget_control, event.id, get_value = value 18 18 ; widget_control, DroplistId, set_value = value 19 19 ; END 20 ; 'get':BEGIN 20 ; 'get':BEGIN 21 21 ; widget_control, DroplistId, get_value = value 22 22 ; help, value, /struct … … 54 54 ; @categories 55 55 ; Compound widget 56 ; 56 ; 57 57 ; @param ID 58 ;59 58 ; 60 59 ; @param VALUE … … 62 61 ; 63 62 ; @returns 64 ; 65 ; 63 ; 66 64 ; @uses 67 ; 68 ; 65 ; 69 66 ; @restrictions 70 ; 71 ; 67 ; 72 68 ; @examples 73 ; 74 ; 69 ; 75 70 ; @history 76 ; 77 ; 78 ; @version 71 ; 72 ; @version 79 73 ; $Id$ 80 74 ;- … … 104 98 ; @categories 105 99 ; Compound widget 106 ; 100 ; 107 101 ; @param ID 108 102 ; 109 103 ; @returns 110 ; 111 ; 104 ; 112 105 ; @uses 113 ; 114 ; 106 ; 115 107 ; @restrictions 116 ; 117 ; 108 ; 118 109 ; @examples 119 ; 120 ; 110 ; 121 111 ; @history 122 ; 123 ; 124 ; @version 112 ; 113 ; @version 125 114 ; $Id$ 126 115 ;- … … 141 130 ; @categories 142 131 ; Compound widget 143 ; 132 ; 144 133 ; @param EVENT 145 134 ; 146 ;147 135 ; @returns 148 ; 149 ; 136 ; 150 137 ; @uses 151 ; 152 ; 138 ; 153 139 ; @restrictions 154 ; 155 ; 140 ; 156 141 ; @examples 157 ; 158 ; 142 ; 159 143 ; @history 160 ; 161 ; 162 ; @version 144 ; 145 ; @version 163 146 ; $Id$ 164 147 ;- … … 200 183 ; @categories 201 184 ; Compound widget 202 ; 185 ; 203 186 ; @param PARENT {in}{required} 204 187 ; The widget ID of the parent widget. … … 207 190 ; Buttons will be arranged in the number of columns 208 191 ; specified by this keyword. 209 ; 192 ; 210 193 ; @keyword ROW 211 194 ; Buttons will be arranged in the number of rows 212 195 ; specified by this keyword. 213 ; 196 ; 214 197 ; @keyword UVALUE 215 198 ; The user value to be associated with the widget. 216 ; 199 ; 217 200 ; @keyword UNAME 218 201 ; The user name to be associated with the widget. 219 ; 202 ; 220 203 ; @keyword _EXTRA 221 204 ; Used to pass your keywords … … 243 226 ; index the array of names originally used to set the widget''s 244 227 ; value 245 ; OUT:It is an integer which can take 3 values: 228 ; OUT:It is an integer which can take 3 values: 246 229 ; 1 : If we press + when the index is already at the max 247 230 ; Comment: In this case, the index stay at the max … … 256 239 ; 1) GET_VALUE 257 240 ; widget_control,wid_id,get_value=resultat 258 ; Send back, in the result variable, a structure of 3 elements whose 241 ; Send back, in the result variable, a structure of 3 elements whose 259 242 ; names are inspired by keywords we can pass at widget_control when 260 243 ; we use WIDGET_COMBOBOX: … … 273 256 ; pour WIDGET_DROPLIST Impose peut etre: 274 257 ; a) The contents of the list widget (string or string array) 275 ; b) A structure which can have for elements (from 1 to 3): 258 ; b) A structure which can have for elements (from 1 to 3): 276 259 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 277 260 ; or deactivate (if set to 0) dynamic resizing of the … … 308 291 IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 309 292 ON_ERROR, 2 ;return to caller 310 ; che king for row and column keywords311 row = keyword_set(row)*(1-keyword_set(column)) 312 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 293 ; checking for row and column keywords 294 row = keyword_set(row)*(1-keyword_set(column)) 295 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 313 296 if NOT keyword_set(uvalue) then uvalue = '' 314 297 if NOT keyword_set(uname) then uname = '' … … 318 301 , FUNC_GET_VALUE='cw_droplist_pm_get_value' $ 319 302 , PRO_SET_VALUE='cw_droplist_pm_set_value' $ 320 , UVALUE = uvalue, UNAME = uname, _extra = ex) 303 , UVALUE = uvalue, UNAME = uname, _extra = ex) 321 304 ; 322 305 if keyword_set(row) THEN nothing = widget_button(base,value= '-', uvalue= 'minus') -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro
r157 r226 5 5 ; @categories 6 6 ; Compound widget 7 ; 7 ; 8 8 ; @param ID 9 ;10 9 ; 11 10 ; @param VALUE … … 13 12 ; 14 13 ; @returns 15 ; 16 ; 14 ; 17 15 ; @uses 18 ; 19 ; 16 ; 20 17 ; @restrictions 21 ; 22 ; 18 ; 23 19 ; @examples 24 ; 25 ; 20 ; 26 21 ; @history 27 ; 28 ; 29 ; @version 22 ; 23 ; @version 30 24 ; $Id$ 31 25 ;- … … 49 43 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[0]<maxi} 50 44 thickness = boxzoom[1]-boxzoom[0] 51 ENDIF ELSE BEGIN 45 ENDIF ELSE BEGIN 52 46 mini = floor(min([gphit, gphif], max = maxi)) 53 47 maxi = ceil(maxi)-thickness … … 57 51 thicknessval = thicknessuval.choix 58 52 index = where(thicknessval EQ thickness) & index = index[0] 59 if index EQ -1 then BEGIN 53 if index EQ -1 then BEGIN 60 54 index = 20 61 55 thicknessval[20] = strtrim(thickness, 1) … … 73 67 ; @categories 74 68 ; Compound widget 75 ; 69 ; 76 70 ; @param EVENT 77 71 ; 78 ;79 72 ; @returns 80 ; 81 ; 73 ; 82 74 ; @uses 83 ; 84 ; 75 ; 85 76 ; @restrictions 86 ; 87 ; 77 ; 88 78 ; @examples 89 ; 90 ; 79 ; 91 80 ; @history 92 ; 93 ; 94 ; @version 81 ; 82 ; @version 95 83 ; $Id$ 96 84 ;- … … 117 105 mini = floor(min([glamt, glamf], max = maxi)) 118 106 maxi = ceil(maxi)-thickness 119 ENDIF ELSE BEGIN 107 ENDIF ELSE BEGIN 120 108 mini = floor(min([gphit, gphif], max = maxi)) 121 109 maxi = ceil(maxi)-thickness … … 136 124 ; print, lon1, mini, maxi 137 125 ; widget_control, sliderid, set_value = {value:lon1, slider_min_max:[mini, maxi]} 138 ; ENDIF ELSE BEGIN 126 ; ENDIF ELSE BEGIN 139 127 ; mini = floor(min([gphit, glamf], max = maxi)) 140 128 ; maxi = ceil(maxi) … … 145 133 ; print, 'ds if',firstxt, 0, jpi-1 146 134 ; widget_control, sliderid, set_value = {value:firstxt, slider_min_max:[0, jpi-1]} 147 ; ENDIF ELSE BEGIN 135 ; ENDIF ELSE BEGIN 148 136 ; widget_control, sliderid, set_value = {value:firstyt, slider_min_max:[0, jpj-1]} 149 137 ; ENDELSE … … 154 142 if type EQ 'y' then begin 155 143 boxzoom[0] = slider & boxzoom[1] = slider+thickness 156 ENDIF ELSE BEGIN 144 ENDIF ELSE BEGIN 157 145 boxzoom[2] = slider & boxzoom[3] = slider+thickness 158 ENDELSE 146 ENDELSE 159 147 ; ENDIF ELSE BEGIN 160 148 ; if strpos(type,'y') NE -1 then begin 161 149 ; boxzoom[0] = glamt[slider, 0] & boxzoom[1] = glamf[slider+thickness, 0] 162 ; ENDIF ELSE BEGIN 150 ; ENDIF ELSE BEGIN 163 151 ; boxzoom[2] = gphit[0, slider] & boxzoom[3] = gphif[0, slider+thickness] 164 ; ENDELSE 152 ; ENDELSE 165 153 ; ENDELSE 166 154 widget_control, domainid, set_value = boxzoom … … 179 167 ; 180 168 ; @keyword BOXZOOM 181 ; Vector indicating the geographic zone on which we want to cut the map. 182 ; If BOXZOOM has : 169 ; Vector indicating the geographic zone on which we want to cut the map. 170 ; If BOXZOOM has : 183 171 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 184 172 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 185 173 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 186 174 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 187 ; 6 elements: The extraction is made on Boxzoom 175 ; 6 elements: The extraction is made on Boxzoom 188 176 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 189 177 ; … … 191 179 ; Buttons will be arranged in the number of columns 192 180 ; specified by this keyword. 193 ; 181 ; 194 182 ; @keyword FRAME 195 183 ; Specifies the width of the frame to be drawn around the base. 196 ; 184 ; 197 185 ; @keyword ROW 198 186 ; Buttons will be arranged in the number of rows 199 187 ; specified by this keyword. 200 ; 188 ; 201 189 ; @keyword UVALUE 202 190 ; The user value to be associated with the widget. 203 ; 191 ; 204 192 ; @keyword UNAME 205 193 ; The user name to be associated with the widget. 206 ; 194 ; 207 195 ; @keyword _EXTRA 208 196 ; Used to pass your keywords 209 ; 197 ; 210 198 ; @returns 211 ; 212 ; 199 ; 213 200 ; @uses 214 ; 215 ; 201 ; 216 202 ; @restrictions 217 ; 218 ; 203 ; 219 204 ; @examples 220 ; 221 ; 205 ; 222 206 ; @history 223 ; 224 ; 225 ; @version 207 ; 208 ; @version 226 209 ; $Id$ 227 ; 210 ; 228 211 ; @todo 229 212 ; seb: documenter … … 236 219 @common 237 220 ;------------------------------------------------ 238 ; che king exclusive keywords221 ; checking exclusive keywords 239 222 column = keyword_set(column)*(1-keyword_set(row)) 240 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 223 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 241 224 if NOT keyword_set(uvalue) then uvalue = '' 242 225 if NOT keyword_set(uname) then uname = '' … … 247 230 , PRO_SET_VALUE='cw_slide_slice_set_value' $ 248 231 , ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname $ 249 , FRAME = frame, _extra = ex) 232 , FRAME = frame, _extra = ex) 250 233 ;------------------------------------------------ 251 234 if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2] … … 264 247 , value = mini > boxzoom[0] < maxi, /column, uname = 'slider' $ 265 248 , uvalue = {name:'slider'}) 266 ENDIF ELSE BEGIN 249 ENDIF ELSE BEGIN 267 250 mini = floor(min([gphit, gphif], max = maxi)) 268 251 thickness = boxzoom[3]-boxzoom[2] … … 273 256 ENDELSE 274 257 index = where(thicknessval EQ thickness) & index = index[0] 275 if index EQ -1 then BEGIN 258 if index EQ -1 then BEGIN 276 259 index = 20 277 260 thicknessval[20] = strtrim(thickness, 1) … … 280 263 endif 281 264 widget_control, droplistid, set_value = {droplist_select:index} 282 265 283 266 ; if type EQ 'xt' then begin 284 267 ; mini = floor(min([glamt,glamf], max = maxi)) 285 268 ; maxi = ceil(maxi) 286 ; ENDIF ELSE BEGIN 269 ; ENDIF ELSE BEGIN 287 270 ; mini = floor(min([gphit,gphif], max = maxi)) 288 271 ; maxi = ceil(maxi) 289 272 ; ENDELSE 290 273 291 274 ;------------------------------------------------ 292 275 return, base -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro
r163 r226 6 6 ; case uval of 7 7 ; 'done':widget_control, event.top, /destroy 8 ; 'slider_min':BEGIN 8 ; 'slider_min':BEGIN 9 9 ; widget_control, event.id, get_value = value 10 10 ; widget_control, SliderBarId, set_value = {slider_min:value} 11 11 ; END 12 ; 'slider_max':BEGIN 12 ; 'slider_max':BEGIN 13 13 ; widget_control, event.id, get_value = value 14 14 ; widget_control, SliderBarId, set_value = {slider_max:value} 15 15 ; END 16 ; 'slider_value':BEGIN 16 ; 'slider_value':BEGIN 17 17 ; widget_control, event.id, get_value = value 18 18 ; widget_control, SliderBarId, set_value = value 19 19 ; END 20 ; 'get':BEGIN 20 ; 'get':BEGIN 21 21 ; widget_control, SliderBarId, get_value = value 22 22 ; help, value, /struct … … 57 57 ; 58 58 ; @returns 59 ; 60 ; 59 ; 61 60 ; @uses 62 ; 63 ; 64 ; @restrictions 65 ; 66 ; 67 ; @examples 68 ; 69 ; 70 ; @history 71 ; 72 ; 73 ; @version 61 ; 62 ; @restrictions 63 ; 64 ; @examples 65 ; 66 ; @history 67 ; 68 ; @version 74 69 ; $Id$ 75 70 ;- … … 93 88 ; 94 89 ; @returns 95 ; 96 ; 90 ; 97 91 ; @uses 98 ; 99 ; 100 ; @restrictions 101 ; 102 ; 103 ; @examples 104 ; 105 ; 106 ; @history 107 ; 108 ; 109 ; @version 92 ; 93 ; @restrictions 94 ; 95 ; @examples 96 ; 97 ; @history 98 ; 99 ; @version 110 100 ; $Id$ 111 101 ;- … … 124 114 ; @categories 125 115 ; Compound widget 126 ; 116 ; 127 117 ; @param ID 128 ;129 118 ; 130 119 ; @param VALUE … … 132 121 ; 133 122 ; @returns 134 ; 135 ; 123 ; 136 124 ; @uses 137 ; 138 ; 139 ; @restrictions 140 ; 141 ; 142 ; @examples 143 ; 144 ; 145 ; @history 146 ; 147 ; 148 ; @version 125 ; 126 ; @restrictions 127 ; 128 ; @examples 129 ; 130 ; @history 131 ; 132 ; @version 149 133 ; $Id$ 150 134 ;- … … 161 145 case strtrim(strlowcase(tagnames[tag]), 2) of 162 146 'slider_min':BEGIN 163 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 147 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 164 148 minmax[0] = value.slider_min[0] 165 149 widget_control, sbid, set_slider_min = floor(float(value.slider_min[0])) … … 169 153 widget_control, dcid, set_value = decvalue(value.slider_min) 170 154 widget_control, dcid, set_combobox_select = decind(value.slider_min) 171 ENDIF 172 ; ENDIF 155 ENDIF 156 ; ENDIF 173 157 end 174 158 'slider_max':BEGIN 175 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 159 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 176 160 minmax[1] = value.slider_max[0] 177 161 widget_control, sbid, set_slider_max = ceil(float(value.slider_max[0])) … … 181 165 widget_control, dcid, set_value = decvalue(value.slider_max) 182 166 widget_control, dcid, set_combobox_select = decind(value.slider_max) 183 ENDIF 184 ; ENDIF 167 ENDIF 168 ; ENDIF 185 169 end 186 170 'value':IF float(value.value[0]) GE minmax[0] $ … … 189 173 endcase 190 174 endfor 191 ENDIF ELSE BEGIN 175 ENDIF ELSE BEGIN 192 176 IF float(value[0]) GE minmax[0] $ 193 177 AND float(value[0]) LE minmax[1] THEN value2 = float(value[0]) 194 178 ENDELSE 195 IF n_elements(value2) NE 0 THEN BEGIN 179 IF n_elements(value2) NE 0 THEN BEGIN 196 180 widget_control, sbid, set_value = fix(value2) 197 181 widget_control, dcid, set_value = decvalue(value2) 198 182 widget_control, dcid, set_combobox_select = decind(value2) 199 ENDIF 183 ENDIF 200 184 return 201 185 end … … 206 190 ; 207 191 ; @categories 208 ; Compound widget 209 ; 192 ; Compound widget 193 ; 210 194 ; @param ID 211 195 ; 212 ; 213 ; @returns 214 ; 215 ; 196 ; @returns 197 ; 216 198 ; @uses 217 ; 218 ; 219 ; @restrictions 220 ; 221 ; 222 ; @examples 223 ; 224 ; 225 ; @history 226 ; 227 ; 228 ; @version 199 ; 200 ; @restrictions 201 ; 202 ; @examples 203 ; 204 ; @history 205 ; 206 ; @version 229 207 ; $Id$ 230 208 ;- … … 246 224 ; @categories 247 225 ; Compound widget 248 ; 226 ; 249 227 ; @param EVENT 250 ; 251 ; 252 ; @returns 253 ; 254 ; 228 ; 229 ; @returns 230 ; 255 231 ; @uses 256 ; 257 ; 258 ; @restrictions 259 ; 260 ; 261 ; @examples 262 ; 263 ; 264 ; @history 265 ; 266 ; 267 ; @version 232 ; 233 ; @restrictions 234 ; 235 ; @examples 236 ; 237 ; @history 238 ; 239 ; @version 268 240 ; $Id$ 269 241 ;- … … 284 256 'minus':if (value - 1) GE minmax[0] then value2 = value - 1 ELSE out = -1 285 257 'SliderBar':if (event.value + value - floor(value)) LE minmax[1] THEN value2 = event.value + value - floor(value) 286 'decimal':BEGIN 258 'decimal':BEGIN 287 259 CASE 1 OF 288 260 value GT minmax[1]: value2 = minmax[1] … … 313 285 ; @categories 314 286 ; Compound widget 315 ; 287 ; 316 288 ; @param PARENT {in}{required} 317 289 ; The widget ID of the parent widget. … … 319 291 ; @keyword UVALUE 320 292 ; The user value to be associated with the widget. 321 ; 293 ; 322 294 ; @keyword UNAME 323 295 ; The user name to be associated with the widget. 324 ; 296 ; 325 297 ; @keyword VALUE 326 298 ; 327 ;328 299 ; @keyword MAXIMUM 329 ; 330 ; 300 ; 331 301 ; @keyword MINIMUM 332 302 ; 333 ; 303 ; 334 304 ; @keyword STRMINLEN 335 305 ; … … 365 335 ; computationally expensive operations until the user releases the 366 336 ; slider. 367 ; OUT:It is an integer which can take 3 values: 337 ; OUT:It is an integer which can take 3 values: 368 338 ; 1 : If we press + when the index is already at the max 369 339 ; Comment: In this case, the index stay at the max … … 378 348 ; 1) GET_VALUE 379 349 ; widget_control,wid_id,get_value=resultat 380 ; Send back in the result variable a structure of 2 elements whose name 381 ; are inspired from keywords we can pass at 350 ; Send back in the result variable a structure of 2 elements whose name 351 ; are inspired from keywords we can pass at 382 352 ; widget_control when we use WIDGET_SLIDER: 383 353 ; VALUE:the value setting of the widget … … 386 356 ; 2) SET_VALUE 387 357 ; widget_control,wid_id,set_value=impose 388 ; Allows to modify the state of the combobox like we can do it for 389 ; WIDGET_COMBOBOX. May impose: 358 ; Allows to modify the state of the combobox like we can do it for 359 ; WIDGET_COMBOBOX. May impose: 390 360 ; a) a integer: give the new position of the slider. 391 ; b) A structure which can have for elements (from 1 to 3): 361 ; b) A structure which can have for elements (from 1 to 3): 392 362 ; VALUE: an integer which give the new position of the slider 393 363 ; SLIDER_MIN:Set to a new minimum value for the specified … … 428 398 if NOT keyword_set(title) then title = ' ' 429 399 ; 430 ; che king exclusive keywords400 ; checking exclusive keywords 431 401 column = (keyword_set(column)*(1-keyword_set(row))+keyword_set(vertical)) < 1 432 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 402 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 433 403 if NOT keyword_set(uvalue) then uvalue = '' 434 404 if NOT keyword_set(uname) then uname = '' … … 437 407 , FUNC_GET_VALUE = 'cw_slider_pm_get_value' $ 438 408 , PRO_SET_VALUE = 'cw_slider_pm_set_value' $ 439 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 409 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 440 410 ; 441 411 mlen = (widget_info(base, string_size = 'm'))[0] -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro
r157 r226 6 6 ; @categories 7 7 ; Compound widget 8 ; 8 ; 9 9 ; @param ID 10 ;11 10 ; 12 11 ; @param VALUE … … 14 13 ; 15 14 ; @returns 16 ; 17 ; 18 ; @uses 19 ; 20 ; 21 ; @restrictions 22 ; 23 ; 24 ; @examples 25 ; 26 ; 27 ; @history 28 ; 29 ; 30 ; @version 31 ; $Id$ 32 ;- 33 ;***************************************************** 15 ; 16 ; @uses 17 ; 18 ; @restrictions 19 ; 20 ; @examples 21 ; 22 ; @history 23 ; 24 ; @version 25 ; $Id$ 26 ;- 34 27 PRO cw_specifie_set_value, id, value 35 28 ; … … 43 36 widget_control, widget_info(id,find_by_uname='palnum'), set_value = strtrim(value.lct, 2) 44 37 autres = extractstru(value, ['min', 'max', 'inter', 'lct', 'nothing', 'xindex', 'yindex']) 45 if size(autres, /type) EQ 8 then BEGIN 38 if size(autres, /type) EQ 8 then BEGIN 46 39 autresid = widget_info(id,find_by_uname='autres') 47 40 widget_control, widget_info(id, find_by_uname = 'autres'), get_value = autresautres … … 64 57 ; @categories 65 58 ; Compound widget 66 ; 59 ; 67 60 ; @param ID 68 61 ; 69 ; 70 ; @returns 71 ; 72 ; 73 ; @uses 74 ; 75 ; 76 ; @restrictions 77 ; 78 ; 79 ; @examples 80 ; 81 ; 82 ; @history 83 ; 84 ; 85 ; @version 86 ; $Id$ 87 ;- 88 ;***************************************************** 62 ; @returns 63 ; 64 ; @uses 65 ; 66 ; @restrictions 67 ; 68 ; @examples 69 ; 70 ; @history 71 ; 72 ; @version 73 ; $Id$ 74 ;- 89 75 FUNCTION cw_specifie_get_value, id 90 76 ; … … 118 104 ; @categories 119 105 ; Compound widget 120 ; 106 ; 121 107 ; @param EVENT 122 108 ; 123 ; 124 ; @returns 125 ; 126 ; 127 ; @uses 128 ; 129 ; 130 ; @restrictions 131 ; 132 ; 133 ; @examples 134 ; 135 ; 136 ; @history 137 ; 138 ; 139 ; @version 140 ; $Id$ 141 ;- 142 ;***************************************************** 109 ; @returns 110 ; 111 ; @uses 112 ; 113 ; @restrictions 114 ; 115 ; @examples 116 ; 117 ; @history 118 ; 119 ; @version 120 ; $Id$ 121 ;- 143 122 FUNCTION cw_specifie_event, event 144 123 ;------------------------------------------------------------ 145 ; on recuper les ID des differents widgets124 ; on recupere les ID des differents widgets 146 125 ;------------------------------------------------------------ 147 126 ;------------------------------------------------------------ … … 157 136 ;------------------------------------------------------------ 158 137 case uval of 159 'default':BEGIN 138 'default':BEGIN 160 139 ;--------------- 161 ; We find the name of the variable: 140 ; We find the name of the variable: 162 141 vlstid = widget_info(event.top, find_by_uname = 'varlist') 163 142 fieldname = widget_info(vlstid, /combobox_gettext) … … 170 149 widget_control, widget_info(event.handler, find_by_uname = 'autres'), set_value = '' 171 150 END 172 'palcol':BEGIN 151 'palcol':BEGIN 173 152 ind = fix(strmid(event.value, 0, strpos(event.value, '-'))) 174 153 widget_control, widget_info(event.handler, find_by_uname = 'palnum'), set_value = strtrim(ind, 1) … … 186 165 ; @categories 187 166 ; Compound widget 188 ; 167 ; 189 168 ; @param PARENT {in}{required} 190 169 ; The widget ID of the parent widget. … … 193 172 ; Buttons will be arranged in the number of columns 194 173 ; specified by this keyword. 195 ; 174 ; 196 175 ; @keyword ROW 197 176 ; Buttons will be arranged in the number of rows 198 177 ; specified by this keyword. 199 ; 178 ; 200 179 ; @keyword UVALUE 201 180 ; The user value to be associated with the widget. 202 ; 181 ; 203 182 ; @keyword UNAME 204 183 ; The user name to be associated with the widget. … … 206 185 ; @keyword FRAME 207 186 ; 208 ;209 187 ; @keyword FORXXX 210 188 ; 211 ;212 189 ; @keyword _EXTRA 213 190 ; Used to pass your keywords 214 191 ; 215 ; 216 ; @returns 217 ; 218 ; 219 ; @uses 220 ; 221 ; 222 ; @restrictions 223 ; 224 ; 225 ; @examples 226 ; 227 ; 228 ; @history 229 ; 230 ; 231 ; @version 232 ; $ID$ 192 ; @returns 193 ; 194 ; @uses 195 ; 196 ; @restrictions 197 ; 198 ; @examples 199 ; 200 ; @history 201 ; 202 ; @version 203 ; $Id$ 233 204 ; 234 205 ; @todo 235 206 ; seb: documenter 236 ; 207 ; 237 208 ;- 238 209 FUNCTION cw_specifie, parent, ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, FRAME = frame, FORXXX = forxxx, _extra = ex 239 ; che king exclusive keywords210 ; checking exclusive keywords 240 211 ; 241 212 compile_opt idl2, strictarrsubs 242 213 ; 243 214 column = keyword_set(column)*(1-keyword_set(row)) 244 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 215 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 245 216 ;------------------------------------------------ 246 217 if NOT keyword_set(uvalue) then uvalue = '' … … 250 221 , FUNC_GET_VALUE='cw_specifie_get_value' $ 251 222 , PRO_SET_VALUE='cw_specifie_set_value' $ 252 , UVALUE = uvalue, UNAME = uname, _extra = ex) 253 ; base1 223 , UVALUE = uvalue, UNAME = uname, _extra = ex) 224 ; base1 254 225 base1 = widget_base(base) 255 226 rien = widget_label(base1, value = 'Min', xoffset = 85, yoffset = 15) … … 277 248 278 249 279 ; widget text containi g other keywords pass into top_uvalue.exextra250 ; widget text containing other keywords pass into top_uvalue.exextra 280 251 ; Does it remain some? If yes, we have to put them as string 281 252 282 253 rien = widget_text(base, value = ' ', /editable, uname = 'autres', uvalue = 'autres', xsize = 54, ysize = 3, yoffset = 65, /wrap, /no_newline) 283 254
Note: See TracChangeset
for help on using the changeset viewer.