89630712981cec39a9290afd1dae3646de4f4c44
larrym
Wed Oct 19 12:35:59 2011 -0700
remove obsolete dragZooming flag
diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index df075e4..05f94f4 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -111,31 +111,30 @@
/* dropdown for ruler visibility */
{
"hide",
"dense",
"full"
};
char *protDbName; /* Name of proteome database for this genome. */
#define MAX_CONTROL_COLUMNS 6
#define LOW 1
#define MEDIUM 2
#define BRIGHT 3
#define MAXCHAINS 50000000
boolean hgDebug = FALSE; /* Activate debugging code. Set to true by hgDebug=on in command line*/
int imagePixelHeight = 0;
-boolean dragZooming = TRUE;
struct hash *oldVars = NULL;
struct jsonHashElement *jsonForClient = NULL;
boolean hideControls = FALSE; /* Hide all controls? */
boolean trackImgOnly = FALSE; /* caller wants just the track image and track table html */
boolean ideogramToo = FALSE; /* caller wants the ideoGram (when requesting just one track) */
/* Structure returned from findGenomePos.
* We use this to to expand any tracks to full
* that were found to contain the searched-upon
* position string */
struct hgPositions *hgp = NULL;
/* Other global variables. */
struct trackHub *hubList = NULL; /* List of all relevant hubs. */
@@ -1696,35 +1695,30 @@
pe = round(pScale*i);
we = round(wScale*i);
mid = (ws + we)/2 + winStart;
ns = mid-newWinWidth/2;
ne = ns + newWinWidth;
if (ns < 0)
{
ns = 0;
ne -= ns;
}
if (ne > seqBaseCount)
{
ns -= (ne - seqBaseCount);
ne = seqBaseCount;
}
- if(!dragZooming)
- {
- mapBoxJumpTo(hvg, ps+insideX,rulerClickY,pe-ps,rulerClickHeight,NULL,
- chromName, ns, ne, message);
- }
}
return newWinWidth;
}
static int doDrawRuler(struct hvGfx *hvg,int *newWinWidth,int *rulerClickHeight,
int rulerHeight, int yAfterRuler, int yAfterBases, MgFont *font,
int fontHeight,boolean rulerCds)
/* draws the ruler. */
{
int scaleBarPad = 2;
int scaleBarHeight = fontHeight;
int scaleBarTotalHeight = fontHeight + 2 * scaleBarPad;
int titleHeight = fontHeight;
int baseHeight = fontHeight;
//int yAfterBases = yAfterRuler;
@@ -1945,31 +1939,31 @@
struct image *theOneImg = NULL; // No need to be global, only the map needs to be global
struct image *theSideImg = NULL; // Because dragScroll drags off end of image, the side label gets seen. Therefore we need 2 images!!
//struct imgTrack *curImgTrack = NULL; // Make this global for now to avoid huge rewrite
struct imgSlice *curSlice = NULL; // No need to be global, only the map needs to be global
struct mapSet *curMap = NULL; // Make this global for now to avoid huge rewrite
// Set up imgBox dimensions
int sliceWidth[stMaxSliceTypes]; // Just being explicit
int sliceOffsetX[stMaxSliceTypes];
int sliceHeight = 0;
int sliceOffsetY = 0;
char *rulerTtl = NULL;
if(theImgBox)
// theImgBox is a global for now to avoid huge rewrite of hgTracks. It is started
// prior to this in doTrackForm()
{
- rulerTtl = (dragZooming?"drag select or click to zoom":"click to zoom 3x");
+ rulerTtl = "drag select or click to zoom";
hPrintf("\n", database);
hPrintf("\n", chromName);
hPrintf("\n", winStart);
hPrintf("\n", winEnd);
hPrintf("\n", tl.picWidth);
#ifdef IMAGEv2_DRAG_SCROLL
// If a portal was established, then set the global dimensions to the entire image size
if(imgBoxPortalDimensions(theImgBox,&winStart,&winEnd,&(tl.picWidth),NULL,NULL,NULL,NULL,NULL))
{
pixWidth = tl.picWidth;
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
#endif//def IMAGEv2_DRAG_SCROLL
memset((char *)sliceWidth, 0,sizeof(sliceWidth));
@@ -2515,31 +2509,32 @@
{
if(theImgBox)
{
// Set imgTrack in case any map items will be set
sliceHeight = trackPlusLabelHeight(track, fontHeight);
sliceOffsetY = y;
curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL);
}
y = doTrackMap(track, hvg, y, fontHeight, trackPastTabX, trackPastTabWidth);
}
}
/* Finish map. */
hPrintf("\n");
-jsonHashAddBoolean(jsonForClient, "dragSelection", dragZooming);
+// XXXX remove this after we remove dragSelection from hgTracks.js
+jsonHashAddBoolean(jsonForClient, "dragSelection", TRUE);
jsonHashAddBoolean(jsonForClient, "inPlaceUpdate", IN_PLACE_UPDATE);
jsonHashAddNumber(jsonForClient, "rulerClickHeight", rulerClickHeight);
if(newWinWidth)
{
jsonHashAddNumber(jsonForClient, "newWinWidth", newWinWidth);
}
/* Save out picture and tell html file about it. */
if(hvgSide != hvg)
hvGfxClose(&hvgSide);
hvGfxClose(&hvg);
#ifdef SUPPORT_CONTENT_TYPE
char *type = cartUsualString(cart, "hgt.contentType", "html");
@@ -2587,31 +2582,31 @@
{
imageBoxDraw(theImgBox);
#ifdef IMAGEv2_DRAG_SCROLL
// If a portal was established, then set the global dimensions back to the portal size
if(imgBoxPortalDimensions(theImgBox,NULL,NULL,NULL,NULL,&winStart,&winEnd,&(tl.picWidth),NULL))
{
pixWidth = tl.picWidth;
winBaseCount = winEnd - winStart;
insideWidth = tl.picWidth-gfxBorder-insideX;
}
#endif//def IMAGEv2_DRAG_SCROLL
imgBoxFree(&theImgBox);
}
else
{
- char *titleAttr = dragZooming ? "title='click or drag mouse in base position track to zoom in'" : "";
+ char *titleAttr = "title='click or drag mouse in base position track to zoom in'";
hPrintf("
\n");
}
flatTracksFree(&flatTracks);
}
static void appendLink(struct hotLink **links, char *url, char *name, char *id)
{
// append to list of links for later printing and/or communication with javascript client
struct hotLink *link;
AllocVar(link);
link->name = cloneString(name);
link->url = cloneString(url);
link->id = cloneString(id);
@@ -4986,31 +4981,31 @@
char buf[256];
char *survey = cfgOptionEnv("HGDB_SURVEY", "survey");
char *surveyLabel = cfgOptionEnv("HGDB_SURVEY_LABEL", "surveyLabel");
char *javascript = "onchange=\"document.location = '/cgi-bin/hgTracks?db=' + document.TrackForm.db.options[document.TrackForm.db.selectedIndex].value;\"";
if (containsStringNoCase(database, "zoo"))
{
hPuts("Organism ");
printAssemblyListHtmlExtra(database, javascript);
}
sprintf(buf, "%s:%d-%d", chromName, winStart+1, winEnd);
position = cloneString(buf);
hWrites("position/search ");
hTextVar("position", addCommasToPos(database, position), 30);
sprintLongWithCommas(buf, winEnd - winStart);
- if(dragZooming && assemblySupportsGeneSuggest(database))
+ if(assemblySupportsGeneSuggest(database))
hPrintf(" gene "
"\n"
"\n", assemblyGeneSuggestTrack(database)
);
hWrites(" ");
hButtonWithOnClick("hgt.jump", "jump", NULL, "jumpButtonOnClick()");
hOnClickButton(clearButtonJavascript,"clear");
hPrintf(" size %s bp. ", buf);
hWrites(" ");
hButton("hgTracksConfigPage", "configure");
if (survey && differentWord(survey, "off"))
hPrintf(" %s\n", survey, surveyLabel ? surveyLabel : "Take survey");
hPutc('\n');
}
}
@@ -5069,31 +5064,31 @@
hPrintf("move start
");
#if IN_PLACE_UPDATE
hButtonWithOnClick("hgt.dinkLL", " < ", "move start position to the left", "return navigateButtonClick(this);");
hTextVar("dinkL", cartUsualString(cart, "dinkL", "2.0"), 3);
hButtonWithOnClick("hgt.dinkLR", " > ", "move start position to the right", "return navigateButtonClick(this);");
#else
hButton("hgt.dinkLL", " < ");
hTextVar("dinkL", cartUsualString(cart, "dinkL", "2.0"), 3);
hButton("hgt.dinkLR", " > ");
#endif
hPrintf("");
hPrintf("