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

 

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

In the article, we will add the functionality of resizing controls by dragging edges and corners of the element with the mouse.

In modern user interfaces, a feature to resize elements with the mouse is a familiar and expected one. The user can "grab" the border of a window, panel, or other visual block and drag it, resizing the element in real time. Such interactivity requires a well-thought-out architecture to ensure responsiveness and correct handling of all events.

One of the popular architectural approaches for building complex interfaces is MVC (Model-View-Controller). In this paradigm:

  • Model is responsible for data and logic,
  • View is responsible for displaying data and visual interaction with the user,
  • Controller is responsible for handling user events and communication between the Model and the View.

The View and Controller components for tables in the MQL5 MVC paradigm

Within the context of resizing elements with the mouse, the main work takes place precisely at the level of the View component. It implements a visual representation of the element, tracks mouse movements, determines whether the cursor is on the boundary, and displays appropriate tooltips (for example, changing the cursor shape). The component is also responsible for rendering the resized element during the resizing process when being dragged.


Author: Artyom Trishkin