Libraries: EasyAndFastGUI library for creating graphical interfaces - page 9

 
EasyAndFast GUI bug

MT4 Version.

Experts\Article09\TestLibrary03

The Edit is always flickering.

Anatoli Kazharski  Please help to solve this bug.

https://www.mql5.com/en/forum/274301


EasyAndFast GUI bug
EasyAndFast GUI bug
  • 2018.08.20
  • www.mql5.com
I download the library of the last MT4 version https://www.mql5.com/en/code/19703 Experts\Article09\TestLibrary03 The Edit is always flickering...
 
Oleksii Chepurnyi:

Good afternoon.

Bigger problem :)

Create a dynamic object, for example a label

...

I haven't tested the library for dynamic object creation, so I can't give you any advice now.

 

Another example of an application whose GUI is created using this library:


 
greentreen:

MT4 Version.

Unfortunately I can not help now, because it no longer worked for MT4. This version of the library has been tested only on the MT5.

 
Anatoli Kazharski:

I haven't tested the library for dynamic object creation, so I can't advise you right now.

I thought so :)

For simple objects I wrote this:

//+------------------------------------------------------------------+
//|| Removes a pointer from the array of elements |
//+------------------------------------------------------------------+
void CWndContainer::DeleteElementsFromArray(const int window_index,const int id)
  {
   int windows_total=::ArraySize(m_windows);
//--- If there are no forms for controls in the database
   if(windows_total<1)
     {
      ::Print(__FUNCTION__," > There is no one form.");
      return;
     }
//--- If the request is for a non-existent form
   if(window_index>=windows_total)
     {
      ::Print(PREVENTING_OUT_OF_RANGE," window_index: ",window_index,"; windows total: ",windows_total);
      return;
     }
//--- Remove elements from the common array
   DeleteElement(id,m_wnd[window_index].m_elements);
//--- Remove the main elements from the array
   DeleteElement(id,m_wnd[window_index].m_main_elements);
//--- 
   DeleteElement(id,m_wnd[window_index].m_timer_elements);
//--- 
   DeleteElement(id,m_wnd[window_index].m_available_elements);
//--- 
   DeleteElement(id,m_wnd[window_index].m_auto_x_resize_elements);
//--- 
   DeleteElement(id,m_wnd[window_index].m_auto_y_resize_elements);
  }
//+------------------------------------------------------------------+
//|| Removes a pointer from the array of elements |
//+------------------------------------------------------------------+
template<typename T>
void CWndContainer::DeleteElement(const int id,T &array[])
  {
   bool del=false;
   for(int i=0;i<ArraySize(array);i++)
     {
      if(del)
        {
         if(i==ArraySize(array)-1) break;
         array[i] = array[i+1];
         continue;
        }
      if(array[i].Id()==id)
        {
         del=true;
         if(i==ArraySize(array)-1) break;
         array[i] = array[i+1];
        }
     }
   if(del) ArrayResize(array,ArraySize(array)-1,RESERVE_SIZE_ARRAY);
  }
//+------------------------------------------------------------------+
 

Can you tell me, in the table the button with a picture is added only to the first column, and in the rest does not work.

Is it a bug or not?

 
Vladimir Ananich:

In the table, the button with a picture is added only to the first column, and in the rest does not work.

You can add to all of them.

 
Anatoli Kazharski:

You can add to everything.

Thanks, I figured it out.

But strangely, if the alignment in the cell is set to centre or right, the picture is not visible.

If the alignment is left, it works fine.

 
Vladimir Ananich:

Thank you, I've got it.

But strangely, if the alignment in the cell is set to centre or right edge, the picture is not visible.

If it is on the left edge, it works fine.

Yes, now there is such a restriction (only left edge).