Nothing; he can always delete any object via Charts → Objects → Objects List (Control+B). Deal with it.
Nothing; he can always delete any object via Charts → Objects → Objects List (Control+B). Deal with it.
Suppose the indicator created a Label object on the chart by ObjectCreate ,
Now the user draws a trendline for himself,
and He regrets it and clears his trendline with the backspace button.
The problem is that if He hits the backspace again, He can also delete the object created by the indicator, and this is not good.
What can we do to prevent the user from deleting objects created by the indicator with the backspace button?
I used OBJPROP_SELECTED , OBJPROP_SELECTABLE , OBJPROP_HIDDEN but it's not lock my object.
void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam) { // 32=BackSpaceCode detail for https://www.w3.org/2002/09/tests/keys.html if(id==CHARTEVENT_KEYDOWN && lparam==32) ObjectDelete(label); }
- I don't know why making it un-selectable doesn't fix it. But since you tried that, the answer is still “nothing.”
- What part of “Deal with it” was unclear? If it gets deleted, put it back. Done
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Suppose the indicator created a Label object on the chart by ObjectCreate ,
Now the user draws a trendline for himself,
and He regrets it and clears his trendline with the backspace button.
The problem is that if He hits the backspace again, He can also delete the object created by the indicator, and this is not good.
What can we do to prevent the user from deleting objects created by the indicator with the backspace button?
I used OBJPROP_SELECTED , OBJPROP_SELECTABLE , OBJPROP_HIDDEN but it's not lock my object.