Discussion of article "Custom Graphical Controls. Part 1: Creating a Simple Control" - page 2

 
Urain:

There are already enough examples of creating simple codes, but there are no examples of creating a successful class hierarchy or at least an easy-to-implement scheme of a universal, easily transformable product. Even standard classes from MQ often complicate the writing of programmes by laying down possibilities in advance.

That's what I mean.

You need a demonstration of the system as a whole first. ARCHITECTURE first. And showing - what place each brick - a particular controller - occupies in it.

And then move on to demonstration of the work of these controls (sorry for MFC, just a good picture).



 
sergeev:

Okay. This is very good.

If you talk about high-level functions in the second part, people will start using the article components faster.
I would still start with forms + buttons (+ inputbox) and then only in the third part talk about specific control components - lists, menus, etc.

After all, the task is to teach how to write such controls. But as long as there is no form where to insert them, the article will not give such a spectacular and necessary effect.
Besides, as soon as you give Form+Button (I mean 3 kinds - radio, push, check) + EditBox already in the second article, the user will see the classes as a whole and will be able to create his own controls independently.


To interact with the form, the control should have four methods Init(...), Show(X,Y), Hide(), Event(), everything will be exactly the same as now, when creating a control on the chart. So you can already write your own controllers.

Still, I will stick to my plan, in the third part there will be a form with all the controls on it - it will be more convenient to use as an example or a ready template - it will be necessary to remove something, to double something and everything, it will be more ready semi-finished product.

 
Integer:

I will stick to my plan after all, in the third part there will be a form with all controls on it.

ok. we'll wait for it :)
 

The topic is relevant...thanks for covering it....

However, after reading the article and comments, I thought that the essence of the algorithm is a bit difficult to implement.

I thought: wouldn't the following algorithm be simpler and more universal?

A panel with control buttons can be implemented in any language with a powerful editor (e.g. Visual Studio ).

and it (the programme for implementing the control panel with buttons and other features) works autonomously and independently of MT5.

The data results are entered into a file from which MT5 reads periodically (it is also good to start an interrupt).

Thus, the process of programming will be simplified and there will be universality (the ability to work with any programme and also with MT4).

Therefore, the main issue will be the docking of the resulting parameter file with the body of the programme.

In this direction I would like to see the evolution of MT5 and not in the banal expansion of functions....

And the exchange via RAM would not hurt either - it is still faster 1000 times, probably.

Also we can probably consider the connection via Web... It would be quite interesting.

What do you think?

 
I didn't understand the 4th principle. Could you give me some example?
 

I don't understand the fourth principle. Can you give me an example?

 
LeoAndriolo:

I don't understand the fourth principle. Can you give me an example?

Hi Leo, when you refer to the fourth principle, what exactly are you referring to? I understand that topic 4 of this article concerns "Workpieces for controls". Could you specify your question a little more?
 
Malacarne:
Hi Leo, when you refer to the fourth principle, what exactly are you referring to? I understand that topic 4 of this article concerns "Workpieces for controls". Could you specify your question a little further?
1.1.4
 

I would like to create a custom graphical object that is a combination of rectangles and boxes and a few bits of information. I will use this object often so ideally I'd like to to be easily accessible. Is it possible to add custom made graphical objects into the MT5 toolbar? If not, could you give some other suggestions please? 

 

Strange...

Для примера, один метод создания графического объекта вертикальная линия (OBJ_VLINE):

void CreateVLine(string aName,int aSubWindow=0,long aChartID=0)
  {
   ObjectCreate(m_id,m_name,OBJ_VLINE,aSubWindow,0,0);
   Attach(aName,aChartID);
  }

Isn't that how it's supposed to be

Для примера, один метод создания графического объекта вертикальная линия (OBJ_VLINE):

void CreateVLine(string aName,int aSubWindow=0,long aChartID=0)
  {
   Attach(aName,aChartID);
   ObjectCreate(m_id,m_name,OBJ_VLINE,aSubWindow,0,0);
  }

Or like this.

Для примера, один метод создания графического объекта вертикальная линия (OBJ_VLINE):

void CreateVLine(string aName,int aSubWindow=0,long aChartID=0)
  {
   ObjectCreate(aChartID,aName,OBJ_VLINE,aSubWindow,0,0);
   Attach(aName,aChartID);
  }