Another CPanelDialog

 

Hi,


Is it possibel to have 2 CPanelDialog on a chart? i mean i have a main CPanelDialog to have all the conditions of an EA, when i "check" the check box "view status", another CPanelDialog will appear with all status of the ea within it, the problem is when i "uncheck" the box function would be to remove the 2nd CPanelDialog in which it will not work not unless you close or unload both CPanelDialog.


I hope someone can help me with this one.


Thanks...

 
Is it possibel to have 2 CPanelDialog on a chart?

I haven't tried it, but it should be possible.

My thought is you would create both panels during OnInit() and simply hide the 2nd panel until you needed it.

Pseudo-code, not tested, not complete:

int OnInit()
{
    // panel 1
    ExtDialog1.Create(...);
    ExtDialog1.Run();

    // panel 2
    ExtDialog2.Create(...);
    ExtDialog2.Hide();
    ExtDialog1.Run();
}

void OnDeinit(const int reason)
{
    ExtDialog1.Destroy(reason);
    ExtDialog2.Destroy(reason);
}

. . . then in your code for the checkbox . . . 

    if ( showing )
    {
        ExtDialog2.Hide();
    }
    else
    {
        ExtDialog2.Show();
    }
 
Anthony Garot:

I haven't tried it, but it should be possible.

My thought is you would create both panels during OnInit() and simply hide the 2nd panel until you needed it.

Pseudo-code, not tested, not complete:

Thanks.


But the problem now is that when mt4 client terminal updates to the new release, CPanel objects behaving weird, like combobox does not function anymore. Buttons also does not work, i mean i created 2 buttons with different event which is mapped to each button but when i press the 2nd button, the function of the 1st button will execute. I dont know if you have also experience this.
 

I am facing these kinds of problems.

Actually, my ea has 5 CDialog object

Yes, I had testing almost thousands of times.

Finally. my conclusion is 

You can have multiple CAppDialog, but you can only initializing them on the method of init()

If you attempt to initialize a CAppDialog after EA had initialized. you will fail to initialize

If you want to initialize a dialog instantly. temporarily. Like create a message dialog, you can create a new base include and inherited from CDialog instead of CAppDialog.

The difference between CAppDialog and CDialog is, CAppDialog has a method which is run() and once your register your own CAppDialog on OnChartEvent, you could handle minimized, the event of controls, such as ListView, RadioGroup, base move dialog XY by drag... etc

These functions are not available for CDialog except Buttons click and base move dialog XY by drag.

Finally, the nasty problem is multiple CAppDialog, the event between controls of them will respond at the same time. My EA had only one dialog which includes controls to change things I wish to.

and the others are just only function to show some info. so I choose to create a CAppDialog and other multiple CDialog. Now the problem is just not as nasty as before...

Hope better solutions come out..

.

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...
Reason: