Gallery of UIs written in MQL - page 49

 
Renat Akhtyamov #:

This is the shadow.

If the colour is contrasting, it will only be beautiful for the user, as the artist will get bored with it.

That's right, it's the shadow and also the angle, lighting, glare.....

No time for all that.

 
Реter Konow #:

That's right, it's shadow, but also angle, lighting, glare.....

There's no time for all that.

It's up to you. It's just an answer.

More often than not, one is comforted by the presence of an answer, not its realisation or lack thereof.

It's a fact of psychology.

---

glare will only occur on uneven surfaces, like a ball, a torus.

 
When I tried to paint the button frame, first of all I split the main colour into a range of shades using the gradient function. Having obtained the range of the original colour, I repainted the frame lines in the selected colours of the range. It turned out badly. Unnatural. I tried to move through the range along the curve repeating the curvature of the original grey colour of the button frame. Again not so good. More precisely, with some colours I got almost exactly, with others not. Then I understood that I need some special formula for mixing the grey colour of the frame lines with the button colour. But I could not come up with the formula quickly. I gave up the idea.
 
Реter Konow #:
When I tried to paint the button frame, first of all I split the main colour into a range using the gradient function. Having obtained a range of shades of the original colour (of the button), I simply repainted the frame lines in the selected colours from the range. It turned out badly. Unnatural. I tried to move through the range on a curve repeating the curvature of the original grey colour of the button frame. It did not work well. More precisely, with some colours I got almost exactly, with others not at all. Then I understood that I needed some formula for mixing the grey colour of each line of the frame with the colour of the button. But I could not come up with the formula quickly. So I gave up.

What does grey have to do with it?

You need a contrasting colour ;)

I need it to look good and beautiful.

red/green

yellow/blue

etc.

See the skill of the artist?

Well, it's not beautiful when you've already figured it out, it's a predictable standard.....

For those who don't know, it's only normal.

 

We will have to take the shortcomings of graphics for now as a given.

Let's return to the main thing - markup language and functionality.

Thank you all for your opinions.

Theissue with colours and icons is over .

 



//------------------------------------------------------ 
//DECLARE A NEW WINDOW
//------------------------------------------------------ 
NEW_WINDOW,  
//------------------------------------------------------
/*SET WINDOW TYPE*/             W_TYPE, DIALOG,  
//------------------------------------------------------
/*WRITE WINDOW'S NAME*/         W_NAME, "Sorry, this order is blocked.",
//------------------------------------------------------
/*SET WINDOW'S CAPTION*/        CAPTION, "Risk managment",
//------------------------------------------------------
/*NAME (CAPTION)IN THE MIDDLE*/ NIM,  
//------------------------------------------------------
/*POINT TO WINDOW'S ICON*/      W_ICON, "::Images\\16x16\\No.bmp",   
//------------------------------------------------------
/*ONLY CLOSING BUTTON*/         ONLY_CLOSING, 
//------------------------------------------------------
/*WINDOW ALWAYS ON TOP*/        ALWAYS_ON_TOP, 
//------------------------------------------------------
/*OPEN WINDOW WITH A SOUND*/    OPENING_SOUND,"::Sounds\\Windows Foreground.wav", 
//------------------------------------------------------ 
/*WINDOW OPENS AT START*/       OPEN_ON_INIT,  /*(OOI)*/
//------------------------------------------------------
/*LOCK WINDOWS IF OPENED*/      LOCKS_WINDOWS, ALL_WINDOWS,   
//------------------------------------------------------
/*MARGINS OF THE WINDOW*/       MARGINS, 12,17,/*Х, Y*/
//------------------------------------------------------
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
GROUP, A,
//------------------------------------------------------
__, T_BOX,  "T1", TEXT,
//------------------------------------------------------
                  "Sorry, this order was closed.",
//------------------------------------------------------                 
                  END, 
//------------------------------------------------------                 
END_GROUP,
//--------------------------
i, AT, _X2X, "MF",   1, _Y2Y, "MF", 1,
//--------------------------
"T1",_A3_,0,
//--------------------------
"T1", W,406,
//--------------------------
"T1", H,38,
//--------------------------
"T1", text,_C1_,10,
//--------------------------
"T1", text,_C2_,10,
//--------------------------
"T1",FONT_SIZE,10,
//--------------------------
"T1",TEXT_STYLE,(int)FW_BOLD,
//--------------------------
"T1",text,N_COLOR,(int)clrRed,
//--------------------------
//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, T_BOX,  "T3",TEXT,
                 "*Automated risk managment system denied opening new order.", 
//----------------------------------------------------------------------------------                 
                 END,
GAP,10,
//----------------------------------------------------------------------------------                 
__, T_BOX,  "T4",TEXT,
                 "*Reason: According to the preset settings the risk is too",
                 "high for your deposit. You may have to consider reducing",
                 "lot or change risk managment settings.",
                 END,
//----------------------------------------------------------------------------------                 
END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 1, _Y2H, "T1", 5,
//--------------------------
"T3",TEXT_STYLE,(int)FONT_ITALIC,
//--------------------------
"T4",TEXT_STYLE,(int)FW_BOLD,
//--------------------------
"T3",text,_C1_,55,
//--------------------------
"T4",text,_C1_,55,
//--------------------------
"T3",N_COLOR,(int)C'240,240,240',
//--------------------------
"T4",N_COLOR,(int)C'240,240,240',
//--------------------------
"T3",H,20,
//--------------------------
"T4",H,55,
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, LABEL,A,  _,N_LABEL,"::Images\\32x32\\No.bmp", _,N_COLOR,(int)clrWhite,
//----------------------------------------------------------------------------------
END_GROUP,
//------------------------------------
i, AT, _X2X, "T1", 350, _Y2Y, "T1", 3,
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, LABEL,"EFEW", _,N_LABEL,"::Images\\32x32\\Error.bmp", 
//----------------------------------------------------------------------------------
END_GROUP,
//-----------------------------------
i, AT, _X2X, "MF", 10, _Y2H, "T1", 5,
//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, D_BUTTON, "OK",  CWIP, _,W,40, _,POINTED,0,
//----------------------------------------------------------------------------------
                   _,N_FRAME_COLOR, (int)C'51,153,255',
                   //--------------------------------------------------------------- 
                   _,N_COLOR,       (int)C'236,244,254',
//----------------------------------------------------------------------------------
END_GROUP,
//------------------------------------
i, AT, _W2W, "MF", -7, _Y2H, "T4", 10,
//----------------------------------------------------------------------------------
 
//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, H_LINE,"H1", W,400, _,NG_LINES,200, _,NG_STEP,3, _,H_GRADIENT, _,N_COLOR,(int)C'255,255,255',
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------
i, AT, _X2X, "MF", 1, _Y2H, "T4", 5,
//----------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, BOARD,"Open money managment settings", _,POINTED,1,
                                          //----------------------------------
                                          _,text, N_COLOR,(int)C'42,42,247',
                                          //----------------------------------
                                          _,text, P_COLOR,(int)clrRed, 
                                          //----------------------------------
                                          _,P_COLOR,(int)C'240,240,240',
                                          //----------------------------------
                                          _,text,NP_TEXT_STYLE,FONT_UNDERLINE,
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------
i, AT, _X2X, "H1", 5, _Y2H, "H1", 7,
//----------------------------------

//----------------------------------------------------------------------------------------------------
END_WINDOW,
 

Once you understand the theory of colours, you can continue, for example, take this for a test layout and convert it into something advanced:

https:// www.mql5.com/ru/articles/1612

Изучаем класс CCanvas. Сглаживание и тени
Изучаем класс CCanvas. Сглаживание и тени
  • www.mql5.com
Алгоритм сглаживания класса CCanvas — основа всех построений, в которых используется сглаживание. В статье рассказано о том, как работает этот алгоритм, приведены примеры визуализации его работы. Кроме того, рассмотрено рисование теней графических объектов и разработан подробный алгоритм отрисовки тени на канвасе. Для расчетов применена библиотека численного анализа ALGLIB.
 


//------------------------------------------------------ 
//DECLARE A NEW WINDOW
//------------------------------------------------------ 
NEW_WINDOW,  
//------------------------------------------------------
/*SET WINDOW TYPE*/             W_TYPE, DIALOG,  
//------------------------------------------------------
/*WRITE WINDOW'S NAME*/         W_NAME, "Allow changes",
//------------------------------------------------------
/*SET WINDOW'S CAPTION*/        CAPTION, "User permission",
//------------------------------------------------------
/*NAME (CAPTION)IN THE MIDDLE*/ NIM,  
//------------------------------------------------------
/*POINT TO WINDOW'S ICON*/      W_ICON, "::Images\\16x16\\Warning.bmp",   
//------------------------------------------------------
/*ONLY CLOSING BUTTON*/         ONLY_CLOSING, 
//------------------------------------------------------
/*WINDOW ALWAYS ON TOP*/        ALWAYS_ON_TOP, 
//------------------------------------------------------
/*OPEN WINDOW WITH A SOUND*/    OPENING_SOUND,"::Sounds\\Windows Notify System Generic.wav", 
//------------------------------------------------------ 
/*WINDOW OPENS AT START*/       OPEN_ON_INIT,  /*(OOI)*/
//------------------------------------------------------
/*LOCK WINDOWS IF OPENED*/      //LOCKS_WINDOWS, ALL_WINDOWS,   
//------------------------------------------------------
/*MARGINS OF THE WINDOW*/       MARGINS, 11,15,/*Х, Y*/
//------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, T_BOX,  "T1",TEXT,
                 //----------------------------------------------
                 "An expert needs your permission to continue.",
                 "Do You allow to make changes to the strategy?", 
                 //----------------------------------------------
                 END,
//----------------------------------------------------------------------------------                 
__, T_BOX,  "T2",TEXT,
                 //----------------------------------------------
                 "Strategy name:", 
                 "Expert's name:",
                 //----------------------------------------------
                 END,
//----------------------------------------------------------------------------------                 
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF",   1, _Y2Y, "MF", 1,
//----------------------------------------------
"T1",_A3_,0,
//--------------
"T1",W,350,
//--------------
"T1",H,42,
//--------------
"T1",text,_C1_,55,
//--------------
"T1",text,_C2_,4,
//--------------
"T1",text,N_COLOR,(int)clrWhite,
//--------------
"T1",FONT_SIZE,10,
//--------------
"T1",NG_LINES,75,
//-------------- 
"T1",NG_STEP,1,
//--------------
"T1",H_GRADIENT,
//--------------
"T1",N_COLOR,(int)C'10,65,106',
//--------------
"T2",_A3_,0,
//--------------
"T2",W,350,
//--------------
"T2",H,42,
//--------------
"T2",text,_C1_,85,
//--------------
"T2",text,_C2_,7,
//--------------
//---------------------------------------------------------------------------------- 

//---------------------------------------------------------------------------------- 
GROUP, A,
//---------------------------------------------------------------------------------- 
__, T_BOX,  "T3",TEXT,
                 //----------------------------------------------
                 "'My best strategy'", 
                 //----------------------------------------------
                 END,
 GAP,20, 
//----------------------------------------------------------------------------------                  
__, T_BOX,  "T4",TEXT,
                 //----------------------------------------------
                 "Market explorer",
                 //----------------------------------------------
                 END,
//----------------------------------------------------------------------------------                  
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 210, _Y2Y, "T2", 5,
//----------------------------------------------
"T3",TEXT_STYLE,(int)FONT_ITALIC,
//----------------------------------------------
"T4",TEXT_STYLE,(int)FW_BOLD,
//----------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, LABEL,A, ADAPT_2_GRADIENT,"T1", _,N_LABEL,"::Images\\32x32\\Index.bmp", 
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "T1", 5,
//----------------------------------------------

//----------------------------------------------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, LABEL, A, N_COLOR,(int)clrWhite, _,N_LABEL, "::Images\\32x32\\Attach.bmp",  
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 30, _Y2Y, "T2", 5,
//----------------------------------------------------------------------------------


//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__,CHECKBOX, "More details", A_TEXT,"Less details", 
//----------------------------------------------
   GAP,107, 
//----------------------------------------------  
   D_BUTTON, "Yes", CWIP, _,N_FRAME_COLOR, (int)C'51,153,255', 
//----------------------------------------------  
   GAP,7, 
//----------------------------------------------   
   D_BUTTON, "No", CWIP, 
//----------------------------------------------   
   BREAK_ROW_LINE,
//----------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 10, _Y2H, "T2", 20,
//----------------------------------------------
 
//----------------------------------------------------------------------------------
GROUP, A,

__, T_BOX,  "T5",TEXT,
                 //----------------------------------------------
                 "Current strategy based on 3 signals from indicators:", 
                 "Moving average, Parabolic SAR and RCI.",
                 //----------------------------------------------
                 END,
                
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF",   4, _Y2H, "More details", 7,
//----------------------------------------------
"T5",_A3_,0,
//--------------
"T5", W,342,
//--------------
"T5", H,62,
//--------------
"T5",text,_C1_,10,
//--------------
"T5",text,_C2_,4,
//--------------
"T5",N_FRAME,1,
//--------------
"T5", TEXT_FONT, "Times New Roman",
//--------------
"T5", FONT_SIZE, 12,
//--------------
"T5", text, N_COLOR, (uint)clrRed,
//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, H_LINE,"H1", W,344,
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 4, _Y2H, "T5", 5,
//----------------------------------------------

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, BOARD,"Set up appearance of these messages", 
//----------------------------------------------------------------------------------          
                      _,POINTED,1,
                      //----------------------------------------------
                      _,FONT_SIZE,8,
                      //----------------------------------------------
                      _,text, N_COLOR,(int)C'42,42,247',
                      //----------------------------------------------
                      _,text,NP_TEXT_STYLE,FONT_UNDERLINE,
                      //----------------------------------------------
                      _,text, P_COLOR,(int)clrRed,
                      //----------------------------------------------
                      _,P_COLOR,(int)C'240,240,240',  
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _W2W, "H1", -3, _Y2H, "H1", 7,
//----------------------------------------------

//----------------------------------------------------------------------------------------------------
END_WINDOW,
 
How do users add the images they are looking for and use them in the creation of the gui? This is a question.
 
hini #:
How do users add the images they are looking for and use them to create the interface? This is the question.

Interface images (icons or other pictures) are roughly divided into two categories:

1. Internal.

Internal images are integrated into the designer. For example, pictures on scroll buttons, arrows of menu items, crosses of window closing buttons and others. These are standard images and they are written by numbers in the array. Icons from the Label Menu window too. They are written by numbers in a special array. Even without external resources (folders with pictures) these images will remain and the user can use them in the same way. In this case the address of the icon is the name by which the constructor finds it.


2. External.

All external images must be located in the Images folder. The constructor loads them as resources and records them in the common array of images. The algorithm then accesses these images as its internal images. When the user saves the project, the algorithm selects and writes to the UIDATA file only those pictures that the user interface needs.


Basically, it's simple.

1. The user puts the desired image in the Images folder.

2. In a special file he writes a line (for example) #resource "::Images\\/32x32\Index.bmp".

3. Then in the code specifies:

//----------------------------------------------------------------------------------
GROUP, A,
//----------------------------------------------------------------------------------
__, LABEL,A,  N_LABEL,"::Images\\32x32\\Index.bmp", 
//----------------------------------------------------------------------------------
END_GROUP,
//----------------------------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "T1", 5,
//----------------------------------------------
//----------------------------------------------------------------------------------


Done.


The user simply uses the normal picture assignment string for the element or window. Nothing else is needed. The constructor itself will determine whether the image is external or internal. If external, it will take it out of the resource and put it into an array with the other images.