vis_files/init.js
/// Fires if mouse button is clicked down
Fires if mouse button is clicked down
Fires if mouse button is clicked down
function mdown(xx,yy) 
{
   var d = new Date(); timedown = d.getTime();
	if(timedown-timeup < 300 && timeclick < 300){ mousedblclick(); timedown = 0; return;}
	drag = 0; 
	if(plottype == "map" && canbut != -1 && over != -1 && buttype[over] == CANVASBUT){
		drag = 1; mxst = mx; myst = my;
	}
	switch(buttype[over]){
	case MENUSLIDEBUT:
		var ob = tree[page].child[ps].child[pss];
		if(my >= sliy1 && my <= sliy2){ mxst = mx; myst = my; menuslidest = ob.y; menuslidesize = butdy[over]; drag = 2;}
		else{
			if(my > sliy2){ ob.y += 0.9*ob.frac; if(ob.y > 1-ob.frac) ob.y = 1-ob.frac; buttoninit();}
			else{
				if(my < sliy1){ ob.y -= 0.9*ob.frac; if(ob.y < 0) ob.y = 0; buttoninit();}
			}
		}
		break;	
	case SLIDEBUT:
		if(my >= slidey1 && my <= slidey2){ mxst = mx; myst = my; menuslidest = slidey; menuslidesize = butdy[over]; drag = 3;}
		else{
			if(my > slidey2){ slidey += 0.9*slidefrac; if(slidey > 1-slidefrac) slidey = 1-slidefrac; buttoninit();}
			else{
				if(my < slidey1){ slidey -= 0.9*slidefrac; if(slidey < 0) slidey = 0; buttoninit();}
			}
		}
		break;	
	case TABYSLIDEBUT:
		if(my >= taby1 && my <= taby2){ mxst = mx; myst = my; menuslidest = taby_slide; menuslidesize = butdy[over]; drag = 4;}
		else{
			if(my > taby2){ taby_slide += 0.9*taby_slidefrac; if(taby_slide > 1-taby_slidefrac) taby_slide = 1-taby_slidefrac; buttoninit();}
			else{
				if(my < taby1){ taby_slide -= 0.9*taby_slidefrac; if(taby_slide < 0) taby_slide = 0; buttoninit();}
			}
		}
		break;	
	case TABXSLIDEBUT:
		if(mx >= tabx1 && mx <= tabx2){ mxst = mx; myst = my; menuslidest = tabx_slide; menuslidesize = butdx[over]; drag = 5;}
		else{
			if(mx > tabx2){ tabx_slide += 0.9*tabx_slidefrac; if(tabx_slide > 1-tabx_slidefrac) tabx_slide = 1-tabx_slidefrac; buttoninit();}
			else{
				if(mx < tabx1){ tabx_slide -= 0.9*tabx_slidefrac; if(tabx_slide < 0) tabx_slide = 0; buttoninit();}
			}
		}
		break;	
	}
}
function mdown ( xx , yy ) { var d = new Date ( ) ; timedown = d . getTime ( ) ; if ( timedown - timeup < 300 && timeclick < 300 ) { mousedblclick ( ) ; timedown = 0 ; return ; } drag = 0 ; if ( plottype == "map" && canbut != - 1 && over != - 1 && buttype [ over ] == CANVASBUT ) { drag = 1 ; mxst = mx ; myst = my ; } switch ( buttype [ over ] ) { case MENUSLIDEBUT : var ob = tree [ page ] . child [ ps ] . child [ pss ] ; if ( my >= sliy1 && my <= sliy2 ) { mxst = mx ; myst = my ; menuslidest = ob . y ; menuslidesize = butdy [ over ] ; drag = 2 ; } else { if ( my > sliy2 ) { ob . y += 0.9 * ob . frac ; if ( ob . y > 1 - ob . frac ) ob . y = 1 - ob . frac ; buttoninit ( ) ; } else { if ( my < sliy1 ) { ob . y -= 0.9 * ob . frac ; if ( ob . y < 0 ) ob . y = 0 ; buttoninit ( ) ; } } } break ; case SLIDEBUT : if ( my >= slidey1 && my <= slidey2 ) { mxst = mx ; myst = my ; menuslidest = slidey ; menuslidesize = butdy [ over ] ; drag = 3 ; } else { if ( my > slidey2 ) { slidey += 0.9 * slidefrac ; if ( slidey > 1 - slidefrac ) slidey = 1 - slidefrac ; buttoninit ( ) ; } else { if ( my < slidey1 ) { slidey -= 0.9 * slidefrac ; if ( slidey < 0 ) slidey = 0 ; buttoninit ( ) ; } } } break ; case TABYSLIDEBUT : if ( my >= taby1 && my <= taby2 ) { mxst = mx ; myst = my ; menuslidest = taby_slide ; menuslidesize = butdy [ over ] ; drag = 4 ; } else { if ( my > taby2 ) { taby_slide += 0.9 * taby_slidefrac ; if ( taby_slide > 1 - taby_slidefrac ) taby_slide = 1 - taby_slidefrac ; buttoninit ( ) ; } else { if ( my < taby1 ) { taby_slide -= 0.9 * taby_slidefrac ; if ( taby_slide < 0 ) taby_slide = 0 ; buttoninit ( ) ; } } } break ; case TABXSLIDEBUT : if ( mx >= tabx1 && mx <= tabx2 ) { mxst = mx ; myst = my ; menuslidest = tabx_slide ; menuslidesize = butdx [ over ] ; drag = 5 ; } else { if ( mx > tabx2 ) { tabx_slide += 0.9 * tabx_slidefrac ; if ( tabx_slide > 1 - tabx_slidefrac ) tabx_slide = 1 - tabx_slidefrac ; buttoninit ( ) ; } else { if ( mx < tabx1 ) { tabx_slide -= 0.9 * tabx_slidefrac ; if ( tabx_slide < 0 ) tabx_slide = 0 ; buttoninit ( ) ; } } } break ; } }
Fires if mouse button is clicked down
Fires if mouse button is clicked down