Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 366

 
msl271170:

Thanks, I think I've got it.

And how do you run the debugger on historical data?


Happy to help.

Debugging is only possible on history in MT5.

 
Aleksey Vyazmikin:

Happy to help.

Debugging is only possible on history in MT5.


I understand that MT5 has a different programming language. Will my code not work there?

 
msl271170:

I understand that MT5 has a different programming language. Will my code not work there?

No one has seen your code. That's why it is difficult to say. But the languages are almost the same.
 

Attached here is a panel based on the example from SB. I've cleaned up the code to leave only what's relevant to the question, source code attached.



Can you tell me how to colour the header and the main area, on which we hook the elements?
It seems that these objects are in parent Dialog class,

private:
   //--- dependent controls
   CPanel            m_white_border;        // the "white border" object
   CPanel            m_background;          // the background object
   CEdit             m_caption;             // the window title object
   CBmpButton        m_button_close;        // the "Close" button object
   CWndClient        m_client_area;         // the client area object

And they have corresponding methods


But how do I get to the private fields correctly?

Files:
 
Vasiliy Pushkaryov:

Attached here is a panel based on the example from SB. I've cleaned up the code to leave only what's relevant to the question, source code is attached.



Can you tell me how to colour the header and the main area, on which we hook the elements?
It seems that these objects are in parent Dialog class,

And they have corresponding methods


But how do I get to the private fields correctly?

You have a list of methods of accessing these fields on the picture. Are the methods public?
 
Artyom Trishkin:
You have a list of methods of accessing these fields on the picture. Are the methods public?

No. I typed it in CDialog in the constructor, captured it, then put it all back

 
Artyom Trishkin:
You have a list of methods of access to these fields on the picture. Are the methods public?

There is a public method CDialog::CreateCaption(), CreateClientArea(). Panels are created there and their colours are set through CONTROLS_DIALOG_COLOR_BG and CONTROLS_DIALOG_COLOR_CLIENT_BG.

I have tried to override these variables in my class through undef and define them again. And then run Create... methods again, but since the objects have already been created a 4200 error is returned - the object already exists.

Added:

Error 4200 is when I checked in MT4.

 
Vasiliy Pushkaryov:

There is a public method CDialog::CreateCaption(), CreateClientArea(). Panels are created there and their colours are set through CONTROLS_DIALOG_COLOR_BG and CONTROLS_DIALOG_COLOR_CLIENT_BG.

I have tried to override these variables in my class through undef and define them again. And then run Create... methods again, but since the objects have already been created a 4200 error is returned - the object already exists.

Added:

The 4200 error is when I checked in MT4.

I've honestly never used these SB resources. But what prevents you from looking in SB where there, by what methods, the colours are set. What you showed in the listing:

private:
   //--- dependent controls
   CPanel            m_white_border;        // the "white border" object
   CPanel            m_background;          // the background object
   CEdit             m_caption;             // the window title object
   CBmpButton        m_button_close;        // the "Close" button object
   CWndClient        m_client_area;         // the client area object

- are object names - CPanel, CEdit, CBmpButton and CWndClient classes.

And you need to find names of members of these classes where colours are stored and use which methods they can be initialized or changed.

And you'll probably have to initialize them first and then build the object itself.

 

Hello!

When compiling it gives out"undeclared identifier" (undeclared identifier)

I searched and searched, but did not understand what I should do to fix the error

Help, please!

Files:
Image_2.jpg  524 kb
 
Kedrov: When compiling,"undeclared identifier" appears
Click on the error message. The cursor will point to the variable name. It must be declared
Reason: