Changeset 279 for trunk/SRC/ToBeReviewed/WIDGET
- Timestamp:
- 09/07/07 15:40:51 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/WIDGET
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildreadcmd.pro
r262 r279 111 111 date2 = date2jul(date2) - fakecal 112 112 ENDIF 113 sdate1 = strtrim(date1, 1) & sdate2 = strtrim(date2, 1) 113 IF size(date1, /type) EQ 5 THEN sdate1 = string(date1, format='(f15.6)')+'d' $ 114 ELSE sdate1 = string(date1, format='(i10)')+'L' 115 IF size(date2, /type) EQ 5 THEN sdate2 = string(date2, format='(f15.6)')+'d' $ 116 ELSE sdate2 = string(date2, format='(i10)')+'L' 114 117 ;--------------- 115 118 ; find boxzoom -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
r271 r279 68 68 ; 69 69 @cm_4cal 70 71 70 ; get back the calendar and its related informations 72 71 winfo_id = widget_info(id, find_by_uname = 'infocal') 73 72 widget_control, winfo_id, get_uvalue = infowid 74 73 key_caltype = infowid.caltype 75 76 74 ; high freqeuncy calendar 77 75 IF keyword_set(infowid.fakecal) THEN BEGIN … … 84 82 ENDIF 85 83 ENDIF ELSE BEGIN 86 ; 87 value = long(value[0]) 88 ; make sure the value correspond 89 value = jul2date(date2jul(value)) 90 ; define year month day 91 year = value/10000l 92 month = (value MOD 10000L)/100L 93 day = value MOD 100L 84 jdval = date2jul(value) 94 85 ; check that the date exists in the calendar 95 if (where(abs(infowid.calendar - julday(month, day, year)) LT 1./86400.))[0] EQ - 1 then return86 if (where(abs(infowid.calendar - jdval) LT 1.d/86400.d))[0] EQ - 1 then return 96 87 ; update the value of infocal 97 88 infowid.date = value … … 181 172 if wid_id NE 0 then BEGIN 182 173 widget_control, wid_id, get_value = wid_value 183 date = long(wid_value.combobox_gettext) 174 widget_control, wid_id, get_uvalue = wid_uvalue 175 date = double(wid_value.combobox_gettext) + wid_uvalue.hms[wid_value.combobox_index] 184 176 ENDIF ELSE date = oldate MOD 100L 185 177 ;-------------month--------------- … … 224 216 ; @uses 225 217 ; 226 ; @restrictions 218 ; @restrictions< 227 219 ; 228 220 ; @examples … … 242 234 winfo_id = widget_info(event.handler, find_by_uname = 'infocal') 243 235 widget_control, winfo_id, get_uvalue = infowid 244 caldat, infowid.calendar, monthcal, daycal, yearcal 236 caldat, infowid.calendar, monthcal, daycal, yearcal, hourcal, mincal, seccal 245 237 ; ... and the current date 246 238 IF n_elements(date0) EQ 0 then date0 = get_cal_value(event.handler) 247 year0 = date0/10000L 248 month0 = (date0 MOD 10000L)/100L 249 day0 = date0 MOD 100L 239 jdate0 = date2jul(date0, month = month0, day = day0, year = year0) 250 240 ; index of days/months/years according to date0 251 241 case casename of … … 254 244 index = where(monthcal EQ month0 AND yearcal EQ year0) 255 245 current = daycal[index] 246 hms = hourcal[index] / 24.0d0 + mincal[index]/1440.0d0 + seccal[index] / 86400.0d0 256 247 END 257 248 'month':BEGIN … … 271 262 ENDCASE 272 263 ; we update the uvalue of the widget 273 widget_control, wid_id, set_uvalue = {name:casename}264 IF casename EQ 'day' THEN widget_control, wid_id, set_uvalue = {name:casename, hms:hms} 274 265 ; for event.out = 0, we store the previous position of the combobox to use 275 266 ; it as the default position. … … 334 325 ; $Id$ 335 326 ;- 336 PRO move, event, casename327 PRO cw_cal_move, event, casename 337 328 ; 338 329 compile_opt strictarr, strictarrsubs … … 354 345 widget_control, id, set_value = {combobox_select:selected} 355 346 ; we call move for the next combobox 356 ENDIF ELSE move, event, possiblecase[whichcase+1]347 ENDIF ELSE cw_cal_move, event, possiblecase[whichcase+1] 357 348 ; it is possible to move from +/- 1 358 349 ENDIF ELSE widget_control, id, set_value = {combobox_select:wvalue.combobox_index+event.out} … … 410 401 selected = (widvalue.combobox_number-1)*(event.out EQ -1) 411 402 widget_control, event.id, set_value = {combobox_select:selected} 412 ENDIF ELSE move, event, possiblecase[whichcase+1]403 ENDIF ELSE cw_cal_move, event, possiblecase[whichcase+1] 413 404 ENDIF 414 405 ; if we changed month(year), we need to update the day (and month) list … … 484 475 if keyword_set(caltype) then key_caltype = caltype 485 476 ; months days years found in the calendar 486 caldat, calendar, monthcal, daycal, yearcal, hourcal, mincal, scdcal 477 caldat, calendar, monthcal, daycal, yearcal, hourcal, mincal, seccal 478 hmscal = hourcal / 24.0d0 + mincal/1440.0d0 + seccal / 86400.0d0 487 479 ; starting date 488 480 if n_elements(jdate0) EQ 0 then jdate0 = calendar[0] … … 523 515 currentday = daycal[dayindex] 524 516 currentday = strtrim(currentday, 1) 525 cmbbid = cw_combobox_pm(base, UVALUE = {name:'day'}, UNAME = 'day', value = currentday) 517 hms = hmscal[dayindex] 518 cmbbid = cw_combobox_pm(base, UVALUE = {name:'day', hms:hms}, UNAME = 'day', value = currentday) 526 519 widget_control, cmbbid, set_value = {combobox_select:(where(long(currentday) EQ day0))[0]} 527 520 endif
Note: See TracChangeset
for help on using the changeset viewer.