;+ ; NAME: ; qLine_Sequence ; PURPOSE: ; Handles a 'change of sequence' event, modifying the order in which ; curves are processed ; CATEGORY: ; qLine widget ; CALLING SEQUENCE: FUNCTION qLine_Sequence, state, iy ; INPUTS: ; state array[1]; type: structure ; qLine state structure ; iy scalar; type: integer ; index of the 'sequence' widget that received the event ; OUTPUTS: ; refresh scalar; type: byte ; always 1B (1B indicating that href=qLine_Curve= needs to be called) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; where_common ; PROCEDURE: ; The value of the state.wid_sequence widgets are read, and are checked to make sure ; that there are no double entries. If there are double entries then these are removed, ; subject to the constraint that widget iy (the widget on which the event was ; generated) is not changed. ; MODIFICATION HISTORY: ; JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- seq = -1 FOR jy=0,state.n-1 DO BEGIN widget_control, state.wid_sequence[jy], get_value=tmp seq = [seq, tmp] ENDFOR seq = seq[1:*] IF n_elements(uniq(seq, sort(seq))) LT state.n THEN BEGIN seq_iy = seq[iy] sorted = indgen(state.n) present = where_common(sorted, seq, inref=inref, absent=absent, count=count) new_seq = [seq[inref[sort(inref)]],absent] jy = (where(new_seq EQ seq_iy))[0] new_seq[jy] = new_seq[iy] new_seq[iy] = seq_iy FOR jy=0,state.n-1 DO $ IF new_seq[jy] NE seq[jy] THEN $ widget_control, state.wid_sequence[jy], set_value=new_seq[jy] ENDIF RETURN, 1B & END