5df780d2ecfcf6e4292710fa1a5af810066a0a04
tdreszer
Wed Nov 2 16:24:50 2011 -0700
Turned on matrix squeezing.
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index d698f84..5f8c4c8 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -6308,31 +6308,31 @@
#define MATRIX_BOTTOM_BUTTONS_AFTER 20
static void buttonsForAll()
{
printf(PM_BUTTON_UC,"true", "", "", "", "", "", "plus_all", "add_sm.gif");
printf(PM_BUTTON_UC,"false","", "", "", "", "", "minus_all", "remove_sm.gif");
}
static void buttonsForOne(char *name,char *class,boolean vertical)
{
printf(PM_BUTTON_UC, "true", ",'", class, "'", "", "", name, "add_sm.gif");
if (vertical)
puts("
");
printf(PM_BUTTON_UC, "false", ",'", class, "'", "", "", name, "remove_sm.gif");
}
-//#define MATRIX_SQUEEZE 10
+#define MATRIX_SQUEEZE 10
#ifdef MATRIX_SQUEEZE
static int matrixSqueeze(membersForAll_t* membersForAll)
// Returns non-zero if the matrix will be squeezed. Non-zero is actually squeezedLabelHeight
{
boolean labelHeight = 0;
members_t *dimensionX = membersForAll->members[dimX];
members_t *dimensionY = membersForAll->members[dimY];
if(dimensionX && dimensionY)
{
if(dimensionX->count>MATRIX_SQUEEZE)
{
int ixX,cntX=0;
for (ixX = 0; ixX < dimensionX->count; ixX++)
{
if(dimensionX->subtrackList && dimensionX->subtrackList[ixX] && dimensionX->subtrackList[ixX]->val)
@@ -6383,31 +6383,31 @@
printf("
%s | ",
squeeze, (top?"up45":"dn45"), dimensionX->groupTitle);
else
#endif///def MATRIX_SQUEEZE
printf("%s | ", dimensionX->groupTitle);
}
else
printf(" %s | ",(top?"TOP":"BOTTOM"), dimensionX->groupTitle);
for (ixX = 0; ixX < dimensionX->count; ixX++)
{
if(dimensionX->subtrackList && dimensionX->subtrackList[ixX] && dimensionX->subtrackList[ixX]->val)
{
#ifdef MATRIX_SQUEEZE
if(dimensionY && squeeze>0)
- printf("%s | ",dimensionX->tags[ixX],(top?"up45":"dn45"),
+ printf("%s | \n",dimensionX->tags[ixX],(top?"up45":"dn45"),
compositeLabelWithVocabLink(db,parentTdb,dimensionX->subtrackList[ixX]->val,dimensionX->groupTag,dimensionX->titles[ixX]));
else
#endif///def MATRIX_SQUEEZE
{
char *label =replaceChars(dimensionX->titles[ixX]," (","
(");
#ifdef MATRIX_SQUEEZE
printf(" %s | ",dimensionX->tags[ixX],
#else///ifndef MATRIX_SQUEEZE
printf(" %s | ",
#endif///ndef MATRIX_SQUEEZE
compositeLabelWithVocabLink(db,parentTdb,dimensionX->subtrackList[ixX]->val,dimensionX->groupTag,label));
freeMem(label);
}
cntX++;
}
@@ -6448,31 +6448,31 @@
{
members_t *dimensionX = membersForAll->members[dimX];
members_t *dimensionY = membersForAll->members[dimY];
// If there are both X and Y dimensions, then there is a row of buttons in X
if(dimensionX && dimensionY)
{
int ixX,cntX=0;
printf("%s | ",COLOR_BG_ALTDEFAULT, dimensionY->groupTitle);
for (ixX = 0; ixX < dimensionX->count; ixX++) // Special row of +- +- +-
{
if(dimensionX->subtrackList && dimensionX->subtrackList[ixX] && dimensionX->subtrackList[ixX]->val)
{
char objName[SMALLBUF];
#ifdef MATRIX_SQUEEZE
- puts("");
+ printf(" | \n",dimensionX->tags[ixX]);
#else///ifndef MATRIX_SQUEEZE
puts(" | ");
#endif///ndef MATRIX_SQUEEZE
safef(objName, sizeof(objName), "plus_%s_all", dimensionX->tags[ixX]);
boolean vertical = FALSE;
#ifdef MATRIX_SQUEEZE
vertical = (squeeze>0);
#endif///def MATRIX_SQUEEZE
buttonsForOne( objName, dimensionX->tags[ixX], vertical );
puts(" | ");
cntX++;
}
}
// If dimension is big enough, then add Y buttons to right as well
if(cntX>MATRIX_RIGHT_BUTTONS_AFTER)
@@ -6499,51 +6499,51 @@
static void matrixYheadings(char *db,struct trackDb *parentTdb, membersForAll_t* membersForAll,int ixY,boolean left)
/* prints the column of Y labels and buttons */
{
members_t *dimensionX = membersForAll->members[dimX];
members_t *dimensionY = membersForAll->members[dimY];
struct trackDb *childTdb = NULL;
if(dimensionY && dimensionY->subtrackList && dimensionY->subtrackList[ixY] && dimensionY->subtrackList[ixY]->val)
childTdb = dimensionY->subtrackList[ixY]->val;
if(dimensionX && dimensionY && childTdb != NULL) // Both X and Y, then column of buttons
{
char objName[SMALLBUF];
#ifdef MATRIX_SQUEEZE
- printf("",dimensionY->tags[ixY],left?"RIGHT":"LEFT");
+ printf(" | ",dimensionY->tags[ixY],left?"RIGHT":"LEFT");
#else///ifndef MATRIX_SQUEEZE
printf(" | ",left?"RIGHT":"LEFT");
#endif///ndef MATRIX_SQUEEZE
if(left)
printf("%s ",compositeLabelWithVocabLink(db,parentTdb,childTdb,dimensionY->groupTag,dimensionY->titles[ixY]));
safef(objName, sizeof(objName), "plus_all_%s", dimensionY->tags[ixY]);
buttonsForOne( objName, dimensionY->tags[ixY], FALSE );
if(!left)
printf(" %s",compositeLabelWithVocabLink(db,parentTdb,childTdb,dimensionY->groupTag,dimensionY->titles[ixY]));
puts(" | ");
}
else if (dimensionX)
{
printf("",left?"RIGHT":"LEFT");
buttonsForAll();
puts(" | ");
}
else if (left && dimensionY && childTdb != NULL)
#ifdef MATRIX_SQUEEZE
- printf("%s | \n",dimensionY->tags[ixY],
+ printf("%s | \n",dimensionY->tags[ixY],
compositeLabelWithVocabLink(db,parentTdb,childTdb,dimensionY->groupTag,dimensionY->titles[ixY]));
#else///ifndef MATRIX_SQUEEZE
printf("%s | \n",compositeLabelWithVocabLink(db,parentTdb,childTdb,dimensionY->groupTag,dimensionY->titles[ixY]));
#endif///ndef MATRIX_SQUEEZE
}
static int displayABCdimensions(char *db,struct cart *cart, struct trackDb *parentTdb, struct slRef *subtrackRefList, membersForAll_t* membersForAll)
/* This will walk through all declared nonX&Y dimensions (X and Y is the 2D matrix of CBs.
NOTE: ABC dims are only supported if there are X & Y both. Also expected number should be passed in */
{
int count=0,ix;
for(ix=dimA;ixdimMax;ix++)
{
if(membersForAll->members[ix]==NULL)
continue;
---|