Discussing the article: "The View and Controller components for tables in the MQL5 MVC paradigm: Simple controls"

 

Check out the new article: The View and Controller components for tables in the MQL5 MVC paradigm: Simple controls.

The article covers simple controls as components of more complex graphical elements of the View component within the framework of table implementation in the MVC (Model-View-Controller) paradigm. The basic functionality of the Controller is implemented for interaction of elements with the user and with each other. This is the second article on the View component and the fourth one in a series of articles on creating tables for the MetaTrader 5 client terminal.

Today we will start developing simple controls, from which composite elements will further be created. Each control element will possess functionality for interaction with the user and with other elements. In other words, this is nothing more than the functionality of the Controller component.

Since in the MQL language the event model is integrated into objects created using chart events, event handling will be organized in all subsequent controls to implement the connection between the View component and the Controller component. To do this, refine the base class of graphic elements.

Next, create simple controls — a text label and various buttons. Each of these elements will have the feature to draw icons. This will make it possible to create completely different controls from simple buttons. If you look at the string of the tree view, where an icon is on the left and text is on the right, then this seems to be a separate control. But we will be able to easily create it using a regular button. At the same time, it will be possible to adjust the string parameters so that it either reacts by changing the color when the mouse cursor is focused on and clicked, or it is static, but reacts to clicks.

All this will be easy to implement with a few strings of object settings after its creation. And from such elements, we will continue to create complex composite controls that are fully interactive and ready to use.


Author: Artyom Trishkin