Canvas is cool! - page 45

 
I think I've figured out what the problem is. It's not at all what everyone thinks or z-strings. There's a surprise in there. If it works, I'll show you. If it doesn't work, I'll write too.
 

The z-order is also the point.

Let's do the following: put the indicator on the chart - the chart object "chart" will appear. We hook the indicator again and enter another number in the prefix parameter. Nothing will change because the second graphical object will be placed exactly on top of the first one.

Now do the following: before you start dragging the object, you should click on it. Just click and then hold down the left button and drag it. And so on: before dragging, you have to click on the object.

But it's complicated...

Files:
123.mq5  8 kb
 
Dmitry Fedoseev:

The z-order is also the point.

Let's do the following: put the indicator on the chart - the chart object "chart" will appear. We hook the indicator again and enter another number in the prefix parameter. Nothing will change because the second graphical object will be placed exactly on top of the first one.

Now do the following: before you start dragging the object, you should click on it. Just click and then hold down the left button and drag it. And so on: before dragging, you have to click on the object.

But it's complicated...

Thanks Dmitry, it works!!!

Another thing would be to draw the active object from above, is there such a possibility?

 
Sergey Chalyshev:

Thanks Dimitri, it works!!!

I would also like to draw the active object on top, is there such a possibility?

It's done through deletion and new creation, so you have to remember all the properties before deletion and set them after new creation.

There doesn't seem to be any other way to bring it forward. Or maybe there is?

Files:
123-2.mq5  10 kb
 
Dmitry Fedoseev:

This is done through deletion and new creation, so you have to remember all the properties before deletion and set them after new creation.

There doesn't seem to be any other way to move it forward. Or maybe there is?

Switch the object's visibility off and on

OBJ_NO_PERIODS ---> OBJ_ALL_PERIODS

 
Sergey Chalyshev:

A bit wrong, I must have asked the question wrongly.

It is not difficult to organise several windows in one programme (script, indicator).

I want to make an indicator that will show data in its own small window on a chart. This window can be placed comfortably in a chart, you can drag it with your mouse, resize the window with your mouse (it is desirable, but you can do it anyway). We have to run several indicators in the chart, each with its own parameters. I have not yet figured out how to make events of different indicators not to overlap and the indicator will react adequately to mouse events. I haven't decided which is better, simpler, canvas or objects. I can't use the standard Dialog library.

Sergey Chalyshev:

Why one window is hidden below the other and the other one is on top, can you fix it?

I added three lines of code and now when you grab the mouse window snapped to the top.

Files:
 
Artyom Trishkin:

Toggle object visibility off and on

OBJ_NO_PERIODS ---> OBJ_ALL_PERIODS

Yes, thank you, your option works

 
Nikolai Semko:

I've added three lines of code and now the window is at the topmost position when the mouse is grabbed.

I can't get the second indicator to run on the same chart. Sometimes it works, but when the coordinates of the objects coincide, they start moving synchronously when dragging.

 
Dmitry Fedoseev:

Now do this: before you start dragging an object, you have to click on it.

Brilliant! All the UX designers are silently ecstatic ))
 

Hello everyone! Happy New Year everyone!!!

I have a non-programmer question)... Created an indicator, based on the previously posted code here, that just changes the background colour of the chart, to a replaceable, seamless image, using Canvas. How can I send the created background to the background without including the "chart on top"?

It's just that I also have an EA panel, and, with the "graph on top" on, it's a mess)

I have not found the answer in the branch, and my knowledge is not enough to unscrew the code)... Can I take it to a personal note, so as not to clutter up the branch.

Reason: