Clipe Informática Posted October 8, 2020 Share Posted October 8, 2020 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. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted October 8, 2020 Share Posted October 8, 2020 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 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; Quote Link to comment Share on other sites More sharing options...
Clipe Informática Posted October 8, 2020 Author Share Posted October 8, 2020 tks but im looking for something native to unigui. by the way, in that component, do i have to active the MainModule.EnableSynchronousOperations option as True? Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted October 8, 2020 Share Posted October 8, 2020 Understand For this new component you must activate this option. Native component you can use this one: C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\ShowProgress Quote Link to comment Share on other sites More sharing options...
Clipe Informática Posted October 8, 2020 Author Share Posted October 8, 2020 2 hours ago, Marlon Nardi said: C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\ShowProgress this demo also uses the MainModule.EnableSynchronousOperations option as True. Im trying to do the application without that. Quote Link to comment Share on other sites More sharing options...
Marlon Nardi Posted October 9, 2020 Share Posted October 9, 2020 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? Quote Link to comment Share on other sites More sharing options...
Clipe Informática Posted October 9, 2020 Author Share Posted October 9, 2020 actually i did not have any problems. but the documentation says it's better to build de app without that option on. However as im migrating a VLC app I dont think im gonna escape from that right now. Quote Link to comment Share on other sites More sharing options...
azago Posted October 9, 2020 Share Posted October 9, 2020 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; Quote Link to comment Share on other sites More sharing options...
azago Posted October 9, 2020 Share Posted October 9, 2020 obviously in on FrameReady or FormShow begin UniSession.AddJS('MainForm.form.mask("Action in progress ...")'); .OnThreadCreateReport.Enabled := True; end; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.