;+ ; ; @file_comments ; ; @categories ; Compound widget ; ; @param ID ; ; @param VALUE ; It is the default tick mark value (a floating-point number). ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ;- ; PRO cw_slide_slice_set_value, id, value ; compile_opt idl2, strictarrsubs ; @common topid = findtopid(id) domainid = widget_info(topid, find_by_uname = 'domain') widget_control, domainid, get_value = boxzoom if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' thickid = widget_info(topid, find_by_uname = 'thickness') widget_control, thickid, get_uvalue = thicknessuval widget_control, thickid, get_value = thickness thickness = thicknessuval.choix[thickness.droplist_select] sliderid = widget_info(topid, find_by_uname = 'slider') if type EQ 'y' then BEGIN mini = floor(min([glamt, glamf], max = maxi)) maxi = ceil(maxi)-thickness widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[0]domdef ! ; ; @keyword COLUMN ; Buttons will be arranged in the number of columns ; specified by this keyword. ; ; @keyword FRAME ; Specifies the width of the frame to be drawn around the base. ; ; @keyword ROW ; Buttons will be arranged in the number of rows ; specified by this keyword. ; ; @keyword UVALUE ; The user value to be associated with the widget. ; ; @keyword UNAME ; The user name to be associated with the widget. ; ; @keyword _EXTRA ; Used to pass keywords ; ; @returns ; ; @uses ; ; @restrictions ; ; @examples ; ; @history ; ; @version ; $Id$ ; ; @todo ; seb: documenter ; ;- ; FUNCTION cw_slide_slice, parent, boxzoom = boxzoom, UVALUE = uvalue, UNAME = uname, FRAME = frame, ROW = row, COLUMN = column, _EXTRA = ex ; compile_opt idl2, strictarrsubs ; @common ;------------------------------------------------ ; checking exclusive keywords column = keyword_set(column)*(1-keyword_set(row)) row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) if NOT keyword_set(uvalue) then uvalue = '' if NOT keyword_set(uname) then uname = '' ; base = widget_base(parent, ROW = row, COLUMN = column $ , EVENT_FUNC = 'cw_slide_slice_event' $ , FUNC_GET_VALUE='cw_slide_slice_get_value' $ , PRO_SET_VALUE='cw_slide_slice_set_value' $ , ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname $ , FRAME = frame, _extra = ex) ;------------------------------------------------ if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2] ; rien = cw_bgroup(base, ['degre', 'points'],/exclusive, /column, uname = 'unite', uvalue = {name:'unite'}, /return_name, set_value = 0, /no_release) thicknessval = indgen(21)+1 thicknessval = string(thicknessval) for i = 0, n_elements(thicknessval)-1 do thicknessval[i] = strtrim(thicknessval[i], 1) droplistid = cw_droplist_pm(base, value = thicknessval, uname = 'thickness', uvalue = {name:'thickness', choix:thicknessval}) ; if boxzoom[1]-boxzoom[0] LT boxzoom[3]-boxzoom[2] then type = 'y' ELSE type = 'x' if type EQ 'y' then BEGIN mini = floor(min([glamt, glamf], max = maxi)) thickness = boxzoom[1]-boxzoom[0] maxi = ceil(maxi)-thickness rien = cw_slider_pm(base, minimum = mini, maximum = (mini+1) > maxi $ , value = mini > boxzoom[0] < maxi, /column, uname = 'slider' $ , uvalue = {name:'slider'}) ENDIF ELSE BEGIN mini = floor(min([gphit, gphif], max = maxi)) thickness = boxzoom[3]-boxzoom[2] maxi = ceil(maxi)-thickness rien = cw_slider_pm(base, minimum = mini, maximum = (mini+1) > maxi $ , value = mini > boxzoom[2] < maxi, /column, uname = 'slider' $ , uvalue = {name:'slider'}) ENDELSE index = where(thicknessval EQ thickness) & index = index[0] if index EQ -1 then BEGIN index = 20 thicknessval[20] = strtrim(thickness, 1) widget_control, droplistid, set_value = thicknessval widget_control, droplistid, set_uvalue ={name:'thickness', choix:thicknessval} endif widget_control, droplistid, set_value = {droplist_select:index} ; if type EQ 'xt' then begin ; mini = floor(min([glamt,glamf], max = maxi)) ; maxi = ceil(maxi) ; ENDIF ELSE BEGIN ; mini = floor(min([gphit,gphif], max = maxi)) ; maxi = ceil(maxi) ; ENDELSE ;------------------------------------------------ return, base end