Skip to content

Commit

Permalink
Fixed cursor handling in MiniBrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadordf committed Aug 22, 2024
1 parent a6b258d commit ed52c61
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 29 deletions.
1 change: 0 additions & 1 deletion demos/Delphi_VCL/MiniBrowser/uMiniBrowser.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnStatusMessage = Chromium1StatusMessage
OnConsoleMessage = Chromium1ConsoleMessage
OnLoadingProgressChange = Chromium1LoadingProgressChange
OnCursorChange = Chromium1CursorChange
OnMediaAccessChange = Chromium1MediaAccessChange
OnCanDownload = Chromium1CanDownload
OnBeforeDownload = Chromium1BeforeDownload
Expand Down
15 changes: 4 additions & 11 deletions demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ TMiniBrowserFrm = class(TForm)
procedure Chromium1ZoomPctAvailable(Sender: TObject; const aZoomPct: Double);
procedure Chromium1DevToolsMethodResult(Sender: TObject; const browser: ICefBrowser; message_id: Integer; success: Boolean; const result: ICefValue);
procedure Chromium1SelectClientCertificate(Sender: TObject; const browser: ICefBrowser; isProxy: Boolean; const host: ustring; port: Integer; certificatesCount: NativeUInt; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback; var aResult: Boolean);
procedure Chromium1CursorChange(Sender: TObject; const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult: Boolean);
procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser; const url, request_method: ustring; var aResult: Boolean);
procedure Chromium1MediaAccessChange(Sender: TObject; const browser: ICefBrowser; has_video_access, has_audio_access: Boolean);
procedure Chromium1RequestMediaAccessPermission(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const requesting_origin: ustring; requested_permissions: Cardinal; const callback: ICefMediaAccessCallback; var aResult: Boolean);
Expand Down Expand Up @@ -688,15 +687,6 @@ procedure TMiniBrowserFrm.Chromium1CookiesFlushed(Sender: TObject);
PostMessage(Handle, MINIBROWSER_COOKIESFLUSHED, 0, 0);
end;

procedure TMiniBrowserFrm.Chromium1CursorChange(Sender: TObject;
const browser: ICefBrowser; cursor_: TCefCursorHandle;
cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo;
var aResult: Boolean);
begin
aResult := True;
CEFWindowParent1.Cursor := CefCursorToWindowsCursor(cursorType);
end;

procedure TMiniBrowserFrm.CookiesFlushedMsg(var aMessage : TMessage);
begin
showmessage('The cookies were flushed successfully');
Expand Down Expand Up @@ -1448,7 +1438,10 @@ procedure TMiniBrowserFrm.Clearcache1Click(Sender: TObject);

procedure TMiniBrowserFrm.FindText1Click(Sender: TObject);
begin
FindFrm.Show;
if GlobalCEFApp.ChromeRuntime then
Chromium1.ExecuteChromeCommand(IDC_FIND, CEF_WOD_CURRENT_TAB)
else
FindFrm.Show;
end;

procedure TMiniBrowserFrm.Flushcookies1Click(Sender: TObject);
Expand Down
7 changes: 3 additions & 4 deletions demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '3.2.0.0'
LCLVersion = '3.4.0.0'
object Splitter1: TSplitter
Left = 1179
Height = 663
Expand Down Expand Up @@ -118,11 +118,11 @@ object MiniBrowserFrm: TMiniBrowserFrm
TabOrder = 1
object URLCbx: TComboBox
Left = 0
Height = 22
Height = 21
Top = 3
Width = 978
Anchors = [akTop, akLeft, akRight, akBottom]
ItemHeight = 14
ItemHeight = 13
ItemIndex = 0
Items.Strings = (
'https://www.google.com'
Expand Down Expand Up @@ -264,7 +264,6 @@ object MiniBrowserFrm: TMiniBrowserFrm
OnFullScreenModeChange = Chromium1FullScreenModeChange
OnStatusMessage = Chromium1StatusMessage
OnLoadingProgressChange = Chromium1LoadingProgressChange
OnCursorChange = Chromium1CursorChange
OnMediaAccessChange = Chromium1MediaAccessChange
OnCanDownload = Chromium1CanDownload
OnBeforeDownload = Chromium1BeforeDownload
Expand Down
12 changes: 0 additions & 12 deletions demos/Lazarus_Windows/MiniBrowser/uMiniBrowser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ TMiniBrowserFrm = class(TForm)
procedure Chromium1CanDownload(Sender: TObject; const browser: ICefBrowser;
const url, request_method: ustring; var aResult: boolean);
procedure Chromium1CookiesFlushed(Sender: TObject);
procedure Chromium1CursorChange(Sender: TObject;
const browser: ICefBrowser; cursor_: TCefCursorHandle;
cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo;
var aResult: boolean);
procedure Chromium1DevToolsMethodResult(Sender: TObject;
const browser: ICefBrowser; message_id: integer; success: boolean;
const result: ICefValue);
Expand Down Expand Up @@ -1205,14 +1201,6 @@ procedure TMiniBrowserFrm.Chromium1CookiesFlushed(Sender: TObject);
PostMessage(Handle, MINIBROWSER_COOKIESFLUSHED, 0, 0);
end;

procedure TMiniBrowserFrm.Chromium1CursorChange(Sender: TObject;
const browser: ICefBrowser; cursor_: TCefCursorHandle;
cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo;
var aResult: boolean);
begin
CEFWindowParent1.Cursor := CefCursorToWindowsCursor(cursorType);
end;

procedure TMiniBrowserFrm.Chromium1DevToolsMethodResult(Sender: TObject;
const browser: ICefBrowser; message_id: integer; success: boolean;
const result: ICefValue);
Expand Down
2 changes: 1 addition & 1 deletion update_CEF4Delphi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"UpdateLazPackages" : [
{
"ForceNotify" : true,
"InternalVersion" : 642,
"InternalVersion" : 643,
"Name" : "cef4delphi_lazarus.lpk",
"Version" : "127.3.5"
}
Expand Down

0 comments on commit ed52c61

Please sign in to comment.