Gallery of UIs written in MQL - page 44

 

Dear forum members might have noticed that there are quite a few windows in the latest release.

I will list:

1. The already familiarTaskbar (Taskbar) of the designer.

2. Themain context menu of the constructor(Main Menu).

3. The Custom Menu, called from the Main Menu.

4. Custom Menu windows called from the Custom Menu (three windows: Demo windows, Settings windows, Dialog windows).

5. Five settings windows: Main parameters, Account info, Input parameters, Settings example 1, Settings example 2.

6. Six dialogue windows: Risky management, Incorrect settings, Winning 1000$, Processing the data, Allow changes, Sorry, this order is blocked.


Together we get 17 windows.

Each window contains a different number of items. The smallest is up to 10, the largest - up to a hundred or more. But that's not the limit. There can be 2 or 3 times more windows. Although I have not tested the constructor at maximum, I am sure that it can cope with five times the number of windows.

But, I wanted to say something else. Many windows can be used as a template. First of all, windows of settings and messages. The common structure can be inherited or passed between projects of one person or many. After all, the markup code is quite simple, and merging it is not difficult.

So, what was the demo project built from? I suggest you to look in the file

#include<(2)  KIB PROJECTS\(6) DEMO PROJECTS\Demo project 1.mqh>        подключенный в (1) KIB-source v1.mq5.

There you will find KIB-code of all windows of this demo project.

I will show the code of each window separately, so that those who want to understand it can do so.

 

Main context menu:


//----------------------------------------------------------------------------------
NEW_WINDOW,  W_NAME, "Main context menu",    W_TYPE, MENU,   WINDOW_GROUP, MAIN_CONTEXT_MENU, 
//---------------------------------------------------------------------------------- 
 /**/ GROUP, "Menu items",
 //-----------------------------
 
__, M_ITEM, "MAIN MENU", POINTED,0, 
                       //-----------------------------
                       _,N_COLOR,(uint)C'240,240,240',
                       //-----------------------------
                       _,FONT_SIZE, 10, 
                       _,TEXT_STYLE, (int)FW_BOLD,
                       _,TEXT_FONT,"Arial_Black", 
                       _,text, N_COLOR,(uint)C'0,0,0',  
                       _,text, _A1_,_C2C, 
                       _,text, _C1_,-20, 
                       _,text, _A2_,_C2C,
                       
                       //-----------------------------
__, M_SEP,A, 
//---------------------------------------------------------------------------------- 
__, M_ITEM, "Bring window on top", TENURED,  _,PAR_TYPE,0, _,C_FUNCTION, BRING_WINDOW_ON_TOP,  _,N_LABEL,"::Images\\16x16\\Up.bmp", 
//----------------------------------------------------------------------------------
__, M_SEP,A, 
//----------------------------------------------------------------------------------
__,M_ITEM,"Standart Taskbar", OPENS_WINDOW, "Taskbar", _,N_COLOR, (uint)C'255,255,230', _,P_COLOR, (uint)C'255,255,220',_,NP_FRAME_COLOR, (uint)C'255,255,20',
//----------------------------------------------------------------------------------
 __, M_SEP,A, 
//---------------------------------------------------------------------------------- 
__,M_ITEM,"Custom Taskbar", _,N_COLOR, (uint)C'240,255,240', _,P_COLOR, (uint)C'230,255,230',_,NP_FRAME_COLOR, (uint)C'0,255,0',
//----------------------------------------------------------------------------------
 __, M_SEP,A, 
//----------------------------------------------------------------------------------
__,M_ITEM,"Custom Menu",   _,N_COLOR, (uint)C'240,240,255', _,P_COLOR, (uint)C'220,220,255',_,NP_FRAME_COLOR, (uint)C'120,120,255', 
//----------------------------------------------------------------------------------   
__, M_SEP,A,
//----------------------------------------------------------------------------------
Y_GAP,20, 
//----------------------------------------------------------------------------------
__, M_SEP,A, 
//----------------------------------------------------------------------------------
__, M_ITEM,"Sounds menu",
//----------------------------------------------------------------------------------
__, M_ITEM,"Color Picker",
//----------------------------------------------------------------------------------
__, M_ITEM,"Frames",
//----------------------------------------------------------------------------------
__, M_ITEM,"Fonts menu",
//----------------------------------------------------------------------------------
__, M_ITEM,"Icons", 
//----------------------------------------------------------------------------------
__, M_SEP,A, 
//----------------------------------------------------------------------------------
__, M_ITEM,"Save project and print the API file",C_FUNCTION, SAVE_PROJECT, 
//----------------------------------------------------------------------------------    
                  _,N_LABEL,"::Images\\16x16\\Save.bmp", 
//----------------------------------------------------------------------------------                  
                  _,N_COLOR, (uint)C'255,230,230', _,NP_FRAME_COLOR, (uint)C'255,70,70', 
//----------------------------------------------------------------------------------                  
                  _,P_COLOR, (uint)C'255,220,220', 
//----------------------------------------------------------------------------------
GAP,30,
//----------------------------------------------------------------------------------
__, M_SEP,A,
//----------------------------------------------------------------------------------
__, M_ITEM,"About the program",_,N_LABEL,"::Images\\16x16\\Help symbol.bmp",
//----------------------------------------------------------------------------------
END_GROUP,
//---------------------------------
i,AT, _X2X,"MF",3, _Y2Y,"MF",3,
//---------------------------------
i, TENURED, 
//----------------------------------------------------------------------------------
END_WINDOW, 
 

//-------------------------------------------------------------------- 
NEW_WINDOW,  
//-----------------------------
W_NAME, "Custom Menu",    
//-----------------------------
W_TYPE, MENU,   
//-----------------------------
WINDOW_GROUP, MAIN_CONTEXT_MENU,
//-----------------------------

//------------------------------------------------------------------- 
GROUP, "Menu items",
//-----------------------------
__, M_ITEM, "MY MENU", POINTED,0, 
                       //-----------------------------
                       _,FONT_SIZE, 9, 
                       _,TEXT_FONT,"Arial_Black", 
                       _,text, _A1_,_C2C, 
                       _,text, _C1_,-30, 
                       _,text, _A2_,_C2C,
                       _,text, _C2_,0, 
                       //-----------------------------
//-------------------------------------------------------------------------------
__, M_SEP,A, 
//-------------------------------------------------------------------------------
__, M_ITEM, "Bring window on top", TENURED,  _,PAR_TYPE,0, _,C_FUNCTION, 10000013,  _,N_LABEL,"::Images\\16x16\\Up.bmp", 
//-------------------------------------------------------------------------------
__, M_SEP,A, 
//-------------------------------------------------------------------------------
__, M_SEP,A, 
//-------------------------------------------------------------------------------
__, M_ITEM, "Show/Hide Taskbar", _,N_LABEL,"::Images\\16x16\\Toolbox.bmp", 
//-------------------------------------------------------------------------------

//-------------------------------------------------------------------------------
#include <(2) KIB PROJECTS\(1) Must be included\User section\My menu section.mqh> 
//-------------------------------------------------------------------------------
 END_GROUP,
 
//----------------------------------------------------------
//*DO NOT CHANGE GROUP POSITION-----------------------------
//----------------------------------------------------------
i, AT,_X2X,"MF",3, _Y2Y,"MF",3, 
//---------------------------------------------------------- 
END_WINDOW, 
//-------------------------------------------------------------------------------
 

//----------------------------------------------------------------------------------
NEW_WINDOW,  W_NAME, "Demo windows",    W_TYPE, MENU, 
//----------------------------------------------------------------------------------
 GROUP, "Menu items",
 //-----------------------------
 __, M_ITEM, "Settings windows",
//------------------------------ 
 __, M_ITEM, "Dialog windows",
 //-----------------------------
 END_GROUP,
//------------------------------
END_WINDOW,
//----------------------------------------------------------------------------------
 


//----------------------------------------------------------------------------------
NEW_WINDOW,  W_NAME, "Settings windows",    W_TYPE, MENU, 
//----------------------------------------------------------------------------------
 GROUP, "Menu items",
 //-----------------------------
 __, M_ITEM, "Main Parameters", 
//----------------------------- 
 __, M_ITEM, "Account info:", 
//----------------------------- 
 __, M_ITEM, "Input parameters:",
//----------------------------- 
 __, M_ITEM, "Settings example 1",
//----------------------------- 
 __, M_ITEM, "Settings example 2", 
//-----------------------------
 END_GROUP,
//-----------------------------
END_WINDOW,
//----------------------------------------------------------------------------------
 


//----------------------------------------------------------------------------------
NEW_WINDOW,  W_NAME, "Dialog windows", W_TYPE, MENU, 
//----------------------------------------------------------------------------------
GROUP, A,
//-----------------------------
 __, M_ITEM, "Risky managment!", 
//-----------------------------
 __, M_ITEM, "Incorrect settings", 
//-----------------------------
 __, M_ITEM, "Winning 1000$",   
//-----------------------------
 __, M_ITEM, "Processing the data...",   
//-----------------------------
 __, M_ITEM, "Allow changes",   
//-----------------------------
 __, M_ITEM, "Sorry, this order is blocked.",  
//-----------------------------
 END_GROUP,
//-----------------------------
END_WINDOW,
//----------------------------------------------------------------------------------
 



//DECLARE A NEW WINDOW
//----------------------------------------------------------------------------------
NEW_WINDOW,  
//------------------------------------------------------
/*SET WINDOW TYPE*/         W_TYPE, SETTINGS,  
//------------------------------------------------------
/*WRITE WINDOW'S NAME*/     W_NAME, "Settings example 1",
//------------------------------------------------------
/*POINT TO WINDOW'S ICON*/  W_ICON, "::Images\\16x16\\Wrench.bmp",  
//------------------------------------------------------

//------------------------------------------------------
/*SET WINDOW'S ADDITIONAL PROPERTIES*/   
//----------------------------------------------------------------------------------
/*WINDOW OPENS AT START*/   //OPEN_ON_INIT,  /*(OOI)*/

/*MARGINS OF THE WINDOW*/   MARGINS, 20,20,/*Х, Y*/
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------------------------------
__,  BUTTON,"Start",                 PARAM_TYPE,   _BOOL,  _,A_TEXT, "Stop",   _,FIC,  GAP, 75,                                 
//----------------------------------------------------------------------------------------------------------
     CHECKBOX,"Set an option",       A_TEXT, "Option is set",                   BREAK_ROW_LINE,
//----------------------------------------------------------------------------------------------------------
GAP, 20,
//----------------------------------------------------------------------------------------------------------
__, CHECKBOX, "Set another option",              D_LIST, "D_LIST 1",  W,150,   BREAK_ROW_LINE,
//----------------------------------------------------------------------------------------------------------
GAP, 20,
//----------------------------------------------------------------------------------------------------------
__, CHECKBOX, "And another option",              C_LIST, "C_LIST 1",  W,150,   BREAK_ROW_LINE,
//----------------------------------------------------------------------------------------------------------
GAP, 50,
//---------------------------------------------------------------------------------------------------------- 
  
//----------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------
__,  BOARD, "Spin the value ",   GAP, 100,  BOARD, "Roll the value ",
//----------------------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------------------
__,  S_EDIT,"Spin the value",             V_STEP,1.7,
                                         //-------------------
                                         _,VALUE_TYPE, _DOUBLE,  
                                         //-------------------  
                                         _,READ_ONLY,
                                         //------------------- 
                                         _,DIGITS,3,                
//---------------------------------------------------------------------------------------------------------- 
     H_SLIDER,"Roll the value",          
                                         W,170,
                                         //-------------------
                                         _,V_CURRENT,  35, 
                                         //-------------------
                                         _,V_MIN,    0,  
                                         //-------------------
                                         _,V_MAX,    100,  
                                         //-------------------
                                         _,V_STEP,   1,   
                                         //-------------------
                                         _,SHOW_WIDGET, WIDGET_ON_TOP, 
                                         //-------------------
                                         BREAK_ROW_LINE,
                                         //-------------------
END_GROUP,
//----------------------------------------------------------------------------------------------------------
i, AT, _X2X, "MF", 20, _Y2Y, "MF", 30,
//---------------------------------------
i, X_GAP, 55,
i, Y_GAP, 10,
//---------------------------------------
SWITCH, "R_BUTTON 1",   "R_BUTTON 2", END,
//---------------------------------------
SWITCH, "_BUTTON 1",   "_BUTTON 2", END,
//------------------------------------------------------ 
GROUP, A,
__,L_ITEM, "L_ITEM  1",ON,
__,L_ITEM, "L_ITEM  2",
__,L_ITEM, "L_ITEM  3",
__,L_ITEM, "L_ITEM  4",
__,L_ITEM, "L_ITEM  5",
__,L_ITEM, "L_ITEM  6",
__,L_ITEM, "L_ITEM  7",
__,L_ITEM, "L_ITEM  8",
__,L_ITEM, "L_ITEM  9",
__,L_ITEM, "L_ITEM  10",
__,L_ITEM, "L_ITEM  11",
__,L_ITEM, "L_ITEM  12",
__,L_ITEM, "L_ITEM  13",
__,L_ITEM, "L_ITEM  14",
__,L_ITEM, "L_ITEM  16",
__,L_ITEM, "L_ITEM  17",
__,L_ITEM, "L_ITEM  18",
__,L_ITEM, "L_ITEM  19",
__,L_ITEM, "L_ITEM  20",

END_GROUP,
//-------------------------
i, AT, LEFT_TOP, 0,0,
i, IN,"D_LIST 1",
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, "V2 group",

__, L_ITEM,"Times_New_Roman",
__, L_ITEM,"Arial",
__, L_ITEM,"Tahoma",
__, L_ITEM,"Dali",
__, L_ITEM,"BatangChe",
__, L_ITEM,"Consolas",
__, L_ITEM,"Courier",
__, L_ITEM,"Courier_New",ON,
__, L_ITEM,"DFKai_SB",
__, L_ITEM,"DotumChe",
__, L_ITEM,"FangSong",
__, L_ITEM,"Fixedsys",
__, L_ITEM,"GulimChe",
__, L_ITEM,"GungsuhChe",
__, L_ITEM,"KaiTi",

END_GROUP,
//------------------
i, IN,"C_LIST 1",
//------------------
i, AT, LEFT_TOP, 1,1,
//----------------------------------------------------------------------------------


GROUP, A,
//----------------------------------------------------------------------------------------------------------
__, CHECKBOX, "Don't show this dialog", GAP, 50, D_BUTTON, "Apply", N_FRAME_COLOR, (int)C'51,153,255', _,CWIP, GAP,7,  D_BUTTON, "Close", _,CWIP, BREAK_ROW_LINE,
//---------------------------------------------------------------------------------------------------------- 
END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 20, _Y2H, "Roll the value",  20,
//----------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------------+
GROUP,A,__, G_FRAME,"Group frame 1", ON_TOP,"Start",   R_SIDE, "Set an option",  B_SIDE,"C_LIST 1", END_GROUP,
//--------------------------------------------------------------------------------------------------+
//--------------------------------------------------------------------------------------------------+
GROUP,A,__, G_FRAME,"Group frame 2", ON_TOP,"Spin the value ",  R_SIDE, "Roll the value",  B_SIDE,"Roll the value",END_GROUP,
//--------------------------------------------------------------------------------------------------+
//------------------------------------------------------
//FINISH THE WINDOW BY KEYWORDS END_WINDOW,
//------------------------------------------------------
END_WINDOW,
//----------------------------------------------------------------------------------
 
I'll continue a little later.
 
I uploaded a gif, not sure if it's a problem with my operation. Just reporting it.
 
hini #:
I downloaded the gif, not sure if it's a problem with my OS. Just reporting it.
Thanks for reporting it. I have not tested this option of resizing the chart. I will check the event in OnChartEvent().