Cannot make Z-Orders work
-
I try to draw buttons above lines, for aesthetic reasons:

I picked this configuration for the lines:

And for buttons:

The Z-Order for buttons is higher than the Z-Order for lines, but lines still appear above them. If i put lines on the "background" they appear to be behind the buttons, but are also placed behind the bars!
-
what I think, z-order in mql is meaning not for "visible order" but for selectable order, that means when you have object at deepest bottom with highest z-number, and obove are next objects with lower z-numbers, when you come with mouse above and select object - first object which is selected is one with highest z-number ...
--- and objects order is based on time when they were created, it means at top of objects is last created object, not object with highest z-number ...
... when you will have object as top, you need re-create it
-
@miro1360 said in Cannot make Z-Orders work:
what I think, z-order in mql is meaning not for "visible order" but for selectable order, that means when you have object at deepest bottom with highest z-number, and obove are next objects with lower z-numbers, when you come with mouse above and select object - first object which is selected is one with highest z-number ...
--- and objects order is based on time when they were created, it means at top of objects is last created object, not object with highest z-number ...
... when you will have object as top, you need re-create it
Thanks a lot miro, that is a lot clear now.
-
Maybe I am wrong. I know what z-order is in the world of websites, but in MQL4 probally means something else. So let's see what they say in the documentation:
https://www.mql5.com/en/docs/constants/objectconstants/enum_object_property#enum_object_property_integerPriority of a graphical object for receiving events of clicking on a chart (CHARTEVENT_CLICK). The default zero value is set when creating an object; the priority can be increased if necessary. When objects are placed one atop another, only one of them with the highest priority will receive the CHARTEVENT_CLICK event.
And how to make one object to appear above another... I don't know really, maybe the name matters