My panel breakout, when i change timeframe.

 

Dear Guys, I simply coding show panel on my chart. but My panel breakout when I change timeframe.  I attach screenshot where I show how my panel breakout.



below I my code:


int OnInit() {


   m_Symbol= _Symbol;

  

   
   if(ExtDialog.Create(0,m_Symbol,m_subwin,10,30,200,265)){
     //Text_Company_Name();
     //CreateLine_2();
     //Combo_execution();
     //Lot_Name_Text();
     //Price_Name_Text();
     //Button_execution();
     //Text_Web_Name();
     ExtDialog.Run();
    }else return(-1);
    ChartRedraw();
   
   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason){
   Comment("");
   ObjectsDeleteAll(0,GlobalObj);

   ExtDialog.Destroy(reason);
}
Files:
Capture.PNG  19 kb
 

I notice when change timeframe two panel was create. I don't know why it will happens.

First time attach on chart :

After time frame change on chart :


#include <Controls\Dialog.mqh>


CAppDialog  ExtDialog;



int OnInit() 
  {

   if(ExtDialog.Create(0,"Panel_Main",0,10,30,200,240))
     {
      ExtDialog.Run();
     }

   ChartRedraw();

   return(INIT_SUCCEEDED);
  }
  

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


void OnTick()
  {

  }


void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {

   ExtDialog.ChartEvent(id,lparam,dparam,sparam);


  }

Can anyone help. same code working previously . but not work in new build

 

you can add to check is it already exists, if it does, then skip creation.

doing so it will always check if it is already present and never create a second.

 
Marco vd Heijden:

you can add to check is it already exists, if it does, then skip creation.

doing so it will always check if it is already present and never create a second.


How can i check it, is my Panel is exists or not

 

check to see if

"Panel_Main"

exists.

if so skip, else create it.

 

This issue does not occur with the example dialogs, which inherit from CAppDialog . However, in your case, you are directly using CAppDialog for the object. Have you made any changes to the CAppDialog class?

 
Enrico Lambino:

This issue does not occur with the example dialogs, which inherit from CAppDialog . However, in your case, you are directly using CAppDialog for the object. Have you made any changes to the CAppDialog class?

no i didn't can give me a example
 
Marco vd Heijden:

check to see if

exists.

if so skip, else create it.

can you give any MQL code example where i check
 
Aadarsh Podiya:
can you give any MQL code example where i check

 example from MT4 

Files:
 
Trinh Dat:

 example from MT4 


Dear Trinh Dat,

You coding file also same happen . it break the window. It notice it will happen will you complied file with new build 880 then try it and see it is happens.  I think this BUGS in new builds. Because i hope you send me the file because u know that file is working well. but now it is not working well.


 
Oh, it ever work good. today it make error when compile again with new version MT4