LIST_SELECTOR
The purpose of this function is to implement a pop-up dialog widget for the purpose of selecting "names". Names can be names of variables, names of files, etc. Any string array can be used.
selectedNames = List_Selector(theNames)
theNames: A string array of potential "names" that can be selected.
ALL: Set this keyword if you wish all the names to be selected initially. CANCEL: An output keyword set to 1 if the user cancels or quits the program without hitting the Accept button. Set to 0 if a proper selection was made and the use hits the Accept button. COUNT: An output keyword containing the number of elements in the return array. GROUP_LEADER: The widget identifier of a widget who will be the group leader for this dialog. Passing a group leader is the *only* way to assure the dialog will be a MODAL dialog (as opposed to a blocking dialog). A GROUP_LEADER is required if you will be using this function in an IDL Virtual Machine application. LABEL: A string that will be placed on a label above the selections. If not used, no label is used in the program. LIST_COUNTER: If this keyword is set, a number is associated and displayed with each list item, starting with the number 1. TITLE: A string that is used for the title of the dialog window. If undefined, then "Selection Widget" is used. SELECTED_INDICES: An output vector of the selected indices from theNames array.
selectedNames: Typically, an array of selected names. If there is only one item in the selection, the variable will be a scalar string.
See the List_Selector_Test procedure below. I use the program to allow the user to select the names of scientific data sets in an HDF file for further reading and processing.
Written by David W. Fanning, 11 January 2009, based on Name_Selector program. Added "Accept on Double-Click" functionality. 14 January 2009. DWF. Added LIST_COUNTER keyword. 25 May 2009. DWF. Well, basically a RE-DO of yesterday's work, although done correctly today. 26 May 2009. DWF. Fixed a problem when the user double-clicks an item in the list. 8 August 2009. DWF. Double clicks are a problem with UNIX machines becausesets event.clicks = 2 prematurely. Removed double-click functionality from all but Windows machines. 9 Feb 2012. DWF.