PRO qImage_Send, state, confirm=confirm, cancel=cancel ;+ ; NAME: ; qImage_Send ; PURPOSE: ; Sent a QIMAGE_SEND event to the specified widget ; CATEGORY: ; Widget qImage ; CALLING SEQUENCE: ; qImage_Send, state, confirm=confirm, cancel=cancel ; INPUTS: ; state array[1]; type: structure ; qImage state structure ; OPTIONAL INPUT PARAMETERS: ; /confirm if set then user is prompted to confirm the sending of the event ; /cancel ; OPTIONAL OUTPUT PARAMETERS: ; cancel=cancel set to 1B if the user canceled sending of the event. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, qImage_SendInfo ; PROCEDURE: ; Typically the user value of state.wid_send is the widget ID from a widget in the ; application calling pImage (e.g. qView). ; The event structure send is explained in qImage_SendStructure ; STATE INFO USED: ; widget_control, state.wid_send, get_uvalue=receive ; widget_control, wid_child, get_uvalue=qimage_cw_state, /no_copy ; STATE INFO MODIFIED: ; widget_control, wid_child, set_uvalue=qimage_cw_state, /no_copy ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, confirm, /key cancel = 0B widget_control, state.wid_send, get_uvalue=receive IF state.foreign EQ 0 AND IsType(receive,/defined) THEN BEGIN IF widget_info(receive[0], /valid) THEN BEGIN wid_child = widget_info(state.wid_qimage_cw, /child) widget_control, wid_child, get_uvalue=qimage_cw_state, /no_copy sz = long(qimage_cw_state.img_size) CASE sz[0]*sz[1] GT 0 OF 0: ok = 'No' 1: BEGIN CASE confirm OF 0: ok = 'Yes' 1: ok = dialog_message('Send box size and pixel value info?', /question, /cancel, dialog_parent=qimage_cw_state.wid_xyz[6]) ENDCASE IF ok EQ 'Yes' THEN widget_control, receive[0], send_event=qImage_SendInfo(qimage_cw_state) END ENDCASE widget_control, wid_child, set_uvalue=qimage_cw_state, /no_copy cancel = ok EQ 'Cancel' ENDIF ENDIF RETURN & END