Discussion of article "How to create a graphical panel of any complexity level" - page 13

 

Hello!

Could you please tell me why your panel works fine on a real chart, but does not work in the strategy tester?

That is, events of button presses, for example, are not processed.

How can I fix it?

Thanks in advance!

 
The panel is better to use from another language on mt5 will purely depend on the terminal and thechart
 
Vitaliy Davydov strategy tester?

That is, events of button presses, for example, are not processed.

How can I fix it?

Thanks in advance!

I posted a working solution with buttons a couple of years ago. But Edit fields do not work in MT5 tester. Although you can add small +/- buttons next to the Edit field and edit through them. But there will be its own nuances.
 
ON_MOUSE_FOCUS_KILL does not seem to be used in any way. Nothing happens when you add it to Map. You can also comment out ON_MOUSE_FOCUS_KILL and the compiler will skip it.
 

Hello!

I create a panel inherited from CDialog (or from CWndContainer, no difference).

If I create a panel in the main window of the chart, everything works - the panel is moved with the mouse and closed with the close button.

If I create a panel in a subwindow, then nothing works - the panel is immobile and does not react to the close button.

Question - how to make the panel react normally to events of the chart in the subwindow?

 

Hello, I managed to make my panel successfully. Thank you very much for your amazing tutorial.

 
Vasiliy Pushkaryov #:
A couple of years ago I posted a working solution with buttons. But Edit fields do not work in MT5 tester. Although you can add small +/- buttons next to the Edit field and edit through them. But there will be its own nuances.

Good afternoon!

Thank you, I figured it out.

Now other problems - all these panels from the standard library,

are absolutely non-functional in MT4 tester in the test visualisation mode.

Is there any global solution to this problem, so that I don't have to dance with tambourine for each control?

 
Vitaliy Davydov #:

Good afternoon!

Thanks, got it sorted out.

Now other problems - all these panels are from the standard library,

are absolutely non-functional in the MT4 tester in the test visualisation mode.

Is there any global solution to this problem, so that I don't have to dance with tambourine for each control?

What do you mean non-functional? In my MT4 tester they fulfil their functions.

I gave an example when I inherited from CButton and added cMyButton::isButtonPushed() function to work with the tester.

I did the same for CEdit, CCheckBox and then I always use my inheritors. This is a one-time job.

In the TestPush file there was a sample function checkPushingButtons():

void OnTick()
{
    if(MQLInfoInteger(MQL_VISUAL_MODE)) ExtDialog.checkPushingButttons();
}

//+------------------------------------------------------------------------------------------------------------------+
//| For the tester and OnTick. Let's check if the button (or object) is pressed
//+------------------------------------------------------------------------------------------------------------------+
void CAppWindowCorrectMinimization::checkPushingButttons()
{
   if(m_button1.isButtonPushed())    print1();
   if(m_button2.isButtonPushed())    print2();
}


Here is from my working code:

//+------------------------------------------------------------------------------------------------------------------+
//| For the tester and OnTick. Let's check if the button (or object) is pressed
//+------------------------------------------------------------------------------------------------------------------+
void cInterface::checkPushingButttons()
{
  if(btnOnOff.isButtonPushed())    OnClickOnOff();
  if(btnLong.isButtonPushed())     OnClickLong();
  if(btnShort.isButtonPushed())    OnClickShort();

  if(btnCloseOff.isButtonPushed()) OnClickCloseOff();
  if(btnProtocol.isButtonPushed()) OnClickProtocol();
  if(btnOpposMA6.isButtonPushed()) OnClickOpposMA6();

  if(editMA2plus.isEditChanged())  OnEditMA2plus();
  if(editPunct.isEditChanged())    OnEditPuncture();

I.e. in the end the difference with working without a tester and in a tester comes down to adding a single function checkPushingButttons(), where we add a string to each control, and check via tick whether it's a push or an input.

Prepare templates, do it a couple of times, I think, then you will get used to it.

 

Hello Vladimir,
first i also like to thank you for your great tutorial. I found a problem in using it in a template: Just put any of your applications into a template of an empty chart. After loading this template the application will come up twice like shown in the picture. Do you have any idea how to fix this?

Thank you in advance

Files:
 

Why is the panel/window cannot be dragged/moved past the chart boundaries? 

What is the difference with Anatoli's easyfastgui library?