i have an expert with some gui objects, buttons, editfields, arranged below a rectangle.
When the rectangle is dragged, all the objects in it are moved accordingly.
I run this on MetaTrader 4 as well as on MetaTrader 5.
The code is pretty similar, except some details.
Now the problem: On MetaTrader 4, it runs smooth.
On MetaTrader 5 not. It sometime takes seconds or even minutes,
before the gui objects within the rectangle, are moved to new position.
In both cases i had more or less the same number of charts opened, forex and
the same number of my rectangles attached.
The one, MT4 is fine, the other, MT5, not.
The code where all clients are moved, when the rectangle is moved is here:
ClientArray holds all gui object in the rectangle. MoveClients moves all client according their translation. This works fine on MT4 and when i attach 1 rectangle in MT5 and terminal not busy.
virtualvoidOnChartEvent(int id,long lp,double dp,string sp)
{
switch(id)
{
caseCHARTEVENT_KEYDOWN:
{
}break;
caseCHARTEVENT_MOUSE_MOVE:
{
if(sp == MOUSE_LB_BUTTON_DOWN_STR
&& ClientArray.mouse_in_object((int)lp,(int)dp) == false // mouse over one of the gui objects
&& mouse_in_object((int)lp,(int)dp) == true // mouse over rectanlge
)
{
MoveClients((int) lp,(int) dp,sp);
ChartRedraw();
}
}break;
caseCHARTEVENT_OBJECT_DRAG:
{
if(sp == name())
{
// save this positions and all client positions
SavePosition();
ChartRedraw();
}
}break;
}
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi community,
i have an expert with some gui objects, buttons, editfields, arranged below a rectangle.
When the rectangle is dragged, all the objects in it are moved accordingly.
I run this on MetaTrader 4 as well as on MetaTrader 5.
The code is pretty similar, except some details.
Now the problem: On MetaTrader 4, it runs smooth.
On MetaTrader 5 not. It sometime takes seconds or even minutes,
before the gui objects within the rectangle, are moved to new position.
In both cases i had more or less the same number of charts opened, forex and
the same number of my rectangles attached.
The one, MT4 is fine, the other, MT5, not.
The code where all clients are moved, when the rectangle is moved is here:
Any hint appreciated.