Alister Christie from LearnDelphi.tv has a video up where he demonstrates changing the mouse cursor to the hourglass (or spinner) in Delphi XE5 Firemonkey. LearnDelphi.tv is a great resource of over 100 different videos (both free and paid) demonstrating how do to various things in Delphi. Obviously since most mobile devices don’t have cursors this example applies to Windows and OSX. This code should work in AppMethod and Delphi XE6 as well. This is his most recent video about Delphi Firemonkey. In the video he demonstrates how to acquire the IFMXCursorService interface from the TPlatformServices object which is contained in the FMX.Platform class. If you’ve ever done this in the Delphi VCL side of things the code will look familiar in that you set the cursor to crHourGlass and restore it back to it’s original state afterward. Sleep() is used in the example where you would have your real code that did work instead so that you can see the hourglass cursor in action. Finally farther into the he moved the code out into it’s own class called SmartCursor. Here is a sample of the code from the video: var
if TPlatformServices.Current.SupportsPlatformService(IFMXCursorService) then
CS := TPlatformServices.Current.GetPlatformService(IFMXCursorService) as IFMXCursorService;
if Assigned(CS) then
Cursor := CS.GetCursor;
// do some example work and then return the cursor to normal
FMXExpress.com has over 700 tips and tricks for building cross platform apps on Android, IOS, OSX, Windows, and Linux with a single codebase and single UI using the FireMonkey framework found in Delphi and C++Builder.
FMXExpress covers top cross platform secrets for FireMonkey in C++Builder and Delphi XE5, XE6, XE7, XE8, Seattle, Berlin, Tokyo, Rio, and Sydney.