Einzelnen Beitrag anzeigen

DelphiUser123

Registriert seit: 23. Feb 2013
44 Beiträge
 
#3

AW: Eigener Cursor in Firemonkey

  Alt 13. Feb 2025, 20:31
Hier der Quellcode. Wo ist der Fehler?
Code:
unit Unit38;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Platform, windows;

type
  TForm38 = class(TForm)
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

type
  TWinCursorService = class(TInterfacedObject, IFMXCursorService)
  private
    class var FWinCursorService: TWinCursorService;
  public
    class constructor Create;
    procedure SetCursor(const ACursor: TCursor);
    function GetCursor: TCursor;
  end;

var
  Form38: TForm38;

implementation

{$R *.fmx}

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]);
 
end;

end.
  Mit Zitat antworten Zitat