62bb1e2ca0380d8cb811c92fa168719bada0af3b max Wed May 8 17:42:46 2013 -0700 fixed linkedFeatures mouseOver text to work with hgGenes linkouts, tested on refseq, knownGenes, simple and extended bed files. diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 5b9d68b..61c11a8 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -3491,55 +3491,60 @@ int linkedFeaturesItemStart(struct track *tg, void *item) /* Return start chromosome coordinate of item. */ { struct linkedFeatures *lf = item; return lf->start; } int linkedFeaturesItemEnd(struct track *tg, void *item) /* Return end chromosome coordinate of item. */ { struct linkedFeatures *lf = item; return lf->end; } -//static void linkedFeaturesMapItem(struct track *tg, struct hvGfx *hvg, void *item, -// char *itemName, char *mapItemName, int start, int end, -// int x, int y, int width, int height) -///* Draw the mouseOver (aka statusLine) text from the mouseOver field of lf -// * Fallback to itemName if there is no mouseOver field. -// * (derived from bedPlusLabelMapItem) */ -//{ -//// Don't bother if we are imageV2 and a dense child. -//if (theImgBox && tg->limitedVis == tvDense && tdbIsCompositeChild(tg->tdb)) -// return; -// -//struct linkedFeatures *lf = item; -//char *mouseOverText = (isEmpty(lf->mouseOver)) ? itemName: lf->mouseOver; -//mapBoxHc(hvg, start, end, x, y, width, height, tg->track, mapItemName, mouseOverText); -//} +static void linkedFeaturesMapItem(struct track *tg, struct hvGfx *hvg, void *item, + char *itemName, char *mapItemName, int start, int end, + int x, int y, int width, int height) +/* Draw the mouseOver (aka statusLine) text from the mouseOver field of lf + * Fallback to itemName if there is no mouseOver field. + * (derived from genericMapItem) */ +{ +// Don't bother if we are imageV2 and a dense child. +if (theImgBox && tg->limitedVis == tvDense && tdbIsCompositeChild(tg->tdb)) + return; + +struct linkedFeatures *lf = item; +char *newItemName = (isEmpty(lf->mouseOver)) ? itemName: lf->mouseOver; + +// copied from genericMapItem +char *directUrl = trackDbSetting(tg->tdb, "directUrl"); +boolean withHgsid = (trackDbSetting(tg->tdb, "hgsid") != NULL); +mapBoxHgcOrHgGene(hvg, start, end, x, y, width, height, tg->track, + mapItemName, newItemName, directUrl, withHgsid, NULL); +} void linkedFeaturesMethods(struct track *tg) /* Fill in track methods for linked features. */ { tg->freeItems = linkedFeaturesFreeItems; tg->drawItems = linkedFeaturesDraw; tg->drawItemAt = linkedFeaturesDrawAt; tg->itemName = linkedFeaturesName; tg->mapItemName = linkedFeaturesName; -//tg->mapItem = linkedFeaturesMapItem; +tg->mapItem = linkedFeaturesMapItem; tg->totalHeight = tgFixedTotalHeightNoOverflow; tg->itemHeight = tgFixedItemHeight; tg->itemStart = linkedFeaturesItemStart; tg->itemEnd = linkedFeaturesItemEnd; tg->itemNameColor = linkedFeaturesNameColor; tg->nextPrevExon = linkedFeaturesNextPrevItem; tg->nextPrevItem = linkedFeaturesLabelNextPrevItem; } int linkedFeaturesSeriesItemStart(struct track *tg, void *item) /* Return start chromosome coordinate of item. */ { struct linkedFeaturesSeries *lfs = item; return lfs->start; }