;+ ; NAME: ; qLine_Structure ; PURPOSE: ; Creates and initializes a QPLOT_STRUCTURE event structure ; CATEGORY: ; Widget qLine ; CALLING SEQUENCE: FUNCTION qLine_Structure, state, $ isx = isx , $ nmax = nmax , $ sequence = sequence , $ ymin = ymin , $ ymax = ymax , $ skip = skip , $ newyaxis = newyaxis , $ exact = exact , $ ynozero = ynozero , $ ylog = ylog , $ linestyle = linestyle , $ ytitle = ytitle , $ use_sigma = use_sigma , $ sigma_index = sigma_index ; OPTIONAL INPUT PARAMETERS: ; state array[1]; type: structure ; qLine state structure ; ; The keywords give the plot parameters for all curves: ; ; ymin = ymin array[n]; type: float ; ymax = ymax array[n]; type: float ; min and max values for y-axis ; skip = skip array[n]; type: byte ; 0B: don't plot the curve ; 1B: plot the curve ; newyaxis = newyaxis array[n]; type: byte ; 0B: if existing y-axis is to be used ; 1B: if new y-axis is to be drawn ; exact = exact array[n]; type: byte ; 0B: if no exact y-axis needs to be drawn ; 1B: if exact y-axis is needed ; ynozero = ynozero array[n]; type: byte ; same convention as IDL ynozero keyword ; ylog = ylog array[n]; type: byte ; 0B: for linear y-axis ; 1B: for logarithmic y-axis ; linestyle = linestyle array[n]; type: integer ; same convention as IDL linestyle keyword ; ytitle = ytitle array[n]; type: string ; titles for y-axis ; ; OUTPUTS: ; event array[1]; type: structure ; QPLOT_STRUCTURE event containing plot parameters for all curves ; INCLUDE: @compile_opt.pro ; On error, return to caller ; RESTRICTIONS: ; Currently only 10 curves can be manipulated. ; PROCEDURE: ; If 'state' is specified then information values and user values from the widgets ; in this structure are used to initialize the structure. ; If any of the keywords is specified then these are used to initialize event structure ; fields (overriding the values from the 'state' structure). ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- is_state = n_elements(state) ne 0 ; Maximum number of curves if is_state then n = state.nmax else n = nmax b = bytarr(n) f = fltarr(n) i = intarr(n) S = {QPLOT_STRUCTURE, ID:0L, TOP:0L, HANDLER: 0L, $ isx:0, sequence:i, ymin:f, ymax:f, exact:b, ynozero:b, ylog:b, newyaxis:b, skip:b, $ linestyle:i, ytitle:strarr(n), use_sigma:b, sigma_index:i} if is_state then begin if widget_info(state.wid_xbase, /valid) then begin for i=0,state.n-1 do begin widget_control, state.wid_isx [i], get_uvalue=tmp & if tmp then S.isx = i widget_control, state.wid_ymin [i], get_value =tmp & S.ymin [i] = tmp widget_control, state.wid_ymax [i], get_value =tmp & S.ymax [i] = tmp widget_control, state.wid_skip [i], get_uvalue=tmp & S.skip [i] = tmp widget_control, state.wid_newyaxis [i], get_uvalue=tmp & S.newyaxis [i] = tmp widget_control, state.wid_exact [i], get_uvalue=tmp & S.exact [i] = tmp widget_control, state.wid_ynozero [i], get_uvalue=tmp & S.ynozero [i] = tmp widget_control, state.wid_ylog [i], get_uvalue=tmp & S.ylog [i] = tmp widget_control, state.wid_use_sigma [i], get_uvalue=tmp & S.use_sigma [i] = tmp widget_control, state.wid_sigma_index[i], get_value =tmp & S.sigma_index [i] = tmp widget_control, state.wid_linestyle [i], get_value =tmp & S.linestyle [i] = tmp widget_control, state.wid_ytitle [i], get_value =tmp & S.ytitle [i] = tmp endfor endif endif tmp = n_elements(sequence ) & if tmp ne 0 then S.sequence = sequence [0: (tmp < n)-1] tmp = n_elements(isx ) & if tmp ne 0 then S.isx = isx tmp = n_elements(ymin ) & if tmp ne 0 then S.ymin = ymin [0: (tmp < n)-1] tmp = n_elements(ymax ) & if tmp ne 0 then S.ymax = ymax [0: (tmp < n)-1] tmp = n_elements(skip ) & if tmp ne 0 then S.skip = skip [0: (tmp < n)-1] tmp = n_elements(newyaxis ) & if tmp ne 0 then S.newyaxis = newyaxis [0: (tmp < n)-1] tmp = n_elements(exact ) & if tmp ne 0 then S.exact = exact [0: (tmp < n)-1] tmp = n_elements(ynozero ) & if tmp ne 0 then S.ynozero = ynozero [0: (tmp < n)-1] tmp = n_elements(ylog ) & if tmp ne 0 then S.ylog = ylog [0: (tmp < n)-1] tmp = n_elements(use_sigma ) & if tmp ne 0 then S.use_sigma = use_sigma [0: (tmp < n)-1] tmp = n_elements(sigma_index) & if tmp ne 0 then S.sigma_index= sigma_index[0: (tmp < n)-1] tmp = n_elements(linestyle ) & if tmp ne 0 then S.linestyle = linestyle [0: (tmp < n)-1] tmp = n_elements(ytitle ) & if tmp ne 0 then S.ytitle = ytitle [0: (tmp < n)-1] if not is_state then begin S.skip [isx] = 1B tmp = (where(1-S.skip and S.newyaxis))[0] if tmp eq -1 then begin tmp = (where(1-S.skip))[0] if tmp[0] ne -1 then S.newyaxis[tmp] = 1B endif endif return, S & end