Download MetaTrader 5

Object seletion state after a click

To add comments, please log in or register
Petr Nosek
373
Petr Nosek  

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? 

Files:
Click.mq4 3 kb
Alain Verleyen
Moderator
35119
Alain Verleyen  
Actually MT5/mql5 doesn't work the same way.
Petr Nosek
373
Petr Nosek  
Alain Verleyen:
Actually MT5/mql5 doesn't work the same way.
Thank you for your reply. I've edited my first post and I would like you to move the topic into the MQL4 thread.
SanjayBalraj
48
SanjayBalraj  
Petr Nosek:

The solution to set the horizontal line unselectable (OBJPROP_SELECTABLE = false) is not applicable to me.

This is the solution. Make event object selectable and selected and all remaining objects !selected and !selectable.
Petr Nosek
373
Petr Nosek  
SanjayBalraj:
This is the solution. Make event object selectable and selected and all remaining objects !selected and !selectable.

Thank you for your effort but in the first post I wrote:

The solution to set the horizontal line unselectable (OBJPROP_SELECTABLE = false) is not applicable to me.

To add comments, please log in or register