Gallery of UIs written in MQL - page 34

 
Реter Konow #:

Years ago, I parsed your code and tried to implement it in my systems.

I have not figured out how to build dynamic forms in the process. Is it possible and if yes, please, please, send me examples. Also, please, specify whether it is possible to change properties of an object in the process, for example, font, size, position on the form.

 

The second type of enumeration is i, SWITCH,..., END .

Switches the activated state between items whose names are spelled out between the SWITCH c.word,and theEND c.word,


1.



2.


CODE:

GROUP, A,
 
__, R_BUTTON, "R_button 1",  
__, R_BUTTON, "R_button 2",  
__, R_BUTTON, "R_button 3",  
__, R_BUTTON, "R_button 4",  
__, R_BUTTON, "R_button 5",  
__, R_BUTTON, "R_button 6",  

END_GROUP,
//--------------------------
//SET GROUP POSITION:
//--------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "MF", 10,
//--------------------------
//SET GAPS:
//--------------------------
i, Y_GAP, 20,
//--------------------------
//USE SWITCH ENUMERATION TO SELECT ONE ELEMENT IN THE GROUP:
//--------------------------
 i, SWITCH, 
            "R_button 1", "R_button 2", "R_button 3", 
            "R_button 4", "R_button 5", "R_button 6",  
            
      END,
//--------------------------
 
Sergey Likho #:

Years ago, I parsed your code and tried to implement it in my systems.

I have not figured out how to build dynamic forms in the process. Is it possible and if yes, please, please, send me examples. Also, please, specify whether it is possible to change properties of an object in the process, for example, font, size, position on the form.

In this version of the constructor dynamic window is disabled. It is possible to change various properties of elements, including fonts. I am currently doing some educational work on the markup language in this thread. I recommend you to look through the previous pages. There is material there that can help and teach you. However, the topic of elements arrangement on the form is not covered yet. It is ahead. Also, when I publish the engine you can connect interfaces to user applications.

 
Реter Konow #:

The second type of enumeration is i, SWITCH,..., END .

Switches the activated state between the elements whose names are written between the SWITCH c.wordand theEND c.word,


1.



2.


CODE:

To catch up on the SWITCH enumeration.

There is an option to assign universal switching to items in a group when there are too many of them to write the name of each. For example long menus with dozens of items in dropdown lists. In this case, you need a way to specify switching of all items without listing each name.

This is done with the SWITCH_ALL keyword.

GROUP, A,
 
__, R_BUTTON, "R_button 1",  
__, R_BUTTON, "R_button 2",  
__, R_BUTTON, "R_button 3",  
__, R_BUTTON, "R_button 4",  
__, R_BUTTON, "R_button 5",  
__, R_BUTTON, "R_button 6",  

END_GROUP,
//--------------------------
//SET GROUP POSITION:
//--------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "MF", 10,
//--------------------------
//SET GAPS:
//--------------------------
i, Y_GAP, 20,
//--------------------------
//USE SWITCH_ALL WORD TO SWITCH BETWEEN ALL THE ELEMENTS IN THE GROUP:
//--------------------------
i, SWITCH_ALL,
 

And the last enumeration type for today:

i, BLOCKS, ..., END
.

When there is a need to lock individual elements of the interface, the BLOCKS c.word comes to the rescue.

For example, you have two checkboxes that need to block/enable several other checkboxes that are either in their group or in another group.

This is done like this:

//--------------------------
//FIRST GROUP
//--------------------------
GROUP, "Group 1",

__, CHECKBOX, "Checkbox 100", GAP,30, CHECKBOX, "Checkbox 200",

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "MF", 10,
//--------------------------
i, CHECKBOXES, W, 120,  END,
//--------------------------------------------------------------
//1. WRITE THE NAME OF THE CHECKBOX THAT WILL BLOCK THE OTHERS:
//2. WRITE KEYWORD "BLOCKS".
//3. WRITE THE NAMES OF THE ELEMENTS (OR GROUPS) IT WILL BLOCK.
//4. PUT "END" IN THE END.
//--------------------------------------------------------------
"Checkbox 100", BLOCKS, "Checkbox 3","Checkbox 5","Checkbox 7", END,

"Checkbox 200", BLOCKS, "Checkbox 4","Checkbox 6","Checkbox 8", END,
//--------------------------------------------------------------

//--------------------------
//SECOND GROUP
//--------------------------
GROUP, "Group 2",


__, CHECKBOX, "Checkbox 3",  CHECKBOX, "Checkbox 4",

__, CHECKBOX, "Checkbox 5",  CHECKBOX, "Checkbox 6",

__, CHECKBOX, "Checkbox 7",  CHECKBOX, "Checkbox 8",

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2H, "Checkbox 100", 30,
//--------------------------
 i, CHECKBOXES, W, 120,  END,
//--------------------------
i, X_GAP, 30,
i, Y_GAP, 20,
//----------------------------
//SET MAIN PROPERTIES (IF YOU DON'T, THEY WILL HAVE DEFAULT VALUES): 


Result:

1. When the blocking item is not in the actv state, its items are blocked.


2.

Conversely, if it is activated, they are open.


 

The rest tomorrow.

Forgot to add. You can name a group instead of listing items and all items in it will become locked:

//--------------------------
//FIRST GROUP
//--------------------------
GROUP, "Group 1",

__, CHECKBOX, "Checkbox 100",  

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "MF", 10,
//--------------------------
i, CHECKBOXES, W, 120,  END,
//--------------------------
//--------------------------------------------------------------
//1. WRITE THE NAME OF THE CHECKBOX THAT WILL BLOCK THE OTHERS:
//2. WRITE KEYWORD "BLOCKS".
//3. WRITE THE NAMES OF THE ELEMENTS (OR GROUPS) IT WILL BLOCK.
//4. PUT "END" IN THE END.
//5. OR, WRITE THE NAME OF THEIR GROUP.
//--------------------------------------------------------------
"Checkbox 100", BLOCKS, "Group 2", END,
//--------------------------------------------------------------

//--------------------------
//SECOND GROUP
//--------------------------
GROUP, "Group 2",


__, CHECKBOX, "Checkbox 3",  CHECKBOX, "Checkbox 4",

__, CHECKBOX, "Checkbox 5",  CHECKBOX, "Checkbox 6",

__, CHECKBOX, "Checkbox 7",  CHECKBOX, "Checkbox 8",

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2H, "Checkbox 100", 30,
//--------------------------
i, X_GAP, 30,
i, Y_GAP, 20,
//----------------------------
//SET MAIN PROPERTIES (IF YOU DON'T, THEY WILL HAVE DEFAULT VALUES): 
i, CHECKBOXES, W, 120,  END,
//------------------------------------------------------

Result:


 
Very good, please continue to introduce other controls
 
hini #:
Very well, please continue with the other controls.

Yes, of course. That's in the plans. By the way, about the other controls...

 

Here's what locking a few other types of controls looks like:

1. open:


2. Locked:


 
//--------------------------
//FIRST GROUP
//--------------------------
GROUP, "Group 1",

__, CHECKBOX, "Checkbox 100",  

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2Y, "MF", 10,
//--------------------------
i, CHECKBOXES, W, 120,  END,
//--------------------------
//--------------------------------------------------------------
//1. WRITE THE NAME OF THE CHECKBOX THAT WILL BLOCK THE OTHERS:
//2. WRITE KEYWORD "BLOCKS".
//3. WRITE THE NAMES OF THE ELEMENTS (OR GROUPS) IT WILL BLOCK.
//4. PUT "END" IN THE END.
//5. OR, WRITE THE NAME OF THEIR GROUP.
//--------------------------------------------------------------
"Checkbox 100", BLOCKS, "Group 2", END,
//--------------------------------------------------------------

//--------------------------
//SECOND GROUP
//--------------------------
GROUP, "Group 2",


__, H_SLIDER, "H_Slider 1", W, 120,       S_EDIT, "Textbox 1",         W, 120, 

__, C_LIST,   "Combobox 1", W, 120,       D_LIST, "Combobox 2",        W, 120, 

__, BUTTON,   "Button 1",   W,120,        D_BUTTON, "Dialog button 1", W, 120, 

END_GROUP,
//--------------------------
i, AT, _X2X, "MF", 10, _Y2H, "Checkbox 100", 30,
//--------------------------
i, X_GAP, 30,
i, Y_GAP, 20,
//----------------------------
//SET MAIN PROPERTIES (IF YOU DON'T, THEY WILL HAVE DEFAULT VALUES): 

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