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

 
MetaQuotes:

New article How to create a graphical panel of any complexity level has been published:

Author: Vladimir Karputov

Thank you very much for share. Excellent!

I missed just one thing in your example. You should help how to include data information as text and numbers.

For example:

Stop Loss Value:50.50

Take Profit Value: 250.00

Moving Average (200): 110.5.


Do you know any article to teach how to do this kind of thing?

 
Guilherme Mendonca :

Thank you very much for share. Excellent!

I missed just one thing in your example. You should help how to include data information as text and numbers.

For example:

Stop Loss Value:50.50

Take Profit Value: 250.00

Moving Average (200): 110.5.


Do you know any article to teach how to do this kind of thing?

Check out the standard panel examples in the MetaEditor.

 

Can you help me with this question.

I added the panel shift function setShift() to your "AppWindowTwoButtonsClass" file. Now if we move the chart border to the right and it comes close to the panel, the panel will start moving to the left along with the chart border.

void OnChartEvent(const int id,         // event ID 
                  const long& lparam,   // event parameter of the long type
                  const double& dparam, // event parameter of the double type
                  const string& sparam) // event parameter of the string type
  {
   ExtDialog.ChartEvent(id,lparam,dparam,sparam);
   if(id == CHARTEVENT_CHART_CHANGE) ExtDialog.setShift();
  }

The call of this function is highlighted in yellow.

The question is: is there any way to call this function through this pseudocode?

EVENT_MAP_BEGIN(cGPanel)            

EVENT_MAP_END(CAppDialog)

so that the call was made from the inheritor class and not from the global OnChartEvent() function.

I tried several defines: ON_NO_ID_EVENT(event,handler), ON_OTHER_EVENTS(handler). But I don't understand how they work.

I am attaching a file with the additional function setShift().

Документация по MQL5: Основы языка / Функции / Функции обработки событий
Документация по MQL5: Основы языка / Функции / Функции обработки событий
  • www.mql5.com
В языке MQL5 предусмотрена обработка некоторых предопределенных событий. Функции для обработки этих событий должны быть определены в программе MQL5: имя функции, тип возвращаемого значения, состав параметров (если они есть) и их типы должны строго соответствовать описанию функции-обработчика события. Именно по типу возвращаемого значения и по...
 
Very useful, thanks for posting.
Quick question,

How come you use the following;
//--- create application dialog
   if(!AppWindow.Create(0,"AppWindow",0,20,20,360,324))
      return(INIT_FAILED);
//--- run application
   AppWindow.Run();
//--- succeed
   return(INIT_SUCCEEDED);
  }
Instead of;
//--- create application dialog
   AppWindow.Create(0,"AppWindow",0,20,20,360,324));
//--- run application
   AppWindow.Run();
/
  }
Which I used in a mql4 GUI.

Is this an mql5 necessity or does it have other benefits?

Thanks
 
emargrie :
Very useful, thanks for posting.
Quick question,

How come you use the following;
Instead of;
Which I used in a mql4 GUI.

Is this an mql5 necessity or does it have other benefits?

Thanks

If YOU really do not see the difference, you urgently need to throw away the old terminal. The old terminal affects you badly. Unfortunately, the old terminal taught you to write very dangerous code - you are used to writing code WITHOUT CHECKS to return errors.

 
Vladimir Karputov:

If YOU really do not see the difference, you urgently need to throw away the old terminal. The old terminal affects you badly. Unfortunately, the old terminal taught you to write very dangerous code - you are used to writing code WITHOUT CHECKS to return errors.

It wasn't a dig at your post by any means, it was more of a question as to why this is done so I learn for it - my programming knowledge is very limited.

 
emargrie :

It wasn't a dig at your post by any means, it was more of a question as to why this is done so I learn for it - my programming knowledge is very limited.

I have already explained: you cannot write code that does not check for error returns.

 
Vladimir Karputov:

I have already explained: you cannot write code that does not check for error returns.

Thanks 
 

Hi Vladimir 

this is a well written piece, good job

regards  Paul

 
Paul Anscombe:

Hi Vladimir 

this is a well written piece, good job

regards  Paul

Thanks