Cocoa/Cursor: TCursorHelper.ForceSetDefaultCursor() added

This commit is contained in:
rich2014 2023-09-17 17:03:05 +08:00
parent b6739bcc36
commit ec8affdaa1

View File

@ -24,6 +24,7 @@ type
_lastCursor: NSCursor;
public
procedure SetNewCursor( newCursor:TCocoaCursor );
procedure ForceSetDefaultCursor;
public
class procedure SetCursorOnActive;
class procedure SetCursorAtMousePos;
@ -380,6 +381,15 @@ begin
end;
end;
procedure TCursorHelper.ForceSetDefaultCursor;
var
newCursor: TCocoaCursor;
begin
newCursor:= TCocoaCursor(Screen.Cursors[crDefault]);
newCursor.SetCursor;
_lastCursor:= newCursor.Cursor;
end;
class procedure TCursorHelper.SetCursorOnActive;
begin
CursorHelper._lastCursor:= nil;