In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Where to invoke TForm:RestoreState

Xailer professional forum in English
Responder
Stephan Hennekens
Mensajes: 305
Registrado: Jue Nov 30, 2006 12:17 am

Where to invoke TForm:RestoreState

Mensaje por Stephan Hennekens »

Hi Xailer developers,
I am puzzling where to put the TForm:RestoreState() method. If I place it in
the FormShow event one can see the movement of the window from the design
position to the restored position. Therefore I tried to place in in the
FormInitialize event and this shows immediatelty the restored position.
Great! But, now the FormShow event is fired TWICE, leading to undesired
behaviour. So my question is what actually the best place is to execute the
RestoreState() method.
A second problem is that a GPF is raised when setting the second parameter
of the RestoreState() method to FALSE when executed the method in the
FormShow() event. No GPF if the method is executed from the FormInitialize
event.
BTW, I am very, very pleased with the SQLite support. It rocks and makes all
sort of database queries a lot more faster than doing the same stuff with
dBase files.
Regards,
Stephan
Stephan Hennekens
Mensajes: 305
Registrado: Jue Nov 30, 2006 12:17 am

Where to invoke TForm:RestoreState

Mensaje por Stephan Hennekens »

I took a look at the source code the RestoreState method and saw that the
Show() event is called somewhere (That's why it GPS's when calling the
method in the Show() event). After removing this call the restore works as
expected.
Regards,
Stephan
"Stephan Hennekens" <stephan.hennekens@wur.nl> wrote in message
news:46d9cf1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi Xailer developers,
>
> I am puzzling where to put the TForm:RestoreState() method. If I place it
> in the FormShow event one can see the movement of the window from the
> design position to the restored position. Therefore I tried to place in in
> the FormInitialize event and this shows immediatelty the restored
> position. Great! But, now the FormShow event is fired TWICE, leading to
> undesired behaviour. So my question is what actually the best place is to
> execute the RestoreState() method.
>
> A second problem is that a GPF is raised when setting the second parameter
> of the RestoreState() method to FALSE when executed the method in the
> FormShow() event. No GPF if the method is executed from the FormInitialize
> event.
>
> BTW, I am very, very pleased with the SQLite support. It rocks and makes
> all sort of database queries a lot more faster than doing the same stuff
> with dBase files.
>
> Regards,
> Stephan
>
>
>
>
>
Stephan Hennekens
Mensajes: 305
Registrado: Jue Nov 30, 2006 12:17 am

Where to invoke TForm:RestoreState

Mensaje por Stephan Hennekens »

I took a look at the source code the RestoreState method and saw that the
Show() event is called somewhere (That's why it GPS's when calling the
method in the Show() event). After removing this call the restore works as
expected.
Regards,
Stephan
"Stephan Hennekens" <stephan.hennekens@wur.nl> wrote in message
news:46d9cf1d$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> Hi Xailer developers,
>
> I am puzzling where to put the TForm:RestoreState() method. If I place it
> in the FormShow event one can see the movement of the window from the
> design position to the restored position. Therefore I tried to place in in
> the FormInitialize event and this shows immediatelty the restored
> position. Great! But, now the FormShow event is fired TWICE, leading to
> undesired behaviour. So my question is what actually the best place is to
> execute the RestoreState() method.
>
> A second problem is that a GPF is raised when setting the second parameter
> of the RestoreState() method to FALSE when executed the method in the
> FormShow() event. No GPF if the method is executed from the FormInitialize
> event.
>
> BTW, I am very, very pleased with the SQLite support. It rocks and makes
> all sort of database queries a lot more faster than doing the same stuff
> with dBase files.
>
> Regards,
> Stephan
>
>
>
>
>
Responder