for others who might have this dilemma,
I found a workaround
after seeing one integer chart property, ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS)
I put all buttons in indicator window,
and then checked the y coordinate of mouse
like this:
if (id==CHARTEVENT_CLICK && dparam > ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS)) { printf("skip click event, because it's not in main window"); return; }
ifmihai:
for others who might have this dilemma,
I found a workaround
after seeing one integer chart property, ChartGetInteger(0,CHART_HEIGHT_IN_PIXELS)
I put all buttons in indicator window,
and then checked the y coordinate of mouse
like this:
or use
if(id==CHARTEVENT_OBJECT_CLICK) {
...
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. When I click on the chart, CHARTEVENT_CLICK fires, onClick() is launched
2. When I click on an object, CHARTEVENT_CLICK && CHARTEVENT_OBJECT_CLICK are fired, both onClick() and onObjectClick() are launched
In case 2,
How can I stop onClick() from being launched? I cannot think of a solution.
Anyone can help me?