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

 
Anatoli Kazharski:

1. When you finish creating a graphical interface for your MQL-application under development, when filling it with some trading functionality, you may need to initialise the values of the program when it is loaded/reloaded. This is just an example here, as it is supposed to work from and to the custom CProgram class. I will show some more substantial examples later when I finish developing the library. The second stage will be finished soon and it will be possible to present real examples of MQL-applications using this library.

2. The form should also have similar stretch properties set.

3. Yes, obligatory.

//---

P.S. At the moment the latest version of the library is in this article: GUIs X: Text selection in a multi-line input field (build 13).


thanks, by the way I noticed an array overflow error, if you select the last line in example 11_01 and delete for example the first line, and then select the last line again, you get:

2017.04.19 20:27:52.564 TestLibrary11_01 (RUAL,H1) array out of range in 'CanvasTable.mqh' (1897,19)

Don't pay attention to the name TestLibrary11_01, this is example 11_01, the library is the latest, i.e. the 13th version.


One more question, what method is used to change the tap step on the scroll sliders, because the default step is too small?

 
Konstantin:


1. thanks, by the way, I noticed an array overflow error, if in example 11_01 select the last line and delete for example the first line, and then select the last line again, we get: 2017.04.19 20:27:52.564 TestLibrary11_01 (RUAL,H1) array out of range in 'CanvasTable.mqh' (1897,19)

2. Another question, what method is used to change the tap step on the scroll sliders, because the default step is too small?

1. I will check and fix for the next update.

2. Not implemented yet. Will do.

 

If only the table functionality is required and binding to the CWindow form is mandatory, is it possible not to activate:

1. menu controls

2. Button for deleting the form

3. How to update cell values in the table? (question removed, I saw the redraw parameter in the SetValue method) :))

4. Not quite clear method SetValue(const uint column_index,const uint row_index,const string value="",const uint digits=0, const bool redraw=false), why the division into string type of stored data and real? In my opinion it is better to store string in the table. But if it is so necessary, it is better to create two methods tactically.

I couldn't understand about using OnInitEvent method, I will wait for examples.

 
Konstantin:

If only the table functionality is required and binding to the CWindow form is mandatory, is it possible not to activate:

1. menu controls

2. Button for deleting the form

3. How to update cell values in the table?

About the use of OnInitEvent method I could not understand, I will wait for examples.

1. In the user class of the MQL-application CProgram you construct the graphical interface yourself. Therefore, if you do not need the main menu, just do not create these elements in this class.

2. No. This is a mandatory button on the form. You can't accidentally remove the application from the graph by clicking on it, because a window for confirming this action will pop up.

3. See the example in this article: Graphical Interfaces X: Updates to the drawn table and code optimisation (build 10). In brief, use the CCanvasTable::SetValue() method.


 
Anatoli Kazharski:

1. In the user class of MQL-application CProgram you construct the graphical interface yourself. Therefore, if you don't need the main menu, just don't create these elements in this class.

2. No. This is a mandatory button on the form. You can't accidentally remove the application from the graph by clicking on it, because the window for confirming this action is displayed.

3. See the example in this article: Graphical Interfaces X: Updates to the drawn table and code optimisation (build 10). In brief, use the CCanvasTable::SetValue() method.



On point 2, please make a selection of buttons for the form, even MessageBox has customisable button sets. In Qt it is also possible to change the sets of these buttons, in the standard library MetaQuotes they are also changeable.
 
Konstantin:

...

4. The method SetValue(const uint column_index,const uint row_index,const string value="",const uint digits=0,const bool redraw=false) is not quite clear, why the division into string type of stored data and real? In my opinion it is better to store string in the table. But if it is so necessary, it is better to create two methods tactically.

I don't understand about the data type. They are all stored as string. The data type is specified for each column by the DataType() method for sorting. And the digits parameter in the SetValue() method allows you to specify the number of digits after the separator for each cell separately.
 
Konstantin:

On point 2, please make a choice of buttons for the form, even MessageBox has customisable button sets. In Qt it is also possible to change the sets of these buttons, in the standard library MetaQuotes they are also changeable.

Right now the buttons are:

  1. Close window
  2. Collapse/expand window
  3. Tooltips.

What more do you need?

 
Anatoli Kazharski:

There are buttons now:

  1. Close Window
  2. Collapse/expand window
  3. Tooltips.

What else do you need?


I'm talking about them, that this set should be made changeable, you don't always need all three of these buttons ))
 
Anatoli Kazharski:
I don't understand about the data type. They are all stored as string. The data type is specified for each column using the DataType() method for sorting. And the digits parameter in the SetValue() method allows you to specify the number of digits after the separator for each cell separately.


))) now I understand, by the way DataType( ) by default has what type? Or there is no default state and it is necessary to determine the type of the stored value before adding it to the cell?

PS. I forgot to write, not always loaded resource pictures in the menu, although it may be because I'm sitting in a virtualisation.

 
Konstantin:

I'm talking about them, that this set should be made changeable, you don't always need all three of these buttons ))

2 and 3 can be left out already now. In the method of form creation in the CProgram user class do not call methods:

   m_window.UseRollButton();
   m_window.UseTooltipsButton();