ja tylko zrobiłem to dla Mac, ale ogólna idea jest taka, że zaimplementować własną IFMXCursorService. Należy pamiętać, że jest to podejście całkowicie lub bezużyteczne. Będziesz musiał również zaimplementować domyślne kursory FMX.
type
TWinCursorService = class(TInterfacedObject, IFMXCursorService)
private
class var FWinCursorService: TWinCursorService;
public
class constructor Create;
procedure SetCursor(const ACursor: TCursor);
function GetCursor: TCursor;
end;
{ TWinCursorService }
class constructor TWinCursorService.Create;
begin
FWinCursorService := TWinCursorService.Create;
TPlatformServices.Current.RemovePlatformService(IFMXCursorService);
TPlatformServices.Current.AddPlatformService(IFMXCursorService, FWinCursorService);
end;
function TWinCursorService.GetCursor: TCursor;
begin
// to be implemented
end;
procedure TWinCursorService.SetCursor(const ACursor: TCursor);
begin
Windows.SetCursor(Cursors[ACursor]); // you need to manage the Cursors list that contains the handles for all cursors
end;
To może być konieczne, aby dodać flagę do TWinCursorService tak, że będzie ona zapobiec ramy FMX, aby zastąpić kursor.
Czas jest ważny podczas rejestrowania własnej usługi kursora. Musi to być zrobione po wywołaniach FMX TPlatformServices.Current.AddPlatformService (IFMXCursorService, PlatformCocoa);
szukasz rozwiązania wieloplatformowego? – RRUZ
@RRUZ w tej chwili potrzebuję go tylko do okien, aby zmienić kursor na viewport3d – Saeed