Jump to content

Showmask in form´s callback


Clipe Informática

Recommended Posts

I have a situation where I call a form where some parameters are informed and after it I have a callback that runs a long process.


How do I put a screen mask during the execution of the routine inside the callback?


I've seen on another forum thread that I can do this in a MessageDlg callback by putting @@ inside the message text. But how do I do this in a form's callback?


I'm using commercial version 1.90.0.1537 licensed.

Link to comment
Share on other sites

Hi @Clipe Informática

If you are interested you may be checking out this component.

https://store.falconsistemas.com.br

https://demos.falconsistemas.com.br/?tela=tfrmconfirm

image.thumb.png.0a5ef0eb9962462d72e357e08bcf6b07.png

 

image.thumb.png.61e638fa058bbae7994cd630263b1a71.png

Sample code:

  try
    Confirm.ShowMask('Starting Processing...',10);
    Sleep(2000);
    Confirm.ShowMaskUpdate('Creating Order...',25);
    Sleep(2000);
    Confirm.ShowMaskUpdate('Processing Payment...',70);
    Sleep(2000);
    Confirm.ShowMaskUpdate('Ending Asking...',90);
    Sleep(1000);
    Confirm.ShowMaskUpdate('Ending Asking...',100);
    Sleep(1000);
    Confirm.Alert('Thanks for the purchase','Order 561560','far fa-check-circle',TTypeColor.green, TTheme.modern);
  finally
    Confirm.RemoveMask;
  end;

 

Link to comment
Share on other sites

17 hours ago, Clipe Informática said:

this demo also uses the MainModule.EnableSynchronousOperations option as True. Im trying to do the application without that.

are you having any problems related to MainModule.EnableSynchronousOperations?

Link to comment
Share on other sites

One solution is to use a ThreadTimer (RunOnce ...)

 

on FrameReady

or FormShow

begin

   UniSession.AddJS('MainForm.form.mask("Action in progress ...")');

end;

 

 

procedure TfReporting.OnThreadCreateReportTimer(Sender: TObject);

try

       // execute the long action

   finally
      UniSession.AddJS('MainForm.form.unmask()');
   end;
begin

end;

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...