d1c82531fdb1f0833584404c75e3c977508e454f
tdreszer
  Tue Mar 8 16:23:55 2011 -0800
Added lib routine for creating a single/multiple drop down, where the multiple will be expected to be converted into a ui-dropdownchecklist.js type multi-select
diff --git src/inc/cheapcgi.h src/inc/cheapcgi.h
index d8c7d86..ba379c8 100644
--- src/inc/cheapcgi.h
+++ src/inc/cheapcgi.h
@@ -312,30 +312,39 @@
 	int menuSize, char *checked, char *class, char *style);
 /* Make a drop-down list with names, text class and style. */
 
 void cgiMakeDropListWithVals(char *name, char *menu[], char *values[],
                          int menuSize, char *checked);
 /* Make a drop-down list with names and values. In this case checked
  * corresponds to a value, not a menu. */
 
 void cgiMakeDropListFull(char *name, char *menu[], char *values[], int menuSize, char *checked, char *extraAttribs);
 /* Make a drop-down list with names and values. */
 
 void cgiDropDownWithTextValsAndExtra(char *name, char *text[], char *values[],
     int count, char *selected, char *extra);
 /* Make a drop-down list with both text and values. */
 
+char *cgiMakeSelectDropList(boolean multiple, char *name, struct slPair *valsAndLabels,char *selected, char *anyAll,char *extraClasses, char *extraHtml);
+// Returns allocated string of HTML defining a drop-down select (if multiple, REQUIRES ui-dropdownchecklist.js)
+// In valsAndLabels, val (pair->name) must be filled in but label (pair->val) may be NULL.
+// selected, if not NULL is a val found in the valsAndLabels (multiple then comma delimited list).  If null and anyAll not NULL, that will be selected
+// anyAll, if not NULL is the string for an initial option.  It can contain val and label, delimited by a comma
+// extraHtml, if not NULL contains id, javascript calls and style.  It does NOT contain class definitions
+#define cgiMakeMultiSelectDropList(name, valsAndLabels, selected, anyAll, extraClasses, extraHtml)  cgiMakeSelectDropList(TRUE, (name), (valsAndLabels), (selected), (anyAll), (extraClasses), (extraHtml))
+#define cgiMakeSingleSelectDropList(name, valsAndLabels, selected, anyAll, extraClasses, extraHtml) cgiMakeSelectDropList(FALSE,(name), (valsAndLabels), (selected), (anyAll), (extraClasses), (extraHtml))
+
 void cgiMakeMultList(char *name, char *menu[], int menuSize, struct slName *checked, int length);
 /* Make a list of names which can have multiple selections.
  * Same as drop-down list except "multiple" is added to select tag */
 
 void cgiMakeCheckboxGroup(char *name, char *menu[], int menuSize, struct slName *checked,
 			  int tableColumns);
 /* Make a table of checkboxes that have the same variable name but different
  * values (same behavior as a multi-select input). */
 
 void cgiMakeCheckboxGroupWithVals(char *name, char *menu[], char *values[], int menuSize,
 				  struct slName *checked, int tableColumns);
 /* Make a table of checkboxes that have the same variable name but different
  * values (same behavior as a multi-select input), with nice labels in menu[]. */
 
 void cgiMakeHiddenVarWithExtra(char *varName, char *string, char *extra);