Download MetaTrader 5
To add comments, please log in or register
Join MQL5 Cloud Network affiliate program and make money!
metbright
101
metbright 2014.04.27 20:02 

I'm using rectangle label as background and have a button above, when I click the button the parameter return rectangle label not the button.

I set z_order of button to 10 but I still can't click the button.

Please help.

Thanks.

Keith Watford
Moderator
7983
Keith Watford 2014.04.27 20:38  

Have you tried OBJPROP_SELECTABLE as false for the label?

Just a suggestion, I don't know if it will solve your problem or not.

metbright
101
metbright 2014.04.28 05:24  
GumRai:

Have you tried OBJPROP_SELECTABLE as false for the label?

Just a suggestion, I don't know if it will solve your problem or not.

Yes I have. didn't work.
qjol
3243
qjol 2014.04.28 05:41  
what about OBJPROP_ZORDER
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.28 05:44  
qjol:
what about OBJPROP_ZORDER

He said " I set z_order of button to 10 but I still can't click the button. "

qjol
3243
qjol 2014.04.28 05:55  

sorry i didn't notice

can you please show the relevant code (using SRC)

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.28 06:15  
Yes. I think it is just common coding mistakes.
Ovo Cz
2952
Ovo Cz 2014.04.28 07:13  
deysmacro:
Yes. I think it is just common coding mistakes.

So did the z_order ever work for you? It did not for me, but I haven't tried it recently.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.28 07:47  
I don't use zorder. How bout showing us your code? We can point to you where the culprit is.
Ovo Cz
2952
Ovo Cz 2014.04.28 08:28  
deysmacro:
I don't use zorder. How bout showing us your code? We can point to you where the culprit is.

The problem is that the z-order does nothing and that the mouse event is caught by a different object than the one rendered on the top. Not sure, how you could read this from my code, you must try it and watch.
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.28 08:54  

I never used z-order and never intend to since all my objects works according to my wish.


Instead of using button and rectangle, remove the rectangle and see if the click happens or not. Set the z-order to defaults while you at it.

And if you insist on using rectangle, the code for object rectangle must be before the code for object button. Not the other way round. That way, the terminal will draw rectangle first and then button on top of rectangle.


If you say it is not working, I will not say anything until the code of yours is here.

/ /12
To add comments, please log in or register