Libraries: EasyAndFastGUI library for creating graphical interfaces - page 18

 
Marco vd Heijden:

Early on it was developed in MQL4 and MQL5 but the last few examples are for MQL5.

This does not mean that it can not be made to work in MQL4.

The code usually needs a few small bits of adjustments.

 i was in effort to modify it, but failed. the complex MT5 .mqh files frustrated me, so many variables and objects! 

 
17334708:

 i was in effort to modify it, but failed. the complex MT5 .mqh files frustrated me, so many variables and objects! 

Yes it involves some work the best way is to rename the loop variables for example when you get a warning about variable i then you can rename i to i1 in that loop and in the next loop i2 and i3 and so on.

Also it's not needed to do the entire library you can just take the element you need and convert only that because the articles deal with a lot of items and objects.

 
But quite a few elments are co-related. Modifying the loop or variables becomes a fantastic overloaded work. thanks for your kind help.
 
Only if you want all of it not if you want just a single element.
 
Could this library be used in MQL4?
 
What I did:
A panel that has several comboboxes and number entry fields. There is one main combo box, on which the other fields depend

How it should work:
when the value of the main combobox changes, the other input fields and comboboxes: something is hidden, something appears, something changes its location (X,Y)

What ways I have tried:
1) - when re-selecting a value in the main combo box - all unnecessary elements are deleted (Delete()) and then re-created (Create...()). The result - when you click on an element of the redrawn combobox, an array out of range occurs when accessing the array of form elements. I tried to "stiffen" the error and added a check for the array size in the error location (so that the loop is not forced to go beyond the array), now when it gets here, the form just "hangs".

2) - tried method 1), but at the same time added to WndContainer function, which is written in this thread, at the beginning of "DeleteElementsFromArray" - the situation has not changed.

3) - I tried to draw all elements with the same X,Y values (all elements in one point), then immediately hide them (Hide()), then if necessary change their X,Y (XGap(...), YGap(...)) and draw them (Update(true); Show()). - Here is another problem - some of the elements are not hidden after hiding, and the other part - loses its LabelText (it is just visually absent).


What do you advise?
 
Mikhail Mitin:

added to WndContainer the function, which is written in this thread, at the beginning of "DeleteElementsFromArray" - the situation has not changed


I wrote that for simple elements. Combobox is not simple ) The current version should delete complex ones, but I haven't tested it yet, I think, and I need to change a lot of things there).

And for hiding I added m_is_hiden property to elements and in CWndEvents::Show(const uint window_index); elements with true are skipped.

 

Hey guys,

Developing business code that makes use of graphical elements panels is one thing and this library is very helpful. However, when it comes to low performance or bugs that need to be reproduced,

there is nearly no way around the Strategy Tester.

That said, trying to fix things in a live chart is extremly tedious (e.g. waiting until certain conditions are met so I can click on graphical elements... gah)

It would be beyond helpful if we could properly test stuff within the ST!


1. Did the MetaTrader dev team talk somewhere on the forum about it why void OnChartEvent is not being triggered in the ST?

2. Is there any chance to establish a workaround?


Cheers,
Marcel

 

The macro in the file Defines.mqh

#define  TO_STRING(A) #A

is not compatible with Alglib {ap.mqh)

class CSerializer
  {
   //--- enumeration
   enum SMODE { DEFAULT,ALLOC,TO_STRING,FROM_STRING };

I had to rename it.

 

After installing the platform update on 2132, compilation errors appeared:

  • 'WndEvents.mqh' - 'CWndContainer::~CWndContainer' - cannot access protected member function WndEvents.mqh 11 27
  • 'CWndEvents::~CWndEvents' - cannot access protected member function WndCreate.mqh 10 27


How to fix:

  • in the file "WndContainer.mqh" at the constructor and destructor of "CWndContainer" replace "protected" with "public"
  • in the file "WndEvents.mqh" replace "protected" with "public" in the constructor and destructor of the "CWndCreate" file
  • in the file "WndCreate.mqh" replace "protected" with "public" in the constructor and destructor of "CWndCreate".