Página 1 de 1

Where to invoke TForm:RestoreState

Publicado: Sab Sep 01, 2007 10:44 pm
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

Where to invoke TForm:RestoreState

Publicado: Dom Sep 02, 2007 7:46 pm
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
>
>
>
>
>

Where to invoke TForm:RestoreState

Publicado: Dom Sep 02, 2007 7:46 pm
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
>
>
>
>
>