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

 

Why when implementing:

//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) {
   if(CHARTEVENT_CHART_CHANGE) Alert("Event start, size window = "+ChartWidthInPixels());
}

the terminal reacts not only to the resizing of the chart, but also to any movement of the mouse?

 
Barbarian:

Why when implementing:

terminal reacts not only to chart resizing, but also to any mouse movement?


Most likely it's designed that way, check if you can get real-time mouse coordinates as well as click position...

It has been noticed that if the terminal is in the background and any other software is in the foreground, the terminal still receives information from the mouse when hovering the mouse over the terminal chart in the background ....

 
VOLDEMAR:


Most likely it's designed that way, check if you can get mouse coordinates and clicks in real time...

It was noticed that if terminal is on the second background and any other software is on the first one, then when hovering mouse on terminal chart in the background, terminal still receives information from mouse .....

Yes, but it's specified in the help:

Mouse move and mouse click (if CHART_EVENT_MOUSE_MOVE=true property of the chart)

I have this property set to false. How can I disable the mouse response? I only need to resize the chart.
 
Barbarian:

Why when implementing:

the terminal reacts not only to the resizing of the chart, but also to any movement of the mouse?


It should be like this:

//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) {
   if(id==CHARTEVENT_CHART_CHANGE) Alert("Event start, size window = "+ChartWidthInPixels());
}
 
Wahoo:


It has to be:

Thank you, it's working as it should :)
 
Somebody give me an answer to the post https://www.mql5.com/ru/forum/147679/page152#888374
 
VOLDEMAR:
Somebody give me an answer to the post https://www.mql5.com/ru/forum/147679/page152#888374

I use CCanvas - less writing and easier to work with (copying, creating arrays, etc).

How to work with the basic graphical API can be understood by analysing the example from the manufacturer - the same CCanvas class in the standard library.

The example of CCanvas (and not only) is included in the trailer. // Example almost unchanged from five.

Files:
 
MetaDriver:

I use CCanvas - less writing and easier to work with (copying, creating arrays, etc.).

How to work with the basic graphical API can be understood by analysing the example from the manufacturer - the same CCanvas class in the standard library.

An example of CCanvas (and not only) is included in the trailer. // Example is almost unchanged, adopted from Five.

I don't think it's quite right to do it that way:

CCanvas * Label;

int OnInit() {
   Label = new CCanvas();
   //некий код
}
void DeInit() {
   delete Label;
}
Maybe that's the right thing to do:
CCanvas * Label = new CCanvas();

int OnInit() {
   //некий код
}
void DeInit() {
   delete Label;
}
 
Barbarian:

I don't think that's the right thing to do:

Maybe this is the right way to do it:
Both are correct.
 
VOLDEMAR:
Somebody give me an answer to the post https://www.mql5.com/ru/forum/147679/page152#888374

The text has to be created separately. On top of the label. Or you can use Button object, where text can be set at once.