Discussion of article "DoEasy. Controls (Part 17): Cropping invisible object parts, auxiliary arrow buttons WinForms objects"
- www.mql5.com
I needed to create an interface, but there was not a single library with well worked out events, correct window management in terms of their mutual location, overlaps and scope restrictions. If somewhere there were the above things with varying degrees of elaboration, there were problems with creating, deleting windows and changing properties at an arbitrary point in time.
This should all be the backbone of GUIs. Why they immediately start doing "drawing" is not clear.
I made some small changes to the source code of the current article in the Expert Advisor:
//--- Создадим объект WinForms Panel for(int i1=0; i1<2; i1++) { CPanel *pnl=NULL; pnl=engine.CreateWFPanel("WFPanel"+string(i1),50,50,410,200,array_clr,200,true,true,false,-1,FRAME_STYLE_BEVEL,true,false); ... }
I played a little with the panels, the result is as follows:
Switching the window to the foreground occurs when the mouse is clicked, although it should be when you click.
Receiving events occurs through the indicator, probably for the tester was made, without it events do not work, in the tester too, even when loading the indicator through the template....
I needed to create an interface, but there was not a single library with well worked out events, correct window management in terms of their mutual location, overlaps and scope restrictions. If somewhere there were the above things with varying degrees of elaboration, there were problems with creating, deleting windows and changing properties at an arbitrary point in time.
This should all be the backbone of GUIs. Why they start doing "drawing" right away is not clear.
I made some minor changes to the source code of the current article in the Expert Advisor:
I played a little with the panels, the result is as follows:
The window is switched to the foreground when the mouse is pressed, although it should be pressed.
Receiving events is done through the indicator, probably for the tester, without it the events do not work, in the tester too, even when loading the indicator through the template....
What are the events from other charts for?
I clicked on my visual application, your Expert Advisor is running in parallel, and this is written in the logs:
2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) Графическая метка "1716653226_u_0": ID 10001, 2022.09.10 22:16:34 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Состояние кнопки: Отжата 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Изменено свойство графического объекта: 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) Графическая метка "1716653226_u_0": ID 10001, 2022.09.10 22:16:34 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Имя BMP-файла: 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) - Состояние "On" [0]: "\Experts\Greshnik\Strategy_viewer.ex5::1716653226_u_012896816886410156413404032" 2022.09.10 22:18:36.256 TestDoEasy117 (AUDUSD,M1) - Состояние "Off" [1]: Отсутствует 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) CGStdGraphObj::PropertiesCheckChanged: Создан снимок истории изменений графического объекта #19: 2022.09.09 23:54:59.875 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Изменено свойство графического объекта: 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) Графическая метка "1716653226_u_0": ID 10001, 2022.09.10 22:16:34 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Время создания: 2022.09.10 22:18:38 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Изменено свойство графического объекта: 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) Графическая метка "1716653226_u_0": ID 10001, 2022.09.10 22:16:34 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) OnChartEvent: Имя BMP-файла: 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) - Состояние "On" [0]: "\Experts\Greshnik\Strategy_viewer.ex5::1716653226_u_012896816886410156413395097" 2022.09.10 22:18:38.291 TestDoEasy117 (AUDUSD,M1) - Состояние "Off" [1]: Отсутствует 2022.09.10 22:18:38.959 TestDoEasy117 (AUDUSD,M1) CGStdGraphObj::PropertiesCheckChanged: Создан снимок истории изменений графического объекта #20: 2022.09.09 23:54:59.875
I don't understand the purpose of this.
It is very slow to count. What will happen to the table with a large number of cells?
Measuring the speed of updating graphical objects:
//--- Handling events of a collection of graphic items ulong mcs=GetMicrosecondCount(); engine.GetGraphicObjCollection().OnChartEvent(id,lparam,dparam,sparam); Print((GetMicrosecondCount()-mcs)/1000.0);
Left mouse click on the centre of the panel: 5ms
Clicking on the header of an active tab: 7 ms.
Clicking on the header of an inactive tab: 20 ms
What are the events from the other charts for?
I clicked my visual application, your Expert Advisor is running in parallel, the logs show this:
I don't understand the purpose of this.
It is very slow to count. What will happen to the table with a large number of cells?
Measuring the speed of updating graphic objects:
Left mouse click on the centre of the panel: 5 ms
Clicking on the active tab header: 7 ms
Click on the header of an inactive tab: 20 ms
The library scans the entire environment and outputs messages about logged events. At the moment these are just debugging messages - the library is under development. When it is fully functional, there will be a choice of what is needed and what is not needed.
Thank you, Anatoly, for your feedback. Of course, everything will be finalised.
The minimum needs are covered with EasyAndFastGUI. Maybe release the latest version in the marketplace for a small fee, as there is not much time for free support.
As it is, this topic can be developed endlessly. There are so many different options, where this could all lead to, that it's fantastic. )
We'll come back to this issue again. Very busy for now. Keep up the good work, it's very exciting! 👍
I have my minimum needs covered with EasyAndFastGUI. Probably release the latest version in the marketplace for a small fee, as there is not much time for free support.
As it is, this topic can be developed endlessly. There are so many different options, where this could all lead to, that it's fantastic. )
We'll come back to this question again. Very busy for now. Keep up the good work, it's very exciting! 👍
Dobro 👌
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use


New article DoEasy. Controls (Part 17): Cropping invisible object parts, auxiliary arrow buttons WinForms objects has been published:
In this article, I will create the functionality for hiding object sections located beyond their containers. Besides, I will create auxiliary arrow button objects to be used as part of other WinForms objects.
Compile the EA and launch it on the chart:
Cropping areas that go beyond the visibility scope works correctly, headers that go beyond the container are cropped along its edge, and if we set the coordinates of the TabControl so that the element goes beyond the container on the left, then everything is cropped correctly here, too - the element itself is cropped along the edges of the panel, and buttons located on the control are also cropped by the edge of the panel visibility scope, rather than their containers. Everything works correctly here. Horizontal left-right buttons have a width that is smaller than the default one (9 pixels). Despite this, they are displayed correctly.
What needs to be fixed? The shadow object appears before the panel that casts it. I will deal with this later.
Author: Artyom Trishkin