Usually, when I have a task which takes some time, I use a script like this:
procedure Work;
var
cPrevious: TCursor;
begin
cPrevious := Screen.Cursor;
Screen.Cursor := crHourGlass;
try
// the task
finally
Screen.Cursor := cPrevious;
end;
end;
With FireMonkey, Screen doesn't have a property: Cursor.
What is the best way to give some feedback to the user?
I followed the comments and the answer... with a TPanel which has less opacity, and a TAniIndicator (I also blur the other components):
Thank you!
Like @mjn pointed out, the glass hour cursor is no more the only wait pattern you can utilize.
For example, in Silverlight/WPF, you can use a busy indicator control, http://www.codeproject.com/KB/silverlight/SilverlightBusyIndicator.aspx
So you may try to do something similar inside FireMonkey. There may be a similar control for you to use already, or you can write your own.
Update: TAniIndicator is the component to use
FireMonkey TScreen has no Cursor property, but global Platform instance has a SetCursor method:
uses FMX.Platform, System.UITypes;
... Platform.SetCursor(nil, crHourGlass); try ... finally Platform.SetCursor(nil, crDefault); end;
This works for me on XE3, FireMonkey2 running on XP:
`Application.MainForm.Cursor:= crHourGlass;`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With