Hi,
I am trying to use mouse functions. But mouse events like Left Button click etc are not getting captured. Any suggestion ?
Thanks in Advance
Ramesh
I have used following code...
function preMain()
{
setPriceStudy(true);
setStudyTitle("Left Mouse Button Clicks");
setShowCursorLabel(true);
}
function main()
{
}
function onLButtonDown( barIndex, yValue)
{
debugPrintln("LeftDown: " + barIndex + ", " + yValue);
updateClickInfo(barIndex, yValue);
}
function onLButtonDblClk( barIndex, yValue)
{
debugPrintln("LeftDblClk: " + 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.BOL D,
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.BOL D,
null, 14, "DblClickInfo");
}
I am trying to use mouse functions. But mouse events like Left Button click etc are not getting captured. Any suggestion ?
Thanks in Advance
Ramesh
I have used following code...
function preMain()
{
setPriceStudy(true);
setStudyTitle("Left Mouse Button Clicks");
setShowCursorLabel(true);
}
function main()
{
}
function onLButtonDown( barIndex, yValue)
{
debugPrintln("LeftDown: " + barIndex + ", " + yValue);
updateClickInfo(barIndex, yValue);
}
function onLButtonDblClk( barIndex, yValue)
{
debugPrintln("LeftDblClk: " + 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.BOL D,
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.BOL D,
null, 14, "DblClickInfo");
}
Comment