Making CPanel solution more pretty

Christian Berrigan  


I've worked through issues I was having with behavior of a subclass of CPanel used in a custom indicator of mine.

My primary remaining issue was maintaining the maximized/minimized state of the panel when changing timeframes.

I solved this (after implementing other solutions toward this goal) by putting the following line of code in the deconstructor method of my subclass:


That causes the state of the panel to be saved to the ini file during a timeframe change so when it is re-created after changing timeframes it will be recreated in the correct state.

HOWEVER, in order for the code that generates the panel to create its contained objects properly, it must be maximized while they are created THEN minimized AFTER the panel is created, otherwise everything in the panel is drawn completely wrong.

This creates an ugly flash of maximized -> minimized every time I change timeframes.

I would love to freeze the graphical interface until this process of creating the panel then minimizing it is finished.

Does anyone know of a way to freeze the GUI while the panel is being created then unfreeze it when the process is complete?

If not, is it possible that somewhere in the process there is a ChartRedraw() I can bypass and that would solve my ugliness?

I can live with it if I must, but I like making things look clean.

Any advise is greatly appreciated.


Graphical Interfaces I: Preparation of the Library Structure (Chapter 1)
Graphical Interfaces I: Preparation of the Library Structure (Chapter 1)
This article is the beginning of another series concerning development of graphical interfaces. Currently, there is not a single code library that would allow quick and easy creation of high quality graphical interfaces within MQL applications. By that, I mean the graphical interfaces that we are used to in familiar operating systems.