Libraries: EasyAndFastGUI library for creating graphical interfaces - page 4

Gustavo Enedir Hennemann  
Marcin Rutkowski:
Finlay it clicked in my head :)  ..all is good now  ...Thank You again and Regards
Hello,
I didn't get it. What to do?
Gustavo Enedir Hennemann  

Today I started to use this library, build from 2019.03.13 16:43 (I think build 16). So, I'm using it to create tables, it's working almost perfectly, I used as reference the articles:

https://www.mql5.com/en/articles/2500#para6

https://www.mql5.com/en/articles/2897#para7

For me is important to have the sorting feature, so, I use the library acording to instructions on article "X". If I use that build (build 6) the table works very well, but if I use the last build (build 16), the table do not sorts the elements when I click on the header cells.

Investigating the main differences, I got this in the file Table.mqh.


This is in the build 6:

void CTable::SortData(const uint column_index=0)
{
   ...
   //--- Store the index of the last sorted data column
   m_is_sorted_column_index=(int)column_index;
   //--- Sorting
   QuickSort(first_index,last_index,column_index,m_last_sort_direction);
   //--- Update the table
   UpdateTable();
   //--- Set the icon according to the sorting direction
   m_sort_arrow.State((m_last_sort_direction==SORT_ASCEND)? true : false);
}

This is in the build 16:

void CTable::SortData(const uint column_index=0,const int direction=WRONG_VALUE)
{
   ...
   //--- Запомним индекс последнего отсортированного столбца данных
   m_is_sorted_column_index=(int)column_index;
   //--- Сортировка
   QuickSort(first_index,last_index,column_index,m_last_sort_direction);
}


In the new build there is no "Update" method, so, I think this is the reason to not sorting.


Thus, I made this change and it apparently worked:

void CTable::SortData(const uint column_index=0,const int direction=WRONG_VALUE)
{
   ...
   //--- Запомним индекс последнего отсортированного столбца данных
   m_is_sorted_column_index=(int)column_index;
   //--- Сортировка
   QuickSort(first_index,last_index,column_index,m_last_sort_direction);
   
   //--- Update the table
   Update(true);
}



PS.: comments in russian doesn't help too much.

Graphical Interfaces VII: the Tables Controls (Chapter 1)
Graphical Interfaces VII: the Tables Controls (Chapter 1)
  • www.mql5.com
The first article Graphical Interfaces I: Preparation of the Library Structure (Chapter 1) explains in detail what this library is for. You will find a list of articles with links at the end of each chapter. There, you can also download a complete version of the library at the current stage of development. The files must be placed in the same...
Mano  

Where is Label Class in the Library ? How to create a single Label ?

raulpjr  

Say Gustavo! Beauty?

I was racking my brains here too to make the graph chart sort work and I got it by chance ...

It is necessary to have the table updated in the ON_SORT_DATA event of your "program.mqh", something like:

// --- Ordered table events
if (id == CHARTEVENT_CUSTOM + ON_SORT_DATA)
{
if (lparam == m_table_symb.Id ())
{
m_table_symb.Update (true);
return;
}
// ---
return;
}


Hope this helps!

Here it worked perfect !!!

T +

Raul

Keith Watford  
raulpjr:

This is an English language forum. Please only post in English.

Use the site's translation tool if necessary.

When posting code use the code button (Alt +S).

I have edited your post this time.

Tinashe Chipomho  

Hi

Where can I download the MT4 version of this library?

xiaokkangg CHEN  
OMG. It's complex but advanced and the UI design looks nice! GREAT!
Paulo Campello  

Gustavo Enedir Hennemann:
Hello,
I didn't get it. What to do?

Replace from m_main to  CElementBase:: where the warning appears.

Yevgen Drumachyk  

Hi @Mikhail Sergeev, @Paulo Campello!

Guys,

I have reduced number of warnings from 18 down to 6.

And those 6 boil down to 4 following types of problems. Can you pls advise how to properly correct them?

1. How do I correctly replace it with "CElementBase::"?

//--- Определим цвет для линии
   color clr=m_back_color;
   if(m_tabs.GetButtonPointer(m_selected_tab).IsLocked()) // this one!
      clr=m_tabs.GetButtonPointer(m_selected_tab).BackColorLocked();
//--- Рисуем линию
   m_canvas.Line(x1,y1,x2,y2,::ColorToARGB(clr,m_alpha));
  }


2. And here - when I replace "el." with "CElementBase::" - there is a new compilation error saying "IsAvailable - access to non-static member of function" - how do you solve it correctly?

      for(int e=0; e<elements_total; e++)
        {
         //--- Проверяем только доступные элементы
         CElement *el=m_wnd[m_active_window_index].m_elements[e];
         if(!el.IsVisible() || !el.IsAvailable() || el.IsLocked())
            continue;
         //--- Обработка события в обработчике элемента
         el.OnEvent(m_id,m_lparam,m_dparam,m_sparam);
        }


3. Same line: when I replace "el.IsLocked()" with "CElementBase::IsLocked" : error "IsLocked - access to non-static member of function"

4. What to replace "m_windows[0].IsLocked()" with?

//--- Выйти, если интерфейс не создан
   if(windows_total<1)
      return;
//--- Изменить размер всех элементов заблокированной формы, если включен один из режимов
   if(m_windows[0].IsLocked() && (m_windows[0].AutoXResizeMode() || m_windows[0].AutoXResizeMode()))
     {

Pls, help! It would be great to use this library. But we need to solve these few things first.

Thank you!