At the very first I know that this thread is about MQL5 and I've attached MQL4 code but I think this problem is the same in MQL4 or MQL5 (maybe I'm wrong).
EDIT: I've tried in MQL5 and this problem doesn't exist in MQL5
I create (by code) several objects on the chart and the first one is clearly over the second one even the first one has a higher zorder than the second one, if I click on the first object that click belongs to the right object (you can see that in the terminal) but the second object changes its selection state. You can try with attached indicator. If you click on the text or label you can see in the terminal that this click belongs to the right object but the click changes selection state for the horizontal line at the same time. Can I avoid this selection/deselection on the horizontal line that is bellow clicked object? The solution to set the horizontal line unselectable (OBJPROP_SELECTABLE = false) is not applicable to me.
So far I deal with buffering all object state and check in OnChartEvent(). Maybe is there an easier solution?
The solution to set the horizontal line unselectable (OBJPROP_SELECTABLE = false) is not applicable to me.
Thank you for your effort but in the first post I wrote: