Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiDemoFiremonkeyIOS

Build A Dialog Like UIActivityIndicatorView For Delphi XE5 Firemonkey

Delphi XE5 Firemonkey Working DialogI put together a demo of a Working Dialog form for Delphi XE5 Firemonkey mobile projects. I mainly built it for IOS to look like UIActivityIndicatorView but I’ve modified it so that it also works on Android. Basically it has a form called TWorkingForm that you can display any time you want to do an operation that may freeze up the app. The dialog is designed to look like the native IOS working dialog. The Transparency property is set to True and the BorderStyle is set to bsNone on the TWorkingForm. On IOS this allows you to have a transparent form that floats over your main form. The main reason why you would want to use a form like this instead of just having a TLayout on your main form is because of TWebBrowser or any other native control. TWebBrowser wraps around UIWebView which hovers over your form and above any TLayout as far as I can tell. This also applies to any of the native controls from TMS iCL. When you use the TWorkingForm dialog it will be above the TWebBrowser. For Android I couldn’t get the transparent form working so instead it takes a screenshot using MakeScreenShot and uses that as the background of TWorkingForm. You could take the WorkingPanel which is a TRectangle from the TWorkingForm and just add it to your own project if you don’t use any native controls that it has to float over. Here is the function that you can use to call TWorkingForm:

In the demo the example work is a TRESTClient that uses ExecuteAsync. When ExecuteAsync comes back in the OnAfterExecute event you hide the TWorkingForm. I did not use an extra thread to make this TWorkingForm happen (check out our other post for a multithreaded working dialog). You could combine this working form with the multithreaded working form to get the best of both.

Download The Delphi XE5 Firemonkey Working Dialog Demo

close

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

DelphiIDEShowcaseWindows

Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores

DelphiFiremonkeyIDEIOSOSXWindows

DelphiCon 2020 FireMonkey Sessions Available Starting November 19

AndroidC++BuilderDelphiDemoFiremonkeyWindows

Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

Leave a Reply