Discussion of article "Graphical interfaces X: Advanced management of lists and tables. Code optimization (build 7)" - page 12

 
Anatoli Kazharski:

If you just need to update the values, you don't need to delete anything.

If you need to change the number of rows in the table, one of the ways to do it is shown.

The second way is to use the CTable::Rebuilding() method. But then you will have to set some table properties again (headers, column widths, etc.).

Thanks, I'll have another look.

But I have CCanvasTable. What is the difference between CCanvasTable and CTable? It seems that I create a table with CCanvasTable normally....

 
Juer:

Thanks, I'll have another look.

But I have CCanvasTable. What is the difference between CCanvasTable and CTable? I think I can create a table with CCanvasTable normally....

Download the latest version of the library: EasyAndFast and updated files with classes in this article: Trade Expert Advisor with GUI: Filling it with functionality (Part II).

Use the CTable class. CCanvasTable is a very old version with minimal features.

 
Juer:

I downloaded it, but I can't find IsSortedColumnIndex() method or its analogue.

...updated files with classes in this article: Trading Expert Advisor with GUI: Filling with functionality (Part II)

CTable class:

   //--- (1) Current sorting direction, (2) sorted array index
   int               IsSortDirection(void)             const { return(m_last_sort_direction);    }
   int               IsSortedColumnIndex(void)         const { return(m_is_sorted_column_index); }
 
Juer:

...

DeleteColumn(), DeleteRow() also disappeared.

Maybe I just need to be a little more careful?

   //--- Table reconstruction
   void              Rebuilding(const int columns_total,const int rows_total,const bool redraw=false);
   //--- Adds a column to the table at the specified index
   void              AddColumn(const int column_index,const bool redraw=false);
   //--- Deletes a column in the table at the specified index
   void              DeleteColumn(const int column_index,const bool redraw=false);
   //--- Adds a row to the table at the specified index
   void              AddRow(const int row_index,const bool redraw=false);
   //--- Deletes a row in the table by the specified index
   void              DeleteRow(const int row_index,const bool redraw=false);
   //--- Deletes all lines
   void              DeleteAllRows(const bool redraw=false);
   //--- Clears the table. Only one column and one row remain.
   void              Clear(const bool redraw=false);
 
Anatoli Kazharski:

...updated files with classes in this article: Trading Expert Advisor with GUI: Filling with functionality (Part II)

CTable class:

I apologise, my mistake. I'm copying to one place and looking in another MetaEditor. Thanks.