1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Update to CEF 90.6.7

Added workaround to avoid a crash when the user clicks the right mouse button in Firemonkey for MacOS.
Added the click count to the mouse events to the Linux Firemonkey demo.
Added the ShowMessageCF function to show a message dialog in MacOS.
Added calls to FMX.Types.Log.d to write error messages in Firemonkey for Linux and MacOS.
This commit is contained in:
Salvador Díaz Fau
2021-05-27 14:29:30 +02:00
parent 44896524e8
commit b14abde967
12 changed files with 76 additions and 25 deletions

View File

@ -57,6 +57,7 @@ function KeyToMacOSKeyCode(aKey : Word): integer;
{$IFDEF FMX}
procedure CopyCEFFramework;
procedure CopyCEFHelpers(const aProjectName : string);
procedure ShowMessageCF(const aHeading, aMessage : string; const aTimeoutInSecs : double = 0);
{$ENDIF}
{$ENDIF}
@ -66,6 +67,7 @@ implementation
{$IFDEF FMX}
uses
System.SysUtils, System.Types, System.IOUtils, Posix.Stdio, FMX.Types,
Macapi.CoreFoundation,
uCEFMiscFunctions;
const
@ -365,6 +367,22 @@ begin
end;
end;
end;
procedure ShowMessageCF(const aHeading, aMessage : string; const aTimeoutInSecs : double = 0);
var
TempHeading, TempMessage : CFStringRef;
TempResponse : CFOptionFlags;
begin
TempHeading := CFStringCreateWithCharactersNoCopy(nil, PChar(aHeading), Length(AHeading), kCFAllocatorNull);
TempMessage := CFStringCreateWithCharactersNoCopy(nil, PChar(aMessage), Length(AMessage), kCFAllocatorNull);
try
CFUserNotificationDisplayAlert(aTimeoutInSecs, kCFUserNotificationNoteAlertLevel, nil, nil, nil, TempHeading, TempMessage, nil, nil, nil, TempResponse);
finally
CFRelease(TempHeading);
CFRelease(TempMessage);
end;
end;
{$ENDIF}
{$ENDIF}