src/hg/lib/hui.c 1.178

1.178 2009/03/18 20:18:03 tdreszer
Altered Z-dimension to use table columns
Index: src/hg/lib/hui.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/hui.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -b -B -U 4 -r1.177 -r1.178
--- src/hg/lib/hui.c	18 Mar 2009 18:27:00 -0000	1.177
+++ src/hg/lib/hui.c	18 Mar 2009 20:18:03 -0000	1.178
@@ -4002,8 +4002,10 @@
 printf("<B>Select %s:</B><BR>\n", membersOfView->title);
 puts("<TABLE><TR align=\"LEFT\">");
 for (ix = 0; ix < membersOfView->count; ix++)
     {
+    if(matchedSubtracks[ix] != NULL)
+        {
     printf("<TD>");
     if(configurable[ix] != cfgNone)
         {
         safef(objName, sizeof(objName), "%s.%s.showCfg", parentTdb->tableName,membersOfView->names[ix]);
@@ -4026,8 +4028,9 @@
     // Until the cfg boxes are inserted here, this divorces the relationship
     //if(membersOfView->count > 6 && ix == ((membersOfView->count+1)/2)-1)  // An attempt at 2 rows of cfg's No good!
     //    puts("</tr><tr><td>&nbsp;</td></tr><tr>");
     }
+    }
 puts("<TD><A HREF=\"../../goldenPath/help/multiView.html\" TARGET=_BLANK>Help on views</A></TD>");
 puts("</TR>");
 if(makeCfgRows)
     {
@@ -4284,9 +4287,9 @@
                     safef(objName, sizeof(objName), "mat_%s_cb", (dimensionX ? dimensionX->names[ixX] : dimensionY->names[ixY]));
                     safef(javascript, sizeof(javascript), "onclick='matSetSubtrackCheckBoxes(this.checked,\"%s\");'",
                           (dimensionX ? dimensionX->names[ixX] : dimensionY->names[ixY]));
                     }
-                alreadySet = cartUsualBoolean(cart, objName, alreadySet);
+                alreadySet = cartUsualBoolean(cart, objName, FALSE);
                 puts("<TD>");
                 struct dyString *dyJS = newDyString(100);
                 dyStringPrintf(dyJS, javascript);
                 dyStringPrintf(dyJS, " class=\"matrixCB");
@@ -4304,24 +4307,29 @@
         puts("</TR>\n");
         }
     if(dimensionZ)
         {
-        printf("<TR align='center' valign='bottom' BGCOLOR='%s'>",COLOR_BG_ALTDEFAULT);
-        printf("<TH class='greenRoof' colspan=50><EM><B>%s</EM></B>:",dimensionZ->title);
-        //PLUS_BUTTON( "name","plus_all_dimZ", "mat_","_dimZ_cb");
-        //MINUS_BUTTON("name","minus_all_dimZ","mat_","_dimZ_cb");
+        printf("<TR align='center' valign='bottom' BGCOLOR='%s''>",COLOR_BG_ALTDEFAULT);
+        printf("<TH class='greenRoof' STYLE='font-size: 2' colspan=50>&nbsp;</TH>");
+        printf("<TR BGCOLOR='%s'><TH valign=top align=left colspan=2 rowspan=20><B><EM>%s</EM></B>:",
+               COLOR_BG_ALTDEFAULT,dimensionZ->title);
         for(ixZ=0;ixZ<sizeOfZ;ixZ++)
             if(cellsZ[ixZ]>0)
                 {
-                printf("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+                if(ixZ > 0 && (ixZ % sizeOfX) == 0)
+                    {
+                    printf("</TR><TR BGCOLOR='%s'>",COLOR_BG_ALTDEFAULT);
+                    }
+                printf("<TH align=left nowrap>");
                 safef(objName, sizeof(objName), "mat_%s_dimZ_cb",dimensionZ->names[ixZ]);
                 safef(javascript, sizeof(javascript), "onclick='matSetSubtrackCheckBoxes(this.checked,\"%s\");'",dimensionZ->names[ixZ]);
-                alreadySet = cartUsualBoolean(cart, objName, alreadySet);
+                alreadySet = cartUsualBoolean(cart, objName, FALSE);
                 struct dyString *dyJS = newDyString(100);
                 dyStringPrintf(dyJS, javascript);
                 dyStringPrintf(dyJS, " class=\"matrixCB %s\"",dimensionZ->names[ixZ]);
                 cgiMakeCheckBoxJS(objName,alreadySet,dyStringCannibalize(&dyJS));
                 printf("%s",labelWithVocabLink(parentTdb,tdbsZ[ixZ],dimensionZ->tag,dimensionZ->values[ixZ]));
+                puts("</TH>");
                 }
         }
     puts("</TD></TR></TABLE>");
     subgroupMembersFree(&dimensionX);
@@ -4490,11 +4498,13 @@
 static void commonCssStyles()
 /* Defines a few common styles to use through CSS */
 {
     printf("<style type='text/css'>");
-    //printf(".tDnD_whileDrag {background-color:%s;}",COLOR_BG_GHOST);
     printf(".trDrag {background-color:%s;} .pale {background-color:%s;}",COLOR_BG_GHOST,COLOR_BG_PALE);
     printf(".greenRoof {border-top: 3px groove %s;}",COLOR_DARKGREEN);
+    //printf(".greenFloor {border-bottom: 3px ridge %s;}",COLOR_DARKGREEN);      // Unused
+    //printf(".hiddenRoof {border-top: 0px solid %s;}",COLOR_BG_ALTDEFAULT);     // Doesn't work
+    //printf(".hiddenFloor {border-bottom: 0px solid %s;}",COLOR_BG_ALTDEFAULT); // Doesn't work
     printf(".greenBox {border: 5px outset %s;}",COLOR_DARKGREEN);
     printf(".blueBox {border: 4px inset %s;}",COLOR_DARKBLUE);
     puts("</style>");
 }