With Firemonkey, how to give feedback to the user? (CrHourglass)

Usually, when I have a task that takes some time, I use a script as follows:

procedure Work; var cPrevious: TCursor; begin cPrevious := Screen.Cursor; Screen.Cursor := crHourGlass; try // the task finally Screen.Cursor := cPrevious; end; end; 

With FireMonkey, the screen does not have the property: cursor.

What is the best way to give some user feedback?



I followed the comments and the answer ... with TPanel with less transparency and TAniIndicator (I also blur other components):

Feedback

Thanks!

+6
source share
3 answers

As @mjn pointed out, the hour cursor on the stack is no longer the only wait pattern you can use.

For example, in Silverlight / WPF, you can use the busy indicator, http://www.codeproject.com/KB/silverlight/SilverlightBusyIndicator.aspx

So, you can try to do something similar inside FireMonkey. There may be a similar control for you, or you can write your own.

+1
source

FireMonkey TScreen does not have a Cursor property, but the global platform instance has a SetCursor method:

uses FMX.Platform, System.UITypes;

... Platform.SetCursor (zero, crHourGlass); try ... eventually Platform.SetCursor (zero, crDefault); end;

+1
source

This works for me on XE3, FireMonkey2 works on XP:

 `Application.MainForm.Cursor:= crHourGlass;` 
+1
source

Source: https://habr.com/ru/post/897371/


All Articles