onLButtonUp() |
Top Previous Next |
onLButtonUp( barIndex, yValue [,x] [,y] )
This function is an event handler for left-button mouse events. Be aware that onLButtonDown and onLButtonUp also get called on double-click events.
Parameters
Usage
function preMain() {
setPriceStudy(true); setStudyTitle("Mouse Button Clicks"); setShowCursorLabel(false);
}
function main() {
}
function onLButtonDown( barIndex, yValue) {
debugPrintln("LeftDown: " + barIndex + ", " + yValue); updateClickInfo(barIndex, yValue);
}
function onLButtonUp( barIndex, yValue) {
debugPrintln("LeftUp: " + barIndex + ", " + yValue); updateClickInfo(barIndex, yValue);
}
function onRButtonDown( barIndex, yValue) {
debugPrintln("RightDown: " + barIndex + ", " + yValue); updateClickInfo(barIndex, yValue);
}
function onRButtonUp( barIndex, yValue) {
debugPrintln("RightUp: " + barIndex + ", " + yValue); updateClickInfo(barIndex, yValue);
}
function onLButtonDblClk( barIndex, yValue) {
debugPrintln("LeftDblClk: " + barIndex + ", " + yValue); updateDblClickInfo(barIndex, yValue);
}
function onRButtonDblClk( barIndex, yValue) {
debugPrintln("RightDblClk: " + barIndex + ", " + yValue); updateDblClickInfo(barIndex, yValue);
}
function updateClickInfo(barIndex, yValue) {
drawTextAbsolute(5, 15, "Clicked bar " + barIndex + " at " + yValue.toFixed(2), Color.white, Color.navy, Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD, null, 14, "ClickInfo");
}
function updateDblClickInfo(barIndex, yValue) {
drawTextAbsolute(5, 35, "Double Clicked bar " + barIndex + " at " + yValue.toFixed(2), Color.white, Color.navy, Text.RELATIVETOLEFT|Text.RELATIVETOBOTTOM|Text.BOLD, null, 14, "DblClickInfo"); }
|