onRButtonDblClk()

eSignal EFS 2

onRButtonDblClk()

Top  Previous  Next

 

onRButtonDblClk( barIndex, yValue [,x] [,y] )

 

This function is an event handler for right-button double-click mouse events. Be aware that onRButtonDown and onRButtonUp also get called on double-click events.

 

Parameters

 

barIndex

the bar index where mouse was clicked

yValue

the price value where mouse was clicked

x

optional. x coordinate in study pane

y

optional. y coordinate in study pane

 

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");

}