;+
; Project     : SOHO - CDS     
;                   
; Name        : SEL_PARM_MENU
;               
; Purpose     : Defines the eng. monitor parameter selection window.
;               
; Explanation : Creates the widgets which form the window within which
;               the engineering parameters can be selected.
;               
; Use         : sel_parm_menu
;    
; Inputs      : None
;               
; Opt. Inputs : None
;               
; Outputs     : None
;               
; Opt. Outputs: None
;               
; Keywords    : None
;
; Calls       : get_parm_list
;               
; Restrictions: For use in engineering data monitor programs only.
;               
; Side effects: None
;               
; Category    : Telemetry
;               
; Prev. Hist. : None
;
; Written     : C D Pike, RAL, 29-Sep-94
;               
; Modified    : To add explanation to mnemonic.  CDP, 12-Oct-94
;               Add CANCEL button.  CDP, 18-Jan-95
;               Much transferred to get_parm_list. CDP< 25-Jan-95
;               Add sort on user string. CDP, 18-Apr-95
;
; Version     : Version 5, 18-Apr-95
;-            

PRO sel_parm_menu

;
;  commons for communication
;
@emon.com


;
;  guard against trigger happy users
;
if xregistered('sel_parm') then begin
   widget_control,msg_widg,set_val='One click will do thanks!',/append
   return
endif

;
;  create main base
;
sel_parm_base = WIDGET_BASE(title='Engineering parameter selection',$
                           /FRAME, /COLUMN, xoffset=575,$
                           group_leader = main_base)

;
;  and subsidiary ones
;
pmenu_base  = WIDGET_BASE(sel_parm_base, /COLUMN)
m1_widg    = WIDGET_BASE(pmenu_base, /ROW, space=50)


;
;  form the widgets
;
font="-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"
;
;  first the 'Done' button to exit
;
doneid = widget_button(m1_widg, value='OK',font=font)

;
;  then the clear and exit
;
clearid = widget_button(m1_widg, value='Reset',font=font)

;
;  then the cancel and exit
;
cancelid = widget_button(m1_widg, value='Cancel',font=font)


;
;  and the sort menu
;
xpdmenu, ['"Sort by" {', $
                        '"Mnemonic"            SORT_M',$
                        '"Comment"             SORT_C',$
                        '"Search string"       SORT_S',$
                        '"Original order"      SORT_O','}'], m1_widg, font=font
                                    

;
;  make up the parameter list
;
get_parm_list

;
;  array for selected parameters
;
wanted_parms = strarr(1000)


;
;  and the list widget to display the list
;
parm_list_id = widget_list(pmenu_base, value=parm_list, ysize=40)




;
;  make it all appear
;
WIDGET_CONTROL, sel_parm_base, /realize

end
