Discussing the article: "The View component for tables in the MQL5 MVC paradigm: Base graphical element"

 

Check out the new article: The View component for tables in the MQL5 MVC paradigm: Base graphical element.

The article covers the process of developing a base graphical element for the View component as part of the implementation of tables in the MVC (Model-View-Controller) paradigm in MQL5. This is the first article on the View component and the third one in a series of articles on creating tables for the MetaTrader 5 client terminal.

Here, we will not consider integration with the already created Model component. Moreover, with the Controller component that has not yet been created, but we will design the classes under development taking into account future integration. This will further make it easy to link visual elements with data and control logic, ensuring full interaction within the framework of the MVC paradigm. As a result, we get a flexible tool for creating tables and other graphical elements to be used in our projects.

Since the implementation of architecture of the View component in MQL5 is quite time-consuming, including many auxiliary classes and inheritances, let us agree on a fairly brief summary. Define a class, provide a brief description of it, and then, again briefly, consider its implementation. Today, we have five such classes:

  1. a base class for all the graphical objects,
  2. a class for color management,
  3. a class for managing the colors of various states of a graphic element,
  4. rectangular area control class,
  5. a base class for drawing graphic elements on canvas.

In the end, all these classes are necessary for the base class to draw graphic elements. All other classes that will be created when implementing various controls, in particular, the Table Control, will inherit from it.


Author: Artyom Trishkin