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

 

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

 
That's very good!
Congratulations!

It's amazing how MT5 it's getting better and better with the passing time.
In the near future I think anyone will be capable to build and set up any graphic interface wich will attend your nees.  
 
New example of a program with GUI built by declarative MQL layout design is published in the codebase - ChartBrowser.
ChartBrowser
ChartBrowser
  • www.mql5.com
This is an utility which allows you to list all open charts, indicators, expert advisers, and scripts in alphabetic order, and switch between them.
 

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.


 
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.

 
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.
 

Hello,

first of all thanks a lot for your fantastic articles!

I'm trying to port the code back to MQL 4, as the Standard Control library exists there, too.
But I'm stuck at getting GroupTemplate.mqh to work with the following errors:

Errors

Should it be possible to port this to MQL 4, or is this functionality of calling methods on the template type only available in MQL 5?

Any help is greatly appreciated,
best regards

Holger

 
Holger David Julian Krause #:

Hello,

first of all thanks a lot for your fantastic articles!

I'm trying to port the code back to MQL 4, as the Standard Control library exists there, too.
But I'm stuck at getting GroupTemplate.mqh to work with the following errors:



Should it be possible to port this to MQL 4, or is this functionality of calling methods on the template type only available in MQL 5?

Any help is greatly appreciated,
best regards

Holger

I'm afraid MQL5 is significantly updated in many aspects against MQL4, so these templates are not portable backwards without complete re-work.

 
Stanislav Korotky #:

I'm afraid MQL5 is significantly updated in many aspects against MQL4, so these templates are not portable backwards without complete re-work.

Ok, thanks for the clarification!