Jump to content
Luke

Form events sequence

Recommended Posts

Hi All,
i'm trying to show a new from from another with the code below :

FrmWait := TFrmWait.Create(nil);
TfgAnimationHelper.ShowForm(FrmWait);

The TfgAnimationHelper.ShowForm method lock the current Form when it exec the FrmWait.Create method.
I've tried to move my initializazion code from FrmWait.create to FrmWait.show but the initialization freeze the current form and only at the and i see the FrmWait. ( In windows environment i solve this problem with windows messages ).

Some one can help my ?
I'm following the wrong way ?

Thanks a lot

Share this post


Link to post
Share on other sites

Hi Yaroslav,
i attach my test project.

As you can see in the FrmLogin i call FrmWait with this code :

    FrmWait := TFrmWait.Create(nil);
    TfgAnimationHelper.ShowForm(FrmWait);

in FrmWait i've this method :

procedure TFrmWait.fgFormCreate(Sender: TObject);
begin
  TfgAnimationHelper.FadeOut(LblInfo, [TfgAnimationOption.StartFromCurrent], 0);

  LblInfo.Text:='Ciao Luca';
  TfgAnimationHelper.FadeIn(LblInfo, [TfgAnimationOption.StartFromCurrent], 500);
  Sleep(2000);
  TfgAnimationHelper.FadeOut(LblInfo, [TfgAnimationOption.StartFromCurrent], 500);

  sleep(500);

  LblInfo.Text:='Abbiamo quasi finito...';
  TfgAnimationHelper.FadeIn(LblInfo, [TfgAnimationOption.StartFromCurrent], 500);
  Sleep(2000);
  TfgAnimationHelper.FadeOut(LblInfo, [TfgAnimationOption.StartFromCurrent], 500);
end;

and this event freeze the current form.
I think i can fix with TfgCallBack from TfgAnimationHelper.ShowForm but i'm not sure and i don't know how to use it.

Thanks a lot.
FMX.7z

Share this post


Link to post
Share on other sites

Hi Yaroslav,
I've solved.

I've made a wrong usage of TfgAnimationHelper...
Thank you.

 

Share this post


Link to post
Share on other sites

The library is asynchronous in General. So if you use Sleep you freeze application main event loop. 

Please, consider using callbacks and events model for do it.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...