Discussion of article "Graphical Interfaces XI: Rendered controls (build 14.2)" - page 3

 
Artyom Trishkin:

Tol, in which of the articles in this series can you read about CKeys ?

...

I.e.: I start a programme and start pressing Backspace - all controls are deleted with each Backspace press, starting from the last one added. Eventually, the already empty form-window is also deleted.

...


GUIs X: Multiline text input field element (build 8)

Could not reproduce the situation when pressing Backspace key deletes GUI elements.

 
Artyom Trishkin:

If you write one line in Program.mqh in TestLibrary14 - change of window title colour:

Then minimising the window returns the colour to the default value. And the tooltips, minimise/unmodify and close buttons are repainted in the window title colour that was programmatically set. And then the colour of these buttons changes to the default colour only when the cursor is hovered over.

...

I forgot to add changing the form title colour on mouseover. It will be in one of the next updates.

Right now the colour needs to be set for both states:

...
   m_window.CaptionColor(clrDimGray);
   m_window.CaptionColorHover(clrDimGray);
...

//---

For buttons, the colour can be set via their pointers and after form creation.

...
   m_window.GetCollapseButtonPointer().BackColorHover(clrGray);
   m_window.GetTooltipButtonPointer().BackColorHover(clrGray);
//---
   m_window.GetCollapseButtonPointer().BackColorPressed(clrGray);
   m_window.GetTooltipButtonPointer().BackColorPressed(clrGray);
...

//---


 

In my opinion, the term "library core" used in the article is not quite correct. The term "library engine" was used earlier, but it doesn't quite fit.

The term "core" should refer to a static array that combines all the necessary information, and the term "engine" should refer to a mechanism that works with this information and implements a set of tasks.

The term "library" in programming means a diverse, disparate and independent functionality that serves as a toolkit for solving a set of tasks and is not united around a single centre. This toolkit is neither an "engine" nor a "kernel", but only a set of tools for building user mechanisms.

If a library contains a kernel and an engine, it is no longer a library, but a system working as a whole.

The transformation of a graphical library into an integral mechanism for creating GUI is a natural stage of development, after which the library as such will no longer exist. That is, there will be no need for disparate functionality, because a ready-made mechanism solves a set of tasks much more efficiently.

Perhaps now the library is turning into such a mechanism, but at the moment it has not happened yet. Therefore, the terms "core" and "engine" of the library are not quite correct.

imho.

 

Hi, The set of controls is really nice and helpful, but it would be even better if you can handle higher DPI setting in a better way.

Obviously, the bitmaps will display correctly, but the text does not. It gets shifted down and clipped as shown on the image below:

I use the following display settings :


 
Artur Zas:

Hi, The set of controls is really nice and helpful, but it would be even better if you can handle higher DPI setting in a better way.

Obviously, the bitmaps will display correctly, but the text does not. It gets shifted down and clipped as shown on the image below:

I use the following display settings :


 
Facundo Laje:
Hi, could.it be used with MT4?

 
Facundo Laje:
Hi, could.it be used with MT4?

Technically speaking it should as OBJ-BITMAP_LABEL is also available in MQL4, but you would need to adjust the library code as there are a few places where the code will just not compile using the MQL4 compiler.

I'll try to play around with the library and I'll let you know, if I'm able to somehow port it to MQL4. You can also try by yourself. Just rename the example EA's .mq5 extension to .mq4 and try to compile the code.

Obviously, you will get compilation errors however you can check where and what they are. 

 

Hi,

I'm trying to develop my own control panel following this article series... I'm interested in the multi-windows mode part(Article04) but I used the updated Library14(Article10).

What I got so far(in the attached pics):


image1

image2

What did I missed because  the window2 and window3 are not moving, not closing when hit the close buttons and colapse button it's missing..

Here is the code parts of windows 2 and 3:

 

//-------- Window2-------
#resource "\\Images\\EasyAndFastGUI\\Icons\\bmp16\\color_picker.bmp"
bool CmyPanel_Test2::CreateWindow2(const string caption_text)
  {
//--- Store the window pointer
   CWndContainer::AddWindow(m_window2);
    m_window2.MainPointer(m_mb_contextmenu1);
//--- Coordinates
   int x =(m_window2.X()>0) ? m_window2.X() : 100;
   int y =(m_window2.Y()>0) ? m_window2.Y() : 100;
//--- Properties
   m_window2.Movable(true);
   m_window2.Alpha(200);
   m_window2.XSize(300);
   m_window2.YSize(100);
   m_window2.IconXGap(3);
   m_window2.IconYGap(2);
   m_window2.WindowType(W_DIALOG);
   m_window2.CloseButtonIsUsed(true);
   m_window2.GetCloseButtonPointer().Tooltip("Close");
   m_window2.GetCollapseButtonPointer().Tooltip("Collapse/Expand");
   m_window2.IconFile("Images\\EasyAndFastGUI\\Icons\\bmp16\\color_picker.bmp");
//--- Creating a form
   if(!m_window2.CreateWindow(m_chart_id,m_subwin,caption_text,x,y))
      return(false);
//---
   return(true);
  }
//------------------Window3----------------
bool CmyPanel_Test2::CreateWindow3(const string caption_text)
  {
//--- Store the window pointer
   CWndContainer::AddWindow(m_window3);
    m_window2.MainPointer(m_menubar);
//--- Coordinates
   int x =(m_window2.X()>0) ? m_window2.X() : 100;
   int y =(m_window2.Y()>0) ? m_window2.Y() : 100;
//--- Properties
   m_window3.Movable(true);
   m_window3.Alpha(200);
   m_window3.XSize(200);
   m_window3.YSize(200);
   m_window3.IconXGap(3);
   m_window3.IconYGap(2);
   m_window3.WindowType(W_DIALOG);
   m_window3.CloseButtonIsUsed(true);
   m_window3.GetCloseButtonPointer().Tooltip("Close");
   m_window3.GetCollapseButtonPointer().Tooltip("Collapse/Expand");
   m_window3.IconFile("Images\\EasyAndFastGUI\\Icons\\bmp16\\color_picker.bmp");
//--- Creating a form
   if(!m_window3.CreateWindow(m_chart_id,m_subwin,caption_text,x,y))
      return(false);
//---
   return(true);
  }

and the OnEvent part:

void CmyPanel_Test2::OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {

   if(id==CHARTEVENT_CUSTOM+ON_CLICK_MENU_ITEM)
     {
      PRINT_EVENT(ON_CLICK_MENU_ITEM,id,lparam,dparam,sparam);
      return;
     }
//---
   if(id==CHARTEVENT_CUSTOM+ON_CLICK_BUTTON)
     {
     PRINT_EVENT(ON_CLICK_BUTTON,id,lparam,dparam,sparam);
     
     if(lparam==1 && dparam==1)
     {
      m_window3.Show();
      return;
     }
      return;
     }
//---
   if(id==CHARTEVENT_CUSTOM+ON_CLICK_CONTEXTMENU_ITEM)
     {
      if (dparam==0)
      m_window2.Show();
      PRINT_EVENT(ON_CLICK_CONTEXTMENU_ITEM,id,lparam,dparam,sparam);
      return;
     }

Thank you.

 
zlory73:

Hi,

I'm trying to develop my own control panel following this article series... I'm interested in the multi-windows mode part(Article04) but I used the updated Library14(Article10).

What I got so far(in the attached pics):


What did I missed because  the window2 and window3 are not moving, not closing when hit the close buttons and colapse button it's missing..

Here is the code parts of windows 2 and 3:

 

and the OnEvent part:

Thank you.


Sorry, modified:

bool CmyPanel_Test2::CreateWindow3(const string caption_text)
  {
//--- Store the window pointer
   CWndContainer::AddWindow(m_window3);
    m_window3.MainPointer(m_window);

and:

bool CmyPanel_Test2::CreateWindow2(const string caption_text)
  {
//--- Store the window pointer
   CWndContainer::AddWindow(m_window2);
    m_window2.MainPointer(m_window);

still nothing...

Please help1

 
Artur Zas:

Technically speaking it should as OBJ-BITMAP_LABEL is also available in MQL4, but you would need to adjust the library code as there are a few places where the code will just not compile using the MQL4 compiler.

I'll try to play around with the library and I'll let you know, if I'm able to somehow port it to MQL4. You can also try by yourself. Just rename the example EA's .mq5 extension to .mq4 and try to compile the code.

Obviously, you will get compilation errors however you can check where and what they are.