Problem: How do I disable mouse click on Text-Labels ?

 

Hello !

I gooogled this question without much luck.

I have an indicator that places text below SL & TP lines that when dragged modify the relevant values.

Sometimes the text is accidentally clicked and dragged instead of the line.

I am look for a means to disable the text from responding to left mouse clicks or any means that prevents the text from being dragged.

Any solutions much appreciated. Thanks in advance.

 

No way, all objects can be modified.

I wouldn't ever look at the position of the label, only the position of the line. In fact I wouldn't even have the label just add some text to the line (ObjectSetText)

 
file45:

Hello !

I gooogled this question without much luck.

I have an indicator that places text below SL & TP lines that when dragged modify the relevant values.

Sometimes the text is accidentally clicked and dragged instead of the line.

I am look for a means to disable the text from responding to left mouse clicks or any means that prevents the text from being dragged.

Any solutions much appreciated. Thanks in advance.

Well it is a hell of a bodge, but you could move the text label back to where you want it on every tick :-)
 
WHRoeder:

No way, all objects can be modified.

I wouldn't ever look at the position of the label, only the position of the line. In fact I wouldn't even have the label just add some text to the line (ObjectSetText)

ObjectSetTexr() is in place and the following can place the text as far right or left as need be.

ObjectSetText(Buyx_SLx, gap1 + StringSubstr(Buy_SL,0,xx) + gap2 + "#" + OrderTicket() + " * " + text + Npips, Order_Font_Size,FontName, theColor);

ObjectMove(Buyx_SLx,0,Time[0]+Period()*Shift_Text_Left_or_Right*50, price);

I have an indicator that places text below SL & TP lines that when dragged modify the relevant values.

Sometimes the text is accidentally clicked and dragged instead of the line.

I am look for a means to disable the text from responding to left mouse clicks or any means that prevents the text from being dragged.