Discussion of article "Graphical Interfaces X: Sorting, rebuilding the table and controls in the cells (build 11)" - page 7

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
I must have inserted the wrong example in the article. In any case, correct it for your tasks as you need.
I'm not copying your code, I'm interested in the work of the SetImages method itself, is it necessary to put pictures in each cell if you use them in any column of the table, or is it a mistake in your example and you need to insert them only where you use them?
I'm not copying your code, I'm interested in the work of the SetImages method itself, is it necessary to put pictures into each cell if you use them in any column of the table, or is it a mistake in your example and you should only insert them where you use them?
As far as I understand, you need to insert pictures only in the cells of the first column.
Try it like this:
As far as I understand, you need to insert images only in the cells of the first column.
Try this:
))))) so there is still a typo in the method? I went about this way.
And what is the best way to optimise the load on the calculated capacities. There are data that are counted once a period (for example, M5), the data are displayed in a table from OnTimer. The size of the rows on each recalculation is not guaranteed to be equal to the last calculation. I see two options so far:
1. After each recalculation delete all rows and create the necessary number of rows. In between recalculations the data is simply updated.
2. After each recalculation, we update the data in the existing rows of the table, if there are not enough rows, we add new ones, if there are more rows than data, we delete the ones we don't need.
Which of these options is more acceptable for a table based on CCanvasTable?
...
Which of these options is more acceptable for a table based on CCanvasTable?
I won't be able to give you an immediate answer. Try making tests with time measurements(GetTickCount() or GetMicrosecondCount()) or test in profiling mode.
for some reason the picture is inserted only in the column with index 0, in other columns it is not put, is it a peculiarity or something wrong?
And what result do you want to get? Describe in detail.
And what is the problem to do it yourself? All the necessary methods are provided for this.
P.S. Show screenshots and code to better understand what you need.
And what result do you want? Describe it in detail.
And what's the problem with doing it yourself? All the necessary methods are provided for this.
P.S. Show screenshots and code to better understand what you need.
If I use your example, I change the index from 0 to 1:
the icons should move to the column with index 1, i.e. the second one, but it doesn't happen. The example is taken from TestLibrary10.mqh. I have not found any methods for positioning the figures, if there are any, please tell me.
In general, I can not understand the principle of loading pictures into the cells of the table. In the example TestLibrary09.mqh drawings are loaded in different columns, and in the example TestLibrary10.mqh only in the column with index 0, when set in other columns drawings are not loaded. Can you tell me what is the subtlety there?
For each cell of the table, which should be pictures, you need its own array of pictures. If the cell with the type CELL_BUTTON, then a minimum of one picture per cell is enough, if the type CELL_CHECKBOX, then a minimum of two.
For example:
The picture with index 0 - corresponds to the "pressed" state of the checkbox (button), the other indices correspond to the "selected" state of the checkbox (button).
(not finished, but it will do for understanding):
MetaTrader trading platform screenshots
EURUSD, M1, 2017.04.21
MetaQuotes Software Corp., MetaTrader 4, Demo
arr_chk[2]; arr_chk[0]=m_img_chk_off; (image of a checkbox with the checkbox unchecked) arr_chk[1]=m_img_chk_on; (image of a checkbox with the checkbox checked)
In the main table:
Cell 0 contains the graph opening picture - it has type CELL_BUTTON, you can have an array of images with dimension 1: arr_img0[1]; arr_img0[0]=m_image_graph;
Cell 8 contains the Buy opening picture - its type is CELL_BUTTON, the image array can be of dimension 1: arr_img8[1]; arr_img8[0]=m_image_buy;
Cell 9 contains the Sell opening picture - it has type CELL_BUTTON, the image array can be of dimension 1: arr_img9[1]; arr_img9[0]=m_image_sell;
After creating the table, you can initialise it with the required values and set the required cell types and set your own image arrays for them.
For each cell of the table, which should contain pictures, you need its own array of pictures. If the cell is of type CELL_BUTTON, then a minimum of one picture per cell is enough, if the type is CELL_CHECKBOX, then a minimum of two. The picture with index 0 corresponds to the "pressed" state of the checkbox (button), the other indices correspond to the "selected" state of the checkbox (button).
For example (not finished, but it will do for understanding):
arr_chk[2]; arr_chk[0]=m_img_chk0; arr_chk[1]=m_img_chk1;
In the main table:
Cell 0 contains the graph opening picture - it has type CELL_BUTTON, you can have an array of images with dimension 1: arr_img0[1]; arr_img0[0]=m_image_graph;
Cell 8 contains the Buy opening picture - its type is CELL_BUTTON, the image array can be of dimension 1: arr_img8[1]; arr_img8[0]=m_image_buy;
Cell 9 contains the Sell opening picture - it has type CELL_BUTTON, the image array can be of dimension 1: arr_img9[1]; arr_img9[0]=m_image_sell;
Once the table is created, you can initialise it with the desired values and set the desired cell types and set your image arrays for them.
I really do not understand what the problem is )) in the first screen changed to the column with index 1 images disappeared, and in the second screen back to the column with index 0, the images appeared. This is all on the example code TestLibrary10. mqh
Here are the methods of creating the table:
is initialisation:
this is update:
highlighted changed from 0 to 1, i.e. changed the picture insertion in the column from number 0 to number 1, where is the error here?