;+ ; NAME: ; qLine_IsX ; PURPOSE: ; Handles a 'select x-axis' event ; CATEGORY: ; qLine widget ; CALLING SEQUENCE: FUNCTION qLine_IsX, state, event, iy ; INPUTS: ; state array[1]; type: structure ; qLine state structure ; event array[1]; type: structure ; event structure ; iy scalar; type: integer ; index of the 'isx' widget that received the event ; OUTPUTS: ; refresh scalar; type: byte ; 0B of 1B (1B indicating that href=qLine_Curve= needs to be called) ; 'refresh' will be 1B, unless a 'skip' event is generated.on the ; new x-axis data. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; BadValue ; PROCEDURE: ; > The 'skip' status for the previous curve used for x-axis is set to 'off' by ; generating a 'skip' event (but only if 'skip' is 'on') ; > The 'skip' status for the new x-axis curve is set to 'on by generating ; a 'skip' event (but only if 'skip' is off. ; MODIFICATION HISTORY: ; JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- ; The selection of an x-axis is done by clicking a radio button in an exclusive button group. ; A sequence of button events results: first the deselected buttons are switched off ; (event.select=0) and the last event switches on the selected button (event.select=1). ; Only this last event needs to followed by a call to qLine_Curve. widget_control, state.wid_isx[iy], set_uvalue=event.select IF event.select THEN BEGIN widget_control, state.wid_ybase, get_uvalue=isx ; Previous x-axis widget_control, state.wid_ybase, set_uvalue=iy ; New x-axis widget_control, state.wid_degree, set_uvalue=replicate(BadValue(0.0),2) ; Set the 'skip' status of the old x-axis to 'off', if it isn't already. IF isx NE iy THEN BEGIN widget_control, state.wid_skip[isx], get_uvalue=set IF set THEN widget_control, state.wid_skip[isx], set_button=0, $ send_event={WIDGET_BUTTON, id:0L, top:0L, handler:0L, select:0L} ENDIF ; When a new x-axis is selected the curve probably should not be ; plotted (would just be a straight line). Check whether 'skip' ; is set; if not, then set it by generating a 'skip' event. widget_control, state.wid_skip[iy], get_uvalue=refresh IF NOT refresh THEN $ widget_control, state.wid_skip[iy], /set_button, $ send_event={WIDGET_BUTTON, id:0L, top:0L, handler:0L, select:1L} ENDIF ELSE $ refresh = 0 RETURN, refresh & END