diff --git a/README.md b/README.md index a2be4415..e6000dc6 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ CEF4Delphi is an open source project created by Salvador D CEF4Delphi is based on DCEF3, made by Henri Gourvest. The original license of DCEF3 still applies to CEF4Delphi. Read the license terms in the first lines of any *.pas file. -CEF4Delphi uses CEF 79.1.27 which includes Chromium 79.0.3945.117. +CEF4Delphi uses CEF 79.1.31 which includes Chromium 79.0.3945.117. The CEF binaries used by CEF4Delphi are available for download at spotify : -* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_79.1.27%2Bgd2449e5%2Bchromium-79.0.3945.117_windows32.tar.bz2) -* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_79.1.27%2Bgd2449e5%2Bchromium-79.0.3945.117_windows64.tar.bz2) +* [32 bits](http://opensource.spotify.com/cefbuilds/cef_binary_79.1.31%2Bgfc9ef34%2Bchromium-79.0.3945.117_windows32.tar.bz2) +* [64 bits](http://opensource.spotify.com/cefbuilds/cef_binary_79.1.31%2Bgfc9ef34%2Bchromium-79.0.3945.117_windows64.tar.bz2) CEF4Delphi was developed and tested on Delphi 10.3 Rio and it has been tested in Delphi 7, Delphi XE, Delphi 10, Delphi 10.2 and Lazarus 2.0.6/FPC 3.0.4. CEF4Delphi includes VCL, FireMonkey (FMX) and Lazarus components. diff --git a/demos/Delphi_FMX/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas b/demos/Delphi_FMX/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas index 8e0271dd..fb509150 100644 --- a/demos/Delphi_FMX/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas +++ b/demos/Delphi_FMX/FMXExternalPumpBrowser/uFMXExternalPumpBrowser.pas @@ -52,7 +52,7 @@ uses FMX.Graphics, {$ENDIF} uCEFFMXChromium, uCEFFMXBufferPanel, uCEFFMXWorkScheduler, - uCEFInterfaces, uCEFTypes, uCEFConstants; + uCEFInterfaces, uCEFTypes, uCEFConstants, uCEFChromiumCore; type TFMXExternalPumpBrowserFrm = class(TForm) @@ -350,6 +350,23 @@ begin else if (Key <> 0) and (KeyChar = #0) then begin + if (Key = VK_RETURN) then + begin + // FMX doesn't trigger this event with a KeyChar<>0 + // to send a KEYEVENT_CHAR event for the VK_RETURN key. + // We add it manually before the KEYEVENT_KEYUP event. + TempKeyEvent.kind := KEYEVENT_CHAR; + TempKeyEvent.modifiers := getModifiers(Shift); + TempKeyEvent.windows_key_code := VK_RETURN; + TempKeyEvent.native_key_code := 0; + TempKeyEvent.is_system_key := ord(False); + TempKeyEvent.character := #0; + TempKeyEvent.unmodified_character := #0; + TempKeyEvent.focus_on_editable_field := ord(False); + + chrmosr.SendKeyEvent(@TempKeyEvent); + end; + TempKeyEvent.kind := KEYEVENT_KEYUP; TempKeyEvent.modifiers := getModifiers(Shift); TempKeyEvent.windows_key_code := Key; diff --git a/demos/Delphi_FMX/FMXToolBoxBrowser/uChildForm.pas b/demos/Delphi_FMX/FMXToolBoxBrowser/uChildForm.pas index 26c6d5c8..8a92c69f 100644 --- a/demos/Delphi_FMX/FMXToolBoxBrowser/uChildForm.pas +++ b/demos/Delphi_FMX/FMXToolBoxBrowser/uChildForm.pas @@ -48,9 +48,6 @@ uses uCEFFMXChromium, uCEFFMXWindowParent, uCEFInterfaces, uCEFConstants, uCEFTypes, uCEFChromiumCore; -const - CEF_SHOWBROWSER = WM_APP + $101; - type TChildForm = class(TForm) FMXChromium1: TFMXChromium; diff --git a/demos/Delphi_FMX/FMXToolBoxBrowser/uMainForm.pas b/demos/Delphi_FMX/FMXToolBoxBrowser/uMainForm.pas index 242b92ce..e221d3a2 100644 --- a/demos/Delphi_FMX/FMXToolBoxBrowser/uMainForm.pas +++ b/demos/Delphi_FMX/FMXToolBoxBrowser/uMainForm.pas @@ -53,6 +53,7 @@ uses const CEF_CHILDDESTROYED = WM_APP + $100; CEF_INITIALIZED = WM_APP + $101; + CEF_SHOWBROWSER = WM_APP + $102; type TMainForm = class(TForm) @@ -92,7 +93,6 @@ type public procedure DoCEFInitialized; - procedure DoChildDestroyed; procedure SendChildDestroyedMsg; property ChildClosing : boolean read GetChildClosing; @@ -211,8 +211,15 @@ begin UpdateCustomWindowState; end; - CEF_INITIALIZED : DoCEFInitialized; - CEF_CHILDDESTROYED : DoChildDestroyed; + CEF_CHILDDESTROYED : + if FClosing and (ChildFormCount = 0) then + begin + // If there are no more child forms we can destroy the main form + FCanClose := True; + PostCustomMessage(WM_CLOSE); + end; + + CEF_INITIALIZED : DoCEFInitialized; end; aMessage.Result := CallWindowProc(FOldWndPrc, FmxHandleToHWND(Handle), aMessage.Msg, aMessage.wParam, aMessage.lParam); @@ -402,16 +409,6 @@ begin cursor := crDefault; end; -procedure TMainForm.DoChildDestroyed; -begin - // If there are no more child forms we can destroy the main form - if FClosing and (ChildFormCount = 0) then - begin - FCanClose := True; - PostCustomMessage(WM_CLOSE); - end; -end; - procedure TMainForm.SendChildDestroyedMsg; begin PostCustomMessage(CEF_CHILDDESTROYED); diff --git a/demos/Delphi_FMX/SimpleFMXBrowser/uSimpleFMXBrowser.pas b/demos/Delphi_FMX/SimpleFMXBrowser/uSimpleFMXBrowser.pas index 845ae88e..94170c33 100644 --- a/demos/Delphi_FMX/SimpleFMXBrowser/uSimpleFMXBrowser.pas +++ b/demos/Delphi_FMX/SimpleFMXBrowser/uSimpleFMXBrowser.pas @@ -137,8 +137,8 @@ implementation // or the domain "google.com". If you don't live in the US, you'll be redirected to // another domain which will take a little time too. -// This demo uses a TFMXChromium and a TFMXWindowParent. -// TFMXApplicationService is used to handle custom Windows messages +// This demo uses a TFMXChromium and a TFMXWindowParent. It replaces the original WndProc with a +// custom CustomWndProc procedure to handle Windows messages. // All FMX applications using CEF4Delphi should add the $(FrameworkType) conditional define // in the project options to avoid duplicated resources. diff --git a/packages/cef4delphi_lazarus.lpk b/packages/cef4delphi_lazarus.lpk index 99c2ea6f..cd66f493 100644 --- a/packages/cef4delphi_lazarus.lpk +++ b/packages/cef4delphi_lazarus.lpk @@ -21,7 +21,7 @@ - + diff --git a/source/uCEFApplicationCore.pas b/source/uCEFApplicationCore.pas index f3218847..bb6d6881 100644 --- a/source/uCEFApplicationCore.pas +++ b/source/uCEFApplicationCore.pas @@ -62,7 +62,7 @@ uses const CEF_SUPPORTED_VERSION_MAJOR = 79; CEF_SUPPORTED_VERSION_MINOR = 1; - CEF_SUPPORTED_VERSION_RELEASE = 27; + CEF_SUPPORTED_VERSION_RELEASE = 31; CEF_SUPPORTED_VERSION_BUILD = 0; CEF_CHROMEELF_VERSION_MAJOR = 79; diff --git a/update_CEF4Delphi.json b/update_CEF4Delphi.json index 998cf7ef..95696900 100644 --- a/update_CEF4Delphi.json +++ b/update_CEF4Delphi.json @@ -2,9 +2,9 @@ "UpdateLazPackages" : [ { "ForceNotify" : true, - "InternalVersion" : 82, + "InternalVersion" : 83, "Name" : "cef4delphi_lazarus.lpk", - "Version" : "79.1.27.0" + "Version" : "79.1.31.0" } ], "UpdatePackageData" : {