Discussion of article "How to create a graphical panel of any complexity level"

 

New article How to create a graphical panel of any complexity level has been published:

The article provides a detailed explanation of how to create a panel on the basis of the CAppDialog class and how to add controls to the panel. It includes the description of the panel structure and a scheme of the inheritance of objects. From this article, you will also learn how events are handled and how they are delivered to dependent controls. Additional examples show how to edit panel parameters, such as the size and the background color.

Objects from the Panels and Dialogs section of the Standard Library are created and applied in the following order: A "Border" object is created first, inside it the panel background is added as a "Back" object. Then the client area "ClientBack" is applied over the background. Child controls can be added inside the client area. The "Caption" object with the name of the panel and two control buttons are added to the upper part of the panel.

Graphical controls on the AppWindow panel


Author: Vladimir Karputov

 
MetaQuotes Software Corp.:

New article How to create a graphical panel of any complexity level has been published:

Author: Vladimir Karputov

Great introduction! Thank you
 

This is a really good article. I like it a lot. Very well written.


Thank you!

 
The class would be great but it can not be used for applications as is because the panels look good only when the windows dpi scaling is set to 1. 
So, the application may look good on your screen but may not on others.
 

A great article.

Thank you Vladimir Karputov !

 

Hi Vladimir,

thx for this article...

Who (or what class) is actually using the defined constants, e.g. CONTROLS_BUTTON_COLOR_BG

I could not find any code having access to these constants. So there is still a huge piece of the big picture that I don't fully understand.

 
Ivan Petkow :

Hi Vladimir,

thx for this article...

Who (or what class) is actually using the defined constants, e.g.  CONTROLS_BUTTON_COLOR_BG

I could not find any code having access to these constants. So there is still a huge piece of the big picture that I don't fully understand.

I searched the word "CONTROLS_BUTTON_COLOR_BG" in the MetaEditor editor:

I found 26 entries!

 
Vladimir Karputov:

I searched the word "CONTROLS_BUTTON_COLOR_BG" in the MetaEditor editor:

I found 26 entries!

Searching in the MetaEditor helped me already a bit further: at least I have found what I initially searched for. The constant is used in the CButton constructor.

But what really confuses me now is the fact, that I have found only 2 entries (instead of >20 like you did):

....MQL5\Include\Controls\Button.mqh (line 54)

....MQL5\Include\Controls\Defines.mqh (line 58)


Is there any source code outside of the path C:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\XXXXXXXXXXXXXXXXXXXXXX\MQL5\

where I searched in all *.mq5;*.mqh files?


 
Ivan Petkow :

Searching in the MetaEditor helped me already a bit further: at least I have found what I initially searched for. The constant is used in the CButton constructor.

But what really confuses me now is the fact, that I have found only 2 entries (instead of >20 like you did):

....MQL5\Include\Controls\Button.mqh (line 54)

....MQL5\Include\Controls\Defines.mqh (line 58)


Is there any source code outside of the path C:\Users\xxx\AppData\Roaming\MetaQuotes\Terminal\XXXXXXXXXXXXXXXXXXXXXX\MQL5\

where I searched in all *.mq5;*.mqh files?


Yes, my search results (more than 20) are my projects. In system files "CONTROLS_BUTTON_COLOR_BG" is found in MQL5\Include\Controls\Button.mqh

 //+------------------------------------------------------------------+ 
 //| Constructor                                                      | 
 //+------------------------------------------------------------------+ 
CButton::CButton( void )
  {
   m_color           =CONTROLS_BUTTON_COLOR;
    m_color_background=CONTROLS_BUTTON_COLOR_BG; 
   m_color_border    =CONTROLS_BUTTON_COLOR_BORDER;
  }

and in MQL5\Include\Controls\Defines.mqh

 //--- Button 
 #define  CONTROLS_BUTTON_COLOR               C'0x3B,0x29,0x28' 
 #define  CONTROLS_BUTTON_COLOR_BG             C'0xDD,0xE2,0xEB' 
 #define  CONTROLS_BUTTON_COLOR_BORDER         C'0xB2,0xC3,0xCF' 
 
Vladimir Karputov:

Yes, my search results (more than 20) are my projects. In system files "CONTROLS_BUTTON_COLOR_BG" is found in MQL5\Include\Controls\Button.mqh

and in MQL5\Include\Controls\Defines.mqh

OK, this matches with what I observed...

Thank you for confirmation and your precious time. 

 

Thanks A LOT for this article!


I was struggling with UI elements for a while... Searching through the MQL site I only found totally Rocket Science articles where you have OO objects needed to be used and instantiated as another complex OO objects! Totally insane!

The main goal of OO Classes is to be accessible, bring you totally clean code and reduce the number of lines/errors/iterations...

I know... there are several limitations with this implementation/approach, but for beginners, it is a huge STEP FORWARD to have something real implemented right away!

Congratulations on this Super Cool Article!


;)

Reason: