Errors, bugs, questions - page 2701

 
Slava:
What are the approximate coordinates of the first rectangle and the second rectangle? Are they the same?
The first rectangle is the substrate. It's just the background. It's all over the screen.
The second rectangle is the column. It is on the first rectangle.
I will try to show you everything tomorrow.
 
Slava:

It's not playing.

You haven't given any steps to reproduce

What did you do?

OK. One more time.

1. Create a graphical object, e.g. a rectangle. Create it by hand;

2. programmatically change its OBJPROP_ZORDER property to 1;

3. Get the nonsense I have described.

The code for changing the property by pressing a key looks like this.

if( lparam == KEY_Z )
{
//--- Получаем свойство приоритета клика
int zorder = (int)ObjectGetInteger( 0, _name, OBJPROP_ZORDER );
//--- Меняем свойство приоритета клика
zorder = ( zorder == 0 ) ? 1 : 0;
//--- Устанавливаем новое свойство приоритета
ObjectSetInteger( 0, _name, OBJPROP_ZORDER, zorder );
} 
The name of the _name object is preserved by selecting (clicking on) the object in the graph.
 
Alexey Kozitsyn:

What did you do?

OK. One more time.

1. Create a graphic object, e.g. a rectangle. Create it by hand;

2. programmatically change its OBJPROP_ZORDER property to 1;

3. Get the nonsense I have described.

The code of changing the property by pressing the key looks like this.

The object name _name is preserved by selecting (clicking on) the object in the graph.

I have created a horizontal line graphical object by hand.

Changed z-order from the script programmatically.

I see that the tooltip appears.


I have manually created a rectangle (a rectangle linked to prices and not OBJ_RECTANGLE_LABEL)

I have changed z-order from a similar script.

I see that the tooltip appears


So there is something you did not say

 
Slava:

Created a horizontal line graphical object by hand.

Changed the z-order from the script

I see that the tooltip appears.


I manually created a rectangle graphical object (a rectangle linked to prices - times, not OBJ_RECTANGLE_LABEL)

I have changed z-order from a similar script.

I see that the tooltip appears.


So there's something you didn't say.

Ok, double-check again.

On build 2361 did you check it?

It was updated.

Checked again. There is still a problem.

Try it like this: take my indicator, create a rectangle (which is OBJ_RECTANGLE) on TF M1. Click on it with your mouse, then press z several times. You will see in the log that the zorder has become -1, 0, 1. Then click on the chart past this rectangle. Then try to see its tooltip, highlight it.

It's probably a matter of setting the object zorder = -1. Before that I thought the problem was the value of 1. Apologies.

Files:
 
Alexey Kozitsyn:

Re-checked. The problem remains.

Try it this way:

Now mountain lines are created highlighted by default (no option to deselect by mouse click) + no highlighting of tooltips on any graph... Something is broken. There is no indicator on the chart anymore.

 
Alexey Kozitsyn:

OK, I'll double-check again.

Have you checked on build 2361?

Updated.

Double-checked. The problem remains.

Try it this way: take my indicator, create a rectangle (which is OBJ_RECTANGLE) on TF M1. Click on it with your mouse, then press z several times. You will see in the log that the zorder has become -1, 0, 1. Then click on the chart past this rectangle. Then try to see its tooltip, highlight it.

It's probably a matter of setting the object zorder = -1. Before that I thought the problem was with the value of 1.

Seems to be the problem with ChartRedraw(). Even better reproduce it when you hook rectangle to work and alternately press left button and z key on it. In this way, this object becomes "dead". If you create another rectangle later, it's fine.

 
Slava:

What do I do when I can't deselect the graph lines with the LKM? It gets in the way...

 
Alexey Kozitsyn:

It seems to be about ChartRedraw(). It plays even better when you hook a rectangle to work and alternately press the left button and the z key on it. In this way, this object becomes "dead". If you create another rectangle later, it's fine.

Here is my expert, on which I checked again

//+------------------------------------------------------------------+
//|                                                   TestZOrder.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

#define  OBJECT_NAME1 "RectangleLabel1"
#define  OBJECT_NAME2 "RectangleLabel2"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ObjectCreate(0,OBJECT_NAME1,OBJ_RECTANGLE_LABEL,0,0,0);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_XDISTANCE,100);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_YDISTANCE,100);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_XSIZE,300);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_YSIZE,200);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_BGCOLOR,clrNONE);
   ObjectSetInteger(0,OBJECT_NAME1,OBJPROP_BORDER_TYPE,BORDER_FLAT);
   ObjectSetString(0,OBJECT_NAME1,OBJPROP_TOOLTIP,OBJECT_NAME1);
//---
   ObjectCreate(0,OBJECT_NAME2,OBJ_RECTANGLE_LABEL,0,0,0);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_XDISTANCE,250);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_YDISTANCE,120);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_XSIZE,250);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_YSIZE,150);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_BGCOLOR,clrNONE);
   ObjectSetInteger(0,OBJECT_NAME2,OBJPROP_BORDER_TYPE,BORDER_FLAT);
   ObjectSetString(0,OBJECT_NAME2,OBJPROP_TOOLTIP,OBJECT_NAME2);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   ObjectDelete(0,OBJECT_NAME1);
   ObjectDelete(0,OBJECT_NAME2);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      long zorder=ObjectGetInteger(0,sparam,OBJPROP_ZORDER);
      PrintFormat("%s object clicked  lparam=%I64d  dparam=%.16g  zorder=%I64d",sparam,lparam,dparam,zorder);
      zorder=1-zorder;
      ObjectSetInteger(0,sparam,OBJPROP_ZORDER,zorder);
      zorder=ObjectGetInteger(0,sparam,OBJPROP_ZORDER);
      PrintFormat("%s zorder set to %I64d",sparam,zorder);
     }
  }
//+------------------------------------------------------------------+

Everything is normal, the tooltips are displayed according to zorder

 
Alexey Kozitsyn:

What do I do when I can't deselect the graph lines with the LKM? It interferes with...

What do you mean you can't?

Give me the details!

 
Slava:

What do you mean, you can't?

Give me the details!

Duck... here... I was experimenting with the indicator from the previous post. And... something broke. It is so that now when you create a mountain line, it is selected, and this selection can not be removed by double-clicking on the line with the mouse. I can't shut up - the selection cannot be removed. On any graph, even an empty one.