Discussion of article "MQL as a Markup Tool for the Graphical Interface of MQL Programs (Part 3). Form Designer"

MetaQuotes  

New article MQL as a Markup Tool for the Graphical Interface of MQL Programs (Part 3). Form Designer has been published:

In this paper, we are completing the description of our concept of building the window interface of MQL programs, using the structures of MQL. Specialized graphical editor will allow to interactively set up the layout that consists of the basic classes of the GUI elements and then export it into the MQL description to use it in your MQL project. The paper presents the internal design of the editor and a user guide. Source codes are attached.

Editor is designed for the classes of Standard Library interface elements. To create similar tools for other libraries, you will have to write the specific implementations of all abstract entities from the markup system proposed. At the same time, you should be guided by the implementation of markup classes for the Standard Library.

It should be noted that the "library of standard components" definition is not factually correct, since in the context of our preceding articles, we had to considerably modify it and place to the parallel version branch in the ControlsPlus folder. Herein, we are going to continue using and modifying it.

Let us list the types of elements to be suppported by the editor.

  • Containers CBox with horizontal (CBoxH) and vertical (CBoxV) orientation,
  • CButton,
  • CEdit input box,
  • CLabel,
  • SpinEditResizable,
  • CDatePicker calendar,
  • Drop-down list ComboBoxResizable,
  • List ListViewResizable,
  • CheckGroupResizable, and
  • RadioGroupResizable.

All classes ensure adaptive resizing (some standard types could do that at the beginning, while we had to make considerable changes for the other ones).

Editing the Form

Editing the Form

Author: Stanislav Korotky

Stanislav Korotky  
Guilherme Mendonca #:

Hi, 

I'm facing this kind of situation in one of my laptops.

Everything looks tiny except the text labels.

The value of "TerminalInfoInteger(TERMINAL_SCREEN_DPI)" is 192.

Do you know how to solve it? I thought the libraries will adjust automatically according of my screen settings.


Unfortunately I have no means to test it under different environments. The library is based on standard controls (with small fixes not related to dpi). So if it's screwed up somehow, this seems to be a common problem, not of the library.

But I think you should first check your Windows scale setting.

Stanislav Korotky  
Guilherme Mendonca #:

I'm facing this kind of situation in one of my laptops.

Just an idea - try to patch Defines.mqh to:

#define CONTROLS_FONT_SIZE                  (-10)

The minus sign is added.

Or another idea:

#define CONTROLS_FONT_SIZE                  ((int)(10.0 / (TerminalInfoInteger(TERMINAL_SCREEN_DPI) / 96.0)))
Let me know if either variant helps.