;+ ; NAME: ; qView_SetBox ; PURPOSE: ; Select an area from an image for further processing ; CATEGORY: ; sat/idl/widget/qview ; CALLING SEQUENCE: PRO qView_SetBox, state, event ; INPUTS: ; state array[1]; type: structure ; qView state structure ; event array[1]; type: structure ; event from the state.wid_box widget ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; qImage, qImage_SendDestination, qView_Sensitive ; qView_SetInfo, qView_ImageInfo ; PROCEDURE: ; A button press on the 'Set Area' button generates a button ; event which results in a call to qImage to put the first ; image of a selected sequence on the display. The user selects ; an area in qImage then presses the 'Send' button. This ; results in a QIMAGE_SEND event which ends up here again to ; be processed by qView_SetInfo. qView_SetInfo store the area ; information in a structure for use by other qView procedures. ; STATE INFO USED: ; widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy ; widget_control, state.wid_view, get_uvalue=wid_base, /no_copy ; STATE INFO MODIFIED: ; widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy ; widget_control, state.wid_view, set_uvalue=wid_base, /no_copy ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- event_name = tag_names(event, /structure_name) CASE event_name OF 'WIDGET_BUTTON': BEGIN widget_control, state.wid_pick, get_uvalue=allfiles, /no_copy file = allfiles[ qView_ImageInfo(state, /first) ] widget_control, state.wid_pick, set_uvalue=allfiles, /no_copy ; Put the first whole image of the sequence on the screen to ; select a box. qImage will set the img_offset to zero, since ; only a file name is specified. An existing qImage is used ; if there is one (wid_base exists) widget_control, state.wid_view, get_uvalue=wid_base, /no_copy widget_control, state.wid_ftsext, get_value=exten_no qImage, file, exten_no=exten_no, group=state.wid_box, wid_base=wid_base ; The user value of wid_base (the qImage base widget) contains ; the qImage state structure. One element in this structure is ; the widget ID wid_base.send; state.wid_box is stored in the ; user value of this widget. qImage will use this to send a ; message to state.wid_box that is is destroyed. qImage_SendDestination, wid_base, state.wid_box widget_control, state.wid_view, set_uvalue=wid_base, /no_copy qView_Sensitive, state, /set_box, /get_data END ; Happens only when the qImage widget has just been destroyed ELSE: qView_SetInfo, state, event, /boxset ENDCASE RETURN & END