Discussion of article "Graphical Interfaces VIII: the File Navigator Control (Chapter 3)" - page 2

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Anatoly, this is in my opinion the best implementation of gui library in mql that I have seen here.
I am now looking at how to "bolt" it to my EA. Everything is sufficient except two things:
1) there is no table with controls inside individual cells (checkboxes, buttons, ...).
2) I can not "catch up" how to make a window with dynamic content.
For 1)-th in principle it is clear that you need to make a new class as an extension of CTable. But with 2) it's a mystery. Let's assume that at different moments of the Expert Advisor's work a dialogue window is opened, in which depending on the current conditions there can be a different number of checkboxes. If the number of checkboxes increases the next time the window is opened, it is clear how it is done. But if the number of checkboxes decreases - how to do it? If I understand correctly, it is necessary to "kill" some of the controls "subscribed" to this window, but in CWndContainer there are no methods for destroying items, only methods of adding. Can you tell me how to do it, if it is possible in this version of the library?
Anatoly, this is in my opinion the best implementation of gui library in mql that I have seen here.
I am now looking at how to "bolt" it to my EA. Everything is sufficient except two things:
1) there is no table with controls inside individual cells (checkboxes, buttons, ...).
2) I can not "catch up" how to make a window with dynamic content.
For 1)-th in principle it is clear that you need to make a new class as an extension of CTable. But with 2) it's a mystery. Let's assume that at different moments of the Expert Advisor's work a dialogue window is opened, in which depending on the current conditions there can be a different number of checkboxes. If the number of checkboxes increases the next time the window is opened, it is clear how it is done. But if the number of checkboxes decreases - how to do it? If I understand correctly, it is necessary to "kill" some of the controls "subscribed" to this window, but in CWndContainer there are no methods for destroying items, only methods of adding. Can you tell me how to do it, if it is possible in this version of the library?
Thank you for your interesting suggestions.
Yes, there are no such ready-made solutions in this version now. I see the need for such features, so I added them to the plan for implementation.
On the second point. If you need a dynamic list of checkboxes, it is easier to create one more class of an item like CCheckboxList with methods of adding and removing items of the array (list) after the item is created. By the way, we also plan to add this feature to all types of lists and tables.
On the second point. If you need a dynamic list of checkboxes, a simpler way is to create another class of an element of CCheckboxList type with methods of adding and removing elements of the array (list) after the element is created. By the way, it is also planned to add this feature to all types of lists and tables.
Can we make several tabs with different sets of checkboxes and display the desired one?
If the sets are predefined, then this option is fine.
It is already possible to create tabs: GUIs VII: "Tabs" elements (Chapter 2) >>>
If the sets are predefined from the beginning, this option is fine.
It is already possible to create tabs: GUIs VII: Tab Elements (Chapter 2) >>>.
That was a hint to the questioner )
Well, and a small question - is it possible to activate a tab programmatically.
...
Well, and a small question - is it possible to activate the tab programmatically.
In a custom class when creating an interface before creating an element:
//---
Is this enough? Or is it necessary to be able to switch tabs programmatically after the element is created in the process of work?
It would be desirable to add such a feature...
something like:
I will make it possible to activate a tab by specifying its index after it has been created.
Indeed, there are cases where this may be necessary. I came up with a couple of ideas where the activation of a tab could be automatic. )
How to adjust the size of the navigator to the size of the window in which the navigator is displayed?
For example: the window size is 450. How can I fit the navigator into the window so that there are 2 pixels indents on the right and left?
How to adjust the size of the navigator to the size of the window in which the navigator is displayed?
For example: the window size is 450. How can I fit the navigator into the window so that the right and left are indented 2 pixels each?
You need to use CFileNavigator::TreeViewAreaWidth() and CFileNavigator::ContentAreaWidth() methods, specifying the width for the tree list area and the content area. If you do not set the width of the content area, the right edge of the navigator will be automatically aligned to the right edge of the window.