Discussion of article "Graphical Interfaces X: Updates for Easy And Fast Library (Build 2)" - 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
Maybe my code got deleted and can't say for sure now.
...
Graphical Interfaces I: Preparing the library structure (Chapter 1) >>>
Notice the double colons in front of the functions in the code listing above. In fact, you can leave them out and everything will work correctly. But in programming it is considered a good practice to put double colons before system functions of a language. It makes it clear that the function is a system function.
The error occurs when I close a window created by the indicator with a cross. I slightly changed the MainWindow.mqh file from the example located here: Indicators\Article 10\SeparateWindow.
I will exclude the error by additional checking. The fix will be in the next update. Replay failed. What changes were made in the MainWindow.mqh file ?
and I also don't understand how to delete a row in the created table ?
No way for now. It will be in the next versions of the library. It will be possible to add and delete rows in tables and lists.
I must have deleted something unnecessary. I attach the files.
p.s. Can I set a different width for each column in the table?
I must have deleted something unnecessary. I attach the files.
p.s. Can I set a different width for each column in the table?
The reason was that you added an object of the same table to the element base twice. First in the CProgram::CreateTable() table creation method, where it should be done, and then in your CProgram::ModifyTable() method. Delete the line highlighted in red in the code listing below.
//---
When deleting the programme from the chart or reloading it, for example, when changing the timeframe or symbol, a second attempt was made to delete an item that had already been deleted before. When deleting a table object, arrays were freed and it caused an error when calling the method of deleting an item again.
p.s. Can I set a different width for each column in the table ?
Not in this type of tables(CTable). You can set the width of columns only in tables of CCanvasTable type. But in this type of tables at the moment there are a lot of other restrictions, which most likely will not suit you. Possibilities of tables of CCanvasTable type will be extended.
The reason was that you added the same table object to the element base twice. First in the CProgram::CreateTable() method, where it should be done, and then in your CProgram::ModifyTable() method. Delete the line highlighted in red in the code listing below.
Ah yes, it's silly, I didn't notice it because I copied my ModifyTable method from CreateTable.
I'll try CCanvasTable, maybe it will work.
Thank you!
p.s: If I can't delete rows in the table, I can delete the whole table and create it again, the one I need. I didn't find any deletion methods either. I can't delete the table yet ?
p.s2: Since I can not create the table columns of different widths, it is logical to place two tables next to each other, but as I understand it I can not do it because the table automatically expands to the right border. There is a method AutoXResizeMode, but it doesn't work yet? When it is set to false, no changes occur.
...
p.s: If I can't delete rows in a table, I can delete the whole table and create it again, the one I need. I didn't find any deletion methods either. I can't delete the table yet ?
Now all GUI elements are created at once and then you can control their visibility using Show() and Hide() methods.
Alexey Oreshkin:
p.s2: Since I can not create the table columns of different widths, it is logical to place two tables next to each other, but as I realised I can not do it because the table automatically expands to the right border. There is a method AutoXResizeMode, but it doesn't work yet? When it is set to false, no changes occur.
Use the XSize() method to set the width of the table.
Example:
m_table.XSize(300);
Thank you for the answers.
There are a couple of more questions:
1.If the data does not fit in a table cell, are there plans to make either a tooltip or a ticker in this cell in the future?
2.Is it possible to disable horizontal scrolling in some tables?
p.s:
The error occurs when we create a table with 5 columns, but try to display more. The option is silly, I agree, but it is necessary. Especially if tables can become dynamic in the future.
p.s2: Show and Hide methods work perfectly well and allow not to change the table on the fly, but to show the one that is necessary. On each tab I have created necessary tables that are bound to radio buttons and when they are activated the necessary one is shown, those that are not - are hidden. Everything works here. But for some reason I can not hide irrelevant tables immediately after their creation. Because of this, I think, scroll bars do not work properly, but as soon as you click once on the radio button and everything unnecessary is hidden - everything starts working fine.
1.If the data does not fit in a table cell, are there plans to make either a tooltip or a ticker in this cell in the future ?
Added to the list of future updates. I will make a mode of tooltips in tables.
2.Is it possible to disable horizontal scrolling in some tables?
Scroll bars appear when the visible part of the table is smaller than the total part.
The error occurs when we create a table with 5 columns and try to display more. The option is silly, I agree, but we need a check. Especially if tables can become dynamic in the future.
I have made corrections. Will be available in the next update.
p.s2: Show and Hide methods work perfectly and allow not to change the table on the fly but to show the one that is necessary. On each tab I created necessary tables that are bound to radio buttons and when they are activated the necessary one is shown, those that are not - are hidden. Everything works here. But for some reason I can not hide irrelevant tables immediately after their creation. Because of this, I think, scroll bars do not work properly, but as soon as you click once on the radio button and everything unnecessary is hidden - everything starts working fine.
Hide them after the tab elements are updated:
If that doesn't work, send me your code and I'll take a look.
At startup they almost do not work, but if I use radio buttons to update them, everything starts to work normally. When switching to a new tab the same problem until I click on the radio button.
I sent the archive to PM.
I seem to be doing something wrong or the problem is in another way, but I have some problems with scroll bars.
At startup they almost do not work, but if I use radio buttons to update them, everything starts to work normally. When switching to a new tab the same problem, until I click on the radio button.
I sent the archive to PM.
I have looked at your files. The problem is clear. There is a conflict between scroll bars, which are located one above the other in visible tables. The thing is that when you switch tabs, all items that are assigned to the currently selected tab become visible. Since you have all the tables one above the other, you just didn't see it. Look at the screenshot below, I have changed the coordinates of two tables of this tab for clarity:
//---
We need an event that will tell us that there was a tab switch. Then in a custom class handler it can be received and the necessary actions can be taken. In your case, then you could get the index of the selected radio button and show the table you associate with it, and hide the others.
Right now such an event is not generated when switching tabs. It will be available in the next library update.