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

 
Vasiliy Pushkaryov:
I haven't come across it yet. I don't know. Stanislav answers one of the questions in post 27 of this thread, Disable of the standard library is also touched upon there, have a look.

applied the Visible() method

breathes as I need

and another thanks to MQ for MQL, of course.

well, everything can be realised, any fantasy ;)
 

Hello you two,

I can't thank you both often enough. I've often stumbled across some absolutely rubbish programme code here and thanks to your criticism I've saved myself a lot of time searching for the meaning of this type of programming.
Is there a reasonable description of the complete MQL syntax translated into German somewhere?

Die Ersetzung des CWndContainer
Die Ersetzung des CWndContainer
  • www.mql5.com
Diese Datei ersetzt die originale Datei WndContainer.mqh. Er verhindert die Veränderung des Charts beim Druck und bei der Haltung der Maus-Taste innerhalb im Bereichs des Containers.
 
Joosy:

Hello you two,

I can't thank you both often enough. I've often stumbled across some absolutely rubbish programme code here and thanks to your criticism I've saved myself a lot of time searching for the meaning of this type of programming.
Is there a reasonable description of the complete MQL syntax translated into German somewhere?

  1. https://www.mql5.com/files/pdf/mql5_german.pdf
  2. https://www.mql5.com/en/docs/function_indices
    This is a list in which you can search for keywords with Ctrl+F according to the motto, what was the name again...
  3. In the editor, you can place the mouse over an MQL5 function and press F1 to go directly to the documentation of this function, some with examples...
 
Carl Schreiber:
  1. https://www.mql5.com/files/pdf/mql5_german.pdf
  2. https://www.mql5.com/en/docs/function_indices
    This is a list in which you can search for keywords with Ctrl+F according to the motto, what was the name again...
  3. In the editor, you can place the mouse over an MQL5 function and press F1 to go directly to the documentation for this function, some with examples...
Basically, I know the documentation. However, I am once again inspired by the links you provided to the overview display. From this point of view, it is a different approach.
Thank you!
 
Joosy:
Basically, I know the documentation. However, I am once again inspired by the links you provided to the overview display. From this point of view, it is a different approach.
Thank you!

I also tried the panels, but it doesn't really work for me because it's always in the chart window.

Now I've gone over and placed the whole thing in an indicator window, which I always have at the bottom of the chart

 

yep, to create a panel you need to understand dozens of lines of code and then make dozens and more.... It was expected that the functionality is already implemented, which is selected or enabled (Enable), but - no!!!!

with all due respect, but I didn't see from simple to complex. I'm going to draw squares and wrap them in my wrappers.

PS: files to articles better to post separately - available to view in browser.

 

Hi Vladimir,


Thank you so much for the article, its very helpful.  I was just wondering about some parts on changing the color of the m_client_area and m_background objects:

   int total=AppWindow.ControlsTotal();
   CWndClient*myclient;
   for(int i=0;i<total;i++)
     {
      CWnd*obj=AppWindow.Control(i);
      string name=obj.Name();
      PrintFormat("%d is %s",i,name);
      //--- color 
      if(StringFind(name,"Client")>0)
        {
         CWndClient *client=(CWndClient*)obj;
         client.ColorBackground(clrRed);
         myclient=client;
         Print("client.ColorBackground(clrRed);");
         ChartRedraw();
        }
      //---
      if(StringFind(name,"Back")>0)
        {
         CPanel *panel=(CPanel*) obj;
         panel.ColorBackground(clrGreen);
         Print("panel.ColorBackground(clrGreen);");
         ChartRedraw();
        }
     }

The highlighted parts are the items I wasn't sure about. To break it down, I understand what all of the code does, just not sure how it does it.  I wasn't about the two codes below:


1.Is it accessing a Control file like WndClient.mqh and what is the * for.

CWndClient *client=(CWndClient*)obj;

2. My other question was what are obj and Name(); as shown below.  I get obj is probably an object and the name part is for the name of the object.  However if I put obj.Name(); into any other code it doesn't understand it, so I know its unique to something from above.  I just wasn't sure how it fits in.

obj.Name();


I appreciate if you have the time to answer, and thank you in advance.

 
ctrading :

***

2. My other question was what are obj and Name(); as shown below.  I get obj is probably an object and the name part is for the name of the object.  However if I put obj.Name(); into any other code it doesn't understand it, so I know its unique to something from above.  I just wasn't sure how it fits in.

obj.Name();

***

The obj variable lives only during one iteration of the for loop .

 

Thanks a lot for your article!

I'm a begginer programmer and I'm trying to create a much more complex panel.

I'm stucked some days to create CLabel and CButton in the class header.

As I'll use a lot of labels with the same text, like a "dash" for example

I'm trying to find some kind of looping or an array to create a lot of Labels in the class header (private):

class CTradePanel : public CAppDialog
  {
private:
   
   CLabel            dashs[100];   //Create a lot of dashs on panel
  }


How can I fill an array with "labels"?

My idea is after that, I will call some kind of function bellow:

for(int i=0 ; i<100 ; i++)
      {
       string dash_name = "dash_"+IntegerToString(i);
       if(!CreateLabel(chart,subwin,dash_name,"-",5*i,5*i))
         {
          return false;
         }
      }

But, it return the error: "'dash_name' - parameter conversion not allowed"

So. How can I fill an array with "CLabel" and than I use this "labels" in a for looping function? 

Is there anyone could help me?

 
Guilherme Mendonca :

Thanks a lot for your article!

I'm a begginer programmer and I'm trying to create a much more complex panel.

I'm stucked some days to create CLabel and CButton in the class header.

As I'll use a lot of labels with the same text, like a "dash" for example

I'm trying to find some kind of looping or an array to create a lot of Labels in the class header (private):


How can I fill an array with "labels"?

My idea is after that, I will call some kind of function bellow:

But, it return the error: "'dash_name' - parameter conversion not allowed"

So. How can I fill an array with "CLabel" and than I use this "labels" in a for looping function? 

Is there anyone could help me?

You need to connect the CArrayObj class. And act on the example of the help.

Documentation on MQL5: Standard Library / Data Collections / CArrayObj
Documentation on MQL5: Standard Library / Data Collections / CArrayObj
  • www.mql5.com
CArrayObj - Data Collections - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5