Le 20/02/2013 11:36, Hans-Peter Diettrich a écrit :
Antonio Fortuny schrieb:


Le 19/02/2013 19:34, Hans-Peter Diettrich a écrit :
Antonio Fortuny schrieb:
Hi folks.

Do you know an event or any other trick I could use when a form
re-gains control, i.e. is focused again ?
Events OnShow, OnActivate fire only once after OnCreate.

These were my candiates as well.

The form is brought to the foreground by the means of a
MyForm.BringToFront once a OtherForm.ShowModal returns. The reason is
because the WindowsCE forms stack control seems to be rubbish.

Sorry, I don't know how WinCE behaves in this case.
Very simple: when yo exit a modal displayed form you are not always
sure to have on the screen the form which displayed the closed one.
That's why I guess that forms stack is not very well managed

These are two problems. One is the Z order maintenance, and another one
which messages are sent. I only know from working on one program (C++),
that WinCE differs from traditional Windows behaviour.
I can aknowledge. This strange behaviour is what we see. This the reason why on ShowModal return a Self.BringToFront is performed and Z order stack problems are solved

 But when ShowModal
returns, you can do whatever is needed - e.g. invoke FormActivate or
whatever handler contains your specific code.
Yes, but the problem is that this main form shows two dozens of other
forms ! It's easy to gain control after ShowModal returns but the code
has to be repeated as many times as ther are forms to process.

AFAIR the LCL maintains a forms list in Z order (Application.Forms?),
which may be useful to establish the wanted Z order.

DoDi


--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to