Need help for my panel so it will not reload each time i change a timeframe

 

Hi guys, 
I've created an indicator with a panel, using CappDialog class.. 

The problem is that each time i change the time frame on the chart, the panel is like reloaded at its default position and settings.

I tried two different approaches, the first one where eveything is on the same file and the second one with two separate files, one for the panel and the other one for the indicator..

Im missing something ! Plese help 

 
Chaoui Karim:

Hi guys, 
I've created an indicator with a panel, using CappDialog class.. 

The problem is that each time i change the time frame on the chart, the panel is like reloaded at its default position and settings.

I tried two different approaches, the first one where eveything is on the same file and the second one with two separate files, one for the panel and the other one for the indicator..

Im missing something ! Plese help 

Store the parameters in a file , on load pull the parameters up if the file exists

 
CAppDialog has a function for it. Just call dialog.IniFileLoad(); after create the dialog in OnInit. Of course not everything will work perfeclty ( like everything in the library, doesn't work ) but is a good start.
 
Thanks Samuel Ive used iniFileSave() as you have mentionned, the position of my panel is saved, also the state of buttons (i guess) and comboboxes, but the Cedit fields are put on defaut ... seems that it doesnt save them .. maybe i should save them separately ? or there is another way ? 
 
Chaoui Karim #:
Thanks Samuel Ive used iniFileSave() as you have mentionned, the position of my panel is saved, also the state of buttons (i guess) and comboboxes, but the Cedit fields are put on defaut ... seems that it doesnt save them .. maybe i should save them separately ? or there is another way ? 

Save and Load methods are not implemented in CEdit.

Just create a new control derived from CEdit and implement the Save and Load methods. You can look at other controls like CButton as example, but you will save a string instead of integer. Then you replace the CEdit on your app by the new control.

** actually check CCheckBox as example, because CButton also doesn't implement it.

** if you use other controls, check the source file if save and load is implemented for the controls that you are using, if not create your own control like said above and replace in your app.

 
Samuel Manoel De Souza #:

Save and Load methods are not implemented in CEdit.

Just create a new control derived from CEdit and implement the Save and Load methods. You can look at other controls like CButton as example, but you will save a string instead of integer. Then you replace the CEdit on your app by the new control.

** actually check CCheckBox as example, because CButton also doesn't implement it.

** if you use other controls, check the source file if save and load is implemented for the controls that you are using, if not create your own control like said above and replace in your app.

Thanks friend, everything is working now.. Once it done, it looks very stupid as i had to think of it.  

And by the way.. Do you think i should sell my indicator ? Mmm ... it displays bars from different timeframes into the chart.. let say you are in 15min timeframe.. you can select two other timeframes on my panel, and select the number of bars you want to see for each of them, and you will get, in one chart other timeframes bars moving in realtime. And you can move them on X axis at the place you want ..