Discussion of article "Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)" - page 3

 
Oleksii Chepurnyi:

Yes.

As a matter of fact, yes. I remember something like that... Now I just need to remember what I changed :)

I think I added this. Keys.mqh

thanks a lot!
 
Oleksii Chepurnyi:

...

I think I was adding this. Keys.mqh

Added it to the latest update for the library. Will be available in the next article as an appendix.

In addition, there are some updates for tables in the CTable class.

The latest version of this class can be downloaded in this article: Visualisation of optimisation results by selected criterion

A little later will be added to the latest version of the library that is in the code base: EasyAndFast

 
Anatoli Kazharski:

Added to the latest update for the library. Will be available in the next article as an appendix.

In addition, there are some updates for tables in the CTable class.

The latest version of this class can be downloaded in this article: Visualisation of optimisation results by selected criterion

A little later, the latest version of the library that is in the code base will be added: EasyAndFast

if it is possible, please add this feature:

When specifying the cell data type, specify how many characters after the decimal point to draw:

Example: m_table.DataType(column,TYPE_DOUBLE,2);

or specify the number of characters in a separate function

Example: m_table.DataDigits(column,2);

 
Andrii Djola:

if it is possible, add more such a feature:

When specifying the cell data type, specify how many characters after the decimal point to draw:

...

Now you can also specify the number of decimal places:

//+------------------------------------------------------------------+
//| Fills the array by the specified indices ||
//+------------------------------------------------------------------+
void CTable::SetValue(const uint column_index,const uint row_index,const string value="",const uint digits=0,const bool redraw=false)
  {
//--- Check for out of range
   if(!CheckOutOfRange(column_index,row_index))
      return;
//--- Set the value to an array:
// String
   if(m_columns[column_index].m_data_type==TYPE_STRING)
      m_columns[column_index].m_rows[row_index].m_full_text=value;
//--- Real
   else if(m_columns[column_index].m_data_type==TYPE_DOUBLE)
     {
      m_columns[column_index].m_rows[row_index].m_digits=digits;
      double type_value=::StringToDouble(value);
      m_columns[column_index].m_rows[row_index].m_full_text=::DoubleToString(type_value,digits);
     }
//--- Time
   else if(m_columns[column_index].m_data_type==TYPE_DATETIME)
     {
      datetime type_value=::StringToTime(value);
      m_columns[column_index].m_rows[row_index].m_full_text=::TimeToString(type_value);
     }
//--- Any other type will be set as string
   else
      m_columns[column_index].m_rows[row_index].m_full_text=value;
//--- Adjust and save the text if it does not fit in the cell
   m_columns[column_index].m_rows[row_index].m_short_text=CorrectingText(column_index,row_index);
//--- Redraw the cell if specified
   if(redraw)
      RedrawCell(column_index,row_index);
  }
 
Anatoli Kazharski:

Now you can also specify the number of decimal places:

yes, but when you enter a decimal point in the input field, then everything after the decimal point is discarded, I had to modify it a bit!

but you have done a tremendous job!!!!

 
I also encountered this problem when calling the Rebuild function, the pictures on the buttons are not displayed
 
Andrii Djola:
I also encountered this problem when calling the Rebuild function, the images on the buttons are not drawn

This is because in the CTable::Rebuilding() method all cells are deleted and new ones are created. Therefore, after rebuilding the table, all cells must be filled with data again.

Andrii Djola:

yes, but when entering a value with a commain the input field, then everything after the comma is discarded, I had to modify it a bit!

Show me in detail what you mean.

 
I fill them with the same function that I used to create the table, but it doesn't draw any pictures.
 
Andrii Djola:
I fill them with the same function that I used to create the table, but it doesn't draw any pictures.

Show me what you are doing and how you are doing it. Without seeing it, it is difficult to suggest something.

 
Anatoli Kazharski:

Show me what you're doing and how you're doing it. Without seeing it, it's hard to tell you anything.

I deleted this code, but if I can reproduce it, I'll post it here!