8d89f83e0a13fbf7a021d5156df5218ec08356d4 kate Tue Aug 28 16:30:50 2018 -0700 Add UI option to suppress dashed lines in reversed direction. JK request. refs #21917 diff --git src/hg/lib/interactUi.c src/hg/lib/interactUi.c index 9a0988b..4dbd775 100644 --- src/hg/lib/interactUi.c +++ src/hg/lib/interactUi.c @@ -38,76 +38,92 @@ int minScore = cartUsualInt(cart, buffer, 0); printf("Minimum score: "); cgiMakeIntVar(buffer, minScore, 0); } void interactUiTrackHeight(struct cart *cart, char *track, struct trackDb *tdb) /* Input box to change track height */ { // track height control char buffer[1024]; int min, max, deflt, current; cartTdbFetchMinMaxPixels(cart, tdb, INTERACT_MINHEIGHT, INTERACT_MAXHEIGHT, atoi(INTERACT_DEFHEIGHT), &min, &max, &deflt, ¤t); safef(buffer, sizeof buffer, "%s.%s", track, INTERACT_HEIGHT); -printf("

Track height: "); +printf("Track height: "); cgiMakeIntVar(buffer, current, 3); printf(" pixels (range: %d to %d, default: %d)", min, max, deflt); } void interactUiDrawMode(struct cart *cart, char *track, struct trackDb *tdb) /* Radio buttons to select drawing mode */ { char *drawMode = cartUsualStringClosestToHome(cart, tdb, isNameAtParentLevel(tdb, track), INTERACT_DRAW, INTERACT_DRAW_DEFAULT); char cartVar[1024]; puts("Draw mode: "); safef(cartVar, sizeof(cartVar), "%s.%s", track, INTERACT_DRAW); cgiMakeRadioButton(cartVar, INTERACT_DRAW_CURVE , sameString(INTERACT_DRAW_CURVE, drawMode)); printf(" %s ", "curve"); cgiMakeRadioButton(cartVar, INTERACT_DRAW_ELLIPSE, sameString(INTERACT_DRAW_ELLIPSE, drawMode)); printf(" %s ", "ellipse"); cgiMakeRadioButton(cartVar, INTERACT_DRAW_LINE, sameString(INTERACT_DRAW_LINE, drawMode)); printf(" %s ", "rectangle"); } void interactUiEndpointFilter(struct cart *cart, char *track, struct trackDb *tdb) /* Radio buttons to allow excluding items lacking endpoints in window */ { char *endsVisible = cartUsualStringClosestToHome(cart, tdb, isNameAtParentLevel(tdb, track), INTERACT_ENDS_VISIBLE, INTERACT_ENDS_VISIBLE_DEFAULT); char cartVar[1024]; -puts("

Show interactions: "); -//puts("

Exclude interactions: "); +puts("Show interactions: "); safef(cartVar, sizeof(cartVar), "%s.%s", track, INTERACT_ENDS_VISIBLE); cgiMakeRadioButton(cartVar, INTERACT_ENDS_VISIBLE_ANY, sameString(INTERACT_ENDS_VISIBLE_ANY, endsVisible)); printf(" %s ", "all"); //printf(" %s ", "none"); cgiMakeRadioButton(cartVar, INTERACT_ENDS_VISIBLE_ONE, sameString(INTERACT_ENDS_VISIBLE_ONE, endsVisible)); printf(" %s ", "at least one end"); //printf(" %s ", "only one end"); cgiMakeRadioButton(cartVar, INTERACT_ENDS_VISIBLE_TWO , sameString(INTERACT_ENDS_VISIBLE_TWO, endsVisible)); printf(" %s ", "both ends in window"); //printf(" %s ", "no ends in window"); } +void interactUiDashedLines(struct cart *cart, char *track, struct trackDb *tdb) +/* Checkbox for dashed lines on interactions in reverse direction */ +{ +if (!interactUiDirectional(tdb)) + return; +char cartVar[1024]; +safef(cartVar, sizeof cartVar, "%s.%s", tdb->track, INTERACT_DIRECTION_DASHES); +boolean doDashes = cartCgiUsualBoolean(cart, cartVar, INTERACT_DIRECTION_DASHES_DEFAULT); +cgiMakeCheckBox(cartVar, doDashes); +printf("Draw reverse direction interactions with dashed lines"); +} + void interactCfgUi(char *database, struct cart *cart, struct trackDb *tdb, char *track, char *title, boolean boxed) /* Configure interact track type */ { if (cartVarExists(cart, "ajax")) isPopup = TRUE; boxed = cfgBeginBoxAndTitle(tdb, boxed, title); if (startsWith("big", tdb->type)) labelCfgUi(database, cart, tdb); //printf("\n\n
", //isPopup ? 75 : 100, boxed ?" width='100%'":""); +puts("

"); interactUiMinScore(cart, track, tdb); +puts("

"); interactUiEndpointFilter(cart, track, tdb); +puts("

"); interactUiTrackHeight(cart, track, tdb); -puts("

"); +puts("

"); interactUiDrawMode(cart, track, tdb); -//puts("\n

\n"); +puts("

"); +interactUiDashedLines(cart, track, tdb); +puts("

"); cfgEndBox(boxed); }