You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-11-23 21:34:53 +02:00
Added TCEFSentinel component
- Added TCEFSentinel to MiniBrowser, TabbedBrowser, ToolBoxBrowser and SimpleBrowser2.
This commit is contained in:
@@ -49,7 +49,8 @@ uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics,
|
||||
Controls, Forms, Dialogs, ComCtrls, Buttons, ExtCtrls, StdCtrls,
|
||||
{$ENDIF}
|
||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants;
|
||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes, uCEFConstants,
|
||||
uCEFSentinel;
|
||||
|
||||
const
|
||||
CEFBROWSER_DESTROYWNDPARENT = WM_APP + $100;
|
||||
@@ -72,6 +73,7 @@ type
|
||||
URLCbx: TComboBox;
|
||||
AddTabBtn: TButton;
|
||||
RemoveTabBtn: TButton;
|
||||
CEFSentinel1: TCEFSentinel;
|
||||
procedure AddTabBtnClick(Sender: TObject);
|
||||
procedure RemoveTabBtnClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
@@ -83,6 +85,7 @@ type
|
||||
procedure StopBtnClick(Sender: TObject);
|
||||
procedure GoBtnClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure CEFSentinel1Close(Sender: TObject);
|
||||
|
||||
protected
|
||||
FClosingTab : boolean;
|
||||
@@ -349,11 +352,7 @@ begin
|
||||
begin
|
||||
PageControl1.Pages[aMessage.lParam].Tag := 1;
|
||||
|
||||
if AllTabSheetsAreTagged then
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
if AllTabSheetsAreTagged then CEFSentinel1.Start;
|
||||
end;
|
||||
end;
|
||||
|
||||
@@ -575,4 +574,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMainForm.CEFSentinel1Close(Sender: TObject);
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user