MetaTrader 4 Build 529 beta released with new compiler - page 114

 

Bild 557.

OBJ_LABEL moves to the centre when it is set from the function, once it is highlighted it moves to the right side and partially overlaps the chart window. The binding is at the upper right corner. Function:

//+-------------------------------------------------------------------------------------------------+
//|  Параметры:                                                                            |
//|    nm - наименование объекта                                                 |
//|    tx - текст                                                                              |
//|    cl - цвет метки                                                                     |
//|    xd - координата X в пикселах                                              |
//|    yd - координата Y в пикселах                                              |
//|    cr - номер угла привязки (0 - левый верхний )                   |
//|                                               1 - правый верхний                   |
//|                                               2 - левый нижний                       |
//|                                               3 - правый нижний )                   |
//|    fs - размер шрифта             (9 - по умолчанию  )                   |
//+-------------------------------------------------------------------------------------------------+
void SetLabel(string nm, string tx, color cl, int xd, int yd, int cr=0, int fs=9) {
   if(ObjectFind(nm)<0) ObjectCreate(nm, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(nm, tx, fs, "Arial");
   ObjectSet(nm, OBJPROP_COLOR    , cl);
   ObjectSet(nm, OBJPROP_XDISTANCE, xd);
   ObjectSet(nm, OBJPROP_YDISTANCE, yd);
   ObjectSet(nm, OBJPROP_CORNER   , cr);
   ObjectSet(nm, OBJPROP_FONTSIZE , fs);
}

This function is called:

SetLabel("mf_metka",StringConcatenate("б/у Buy : ", DoubleToStr(urtpbuy,Digits)," Sell : ", DoubleToStr(urtpsell,Digits)), PaleGoldenrod, 30, 25, 1, 8);

In previous versions of build 554 and older, everything worked as it should, there were no jumps to the centre and then to the right outside the boundaries of the chart window, everything was bound to the boundaries which were specified.

 

Incorrect behaviour of text objects in the subwindow reproduced. We will correct it.

Please wait.

 
artmedia70:

Now I'm just going to click on them and they'll all be in their places:


Thank you. Reproduced and corrected
 
In the 557th build, all OBJ_EDIT coordinates have moved off by 1 pixel at both coordinates. The objects were exactly spaced, now they are all shifted a bit to the right and lower.
Also, it is impossible to move OBJ_LABEL programmatically. This function from 5 worked fine in 555, I didn't change my code.

//+------------------------------------------------------------------+
//| Перемещает текстовую метку             |
//+------------------------------------------------------------------+
bool LabelMove(const long   chart_ID=0,   // ID графика
               const string name="Label", // имя метки
               const int    x=0,          // координата по оси X
               const int    y=0)          // координата по оси Y
  {
//--- сбросим значение ошибки
   ResetLastError();
//--- переместим текстовую метку 
   if(!ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x))
     {
      Print(__FUNCTION__,
            ": не удалось переместить X-координату метки! Код ошибки = ",GetLastError());
      return(false);
     }
   if(!ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y))
     {
      Print(__FUNCTION__,
            ": не удалось переместить Y-координату метки! Код ошибки = ",GetLastError());
      return(false);
     }
//--- успешное выполнение
   return(true);
  }
//+------------------------------------------------------------------+

similar function works for buttons, not for OBJ_LABEL.

 

I have the same problems with objects as Barbarian, using the same function for OBJ_LABEL. I wrote about it here yesterday morning. I feel like the origin is outside the visible graph, not on the edge of the graph, but on the edge of the window. If you display OBJ_LABEL with coordinates +1 from the lower right corner, everything will be fine. The objects at the upper edge of the chart also disappear, they must go up. If you enlarge the chart to the full screen, the OBJ_LABEL will not shift, but will be in the centre. Well Barbarian already described it, but it's unclear if you fixed it or what.

 
pro_:

I have the same problems with objects as Barbarian, using the same function for OBJ_LABEL. I wrote about it here yesterday morning. I feel like the origin is outside the visible graph, not on the edge of the graph, but on the edge of the window. If you display OBJ_LABEL with coordinates +1 from the lower right corner, everything will be fine. The objects at the upper edge of the chart also disappear, they must go up. If you enlarge the chart to the full screen, the OBJ_LABEL will not shift, but will be in the centre. Well Barbarian already described it, but it is unclear whether you fixed it or what.


I have the same thing. Bild 557, just updated it. I have an EA with a lot of information displayed on the screen, now the chart is just chaos.

The entire text(OBJ_LABEL) has a life of its own. And it is not clear how the coordinates are selected, it feels as if randomly, which is interesting when you select jump, but not in their place.

Everything was fine in build 555.

 
When working with a flash drive, i.e. everything on the flash drive, all accounts are constantly reset ....
 

Along with the old, Four-style control of graphical objects, we're doing a Five-style object control.

Unfortunately, it's not without its bugs. Fortunately, a lot of bugs have been fixed.

 
stringo:

Along with the old four, we're doing a five-style object management.

Unfortunately, it's not without bugs

.

Fortunately, a lot of bugs have already been fixed.


It's all clear. No one, I think, expects everything to go completely error free. It's just that when something that works well in 555 becomes worse in 556 or doesn't work at all in 557, you get indignant voices (mine including). But it's OK. I've fixed the buttons, thank you. However, the rendering of objects is still by name, not by call order.
 

Yesterday I struggled with the bmp picture and failed to load it onto the chart, and I don't know if this point works or not yet ...

#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property  strict
string label_name="ted";
string euro ="\\Images\\button_grey_play.bmp";

//+------------------------------------------------------------------+
void OnTick()
  {
         //--- попробуем создать объект OBJ_BITMAP_LABEL
         ObjectCreate(label_name,OBJ_BITMAP_LABEL ,0,0,0);
         ObjectSet   (label_name,OBJPROP_CORNER   ,0    );
         ObjectSet   (label_name,OBJPROP_XDISTANCE,20  );
         ObjectSet   (label_name,OBJPROP_YDISTANCE,20   );
         ObjectSet   (label_name,OBJPROP_BMPFILE  ,euro );
  }