mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2026-06-13 16:05:40 +02:00
Implemented TChromium.OnOpenUrlFromTab in SimpleOSRBrowser
This commit is contained in:
@@ -123,6 +123,7 @@ object Form1: TForm1
|
||||
OnBeforePopup = chrmosrBeforePopup
|
||||
OnAfterCreated = chrmosrAfterCreated
|
||||
OnBeforeClose = chrmosrBeforeClose
|
||||
OnOpenUrlFromTab = chrmosrOpenUrlFromTab
|
||||
OnGetViewRect = chrmosrGetViewRect
|
||||
OnGetScreenPoint = chrmosrGetScreenPoint
|
||||
OnGetScreenInfo = chrmosrGetScreenInfo
|
||||
|
||||
@@ -77,6 +77,7 @@ type
|
||||
procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
|
||||
procedure chrmosrCanFocus(Sender: TObject);
|
||||
procedure chrmosrOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||
|
||||
procedure SnapshotBtnClick(Sender: TObject);
|
||||
procedure SnapshotBtnEnter(Sender: TObject);
|
||||
@@ -1312,6 +1313,15 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrOpenUrlFromTab(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring;
|
||||
targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean;
|
||||
out Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.Panel1IMECancelComposition(Sender: TObject);
|
||||
begin
|
||||
chrmosr.IMECancelComposition;
|
||||
|
||||
@@ -10,13 +10,13 @@ object Form1: TForm1
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '4.4.0.0'
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnHide = FormHide
|
||||
OnShow = FormShow
|
||||
Position = poScreenCenter
|
||||
LCLVersion = '2.0.10.0'
|
||||
object NavControlPnl: TPanel
|
||||
Left = 0
|
||||
Height = 21
|
||||
@@ -27,6 +27,7 @@ object Form1: TForm1
|
||||
ClientHeight = 21
|
||||
ClientWidth = 800
|
||||
Enabled = False
|
||||
ParentBackground = False
|
||||
TabOrder = 0
|
||||
object ComboBox1: TComboBox
|
||||
Left = 0
|
||||
@@ -41,9 +42,9 @@ object Form1: TForm1
|
||||
'https://www.briskbard.com'
|
||||
'https://frames-per-second.appspot.com/'
|
||||
)
|
||||
OnEnter = ComboBox1Enter
|
||||
TabOrder = 0
|
||||
Text = 'https://www.google.com'
|
||||
OnEnter = ComboBox1Enter
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 731
|
||||
@@ -54,6 +55,7 @@ object Form1: TForm1
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 21
|
||||
ClientWidth = 69
|
||||
ParentBackground = False
|
||||
TabOrder = 1
|
||||
object GoBtn: TButton
|
||||
Left = 4
|
||||
@@ -61,9 +63,9 @@ object Form1: TForm1
|
||||
Top = 0
|
||||
Width = 31
|
||||
Caption = 'Go'
|
||||
TabOrder = 0
|
||||
OnClick = GoBtnClick
|
||||
OnEnter = GoBtnEnter
|
||||
TabOrder = 0
|
||||
end
|
||||
object SnapshotBtn: TButton
|
||||
Left = 38
|
||||
@@ -76,12 +78,12 @@ object Form1: TForm1
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -24
|
||||
Font.Name = 'Webdings'
|
||||
OnClick = SnapshotBtnClick
|
||||
OnEnter = SnapshotBtnEnter
|
||||
ParentFont = False
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 1
|
||||
OnClick = SnapshotBtnClick
|
||||
OnEnter = SnapshotBtnEnter
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -115,6 +117,7 @@ object Form1: TForm1
|
||||
OnBeforePopup = chrmosrBeforePopup
|
||||
OnAfterCreated = chrmosrAfterCreated
|
||||
OnBeforeClose = chrmosrBeforeClose
|
||||
OnOpenUrlFromTab = chrmosrOpenUrlFromTab
|
||||
OnGetViewRect = chrmosrGetViewRect
|
||||
OnGetScreenPoint = chrmosrGetScreenPoint
|
||||
OnGetScreenInfo = chrmosrGetScreenInfo
|
||||
|
||||
@@ -63,6 +63,7 @@ type
|
||||
procedure chrmosrBeforePopup(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; popup_id: Integer; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean; var Result: Boolean);
|
||||
procedure chrmosrBeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure chrmosrIMECompositionRangeChanged(Sender: TObject; const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt; const character_bounds: PCefRect);
|
||||
procedure chrmosrOpenUrlFromTab(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out Result: Boolean);
|
||||
|
||||
procedure SnapshotBtnClick(Sender: TObject);
|
||||
procedure SnapshotBtnEnter(Sender: TObject);
|
||||
@@ -189,6 +190,15 @@ begin
|
||||
chrmosr.LoadURL(ComboBox1.Text);
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrOpenUrlFromTab(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring;
|
||||
targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean; out
|
||||
Result: Boolean);
|
||||
begin
|
||||
// For simplicity, this demo blocks all popup windows and new tabs
|
||||
Result := (targetDisposition in [CEF_WOD_NEW_FOREGROUND_TAB, CEF_WOD_NEW_BACKGROUND_TAB, CEF_WOD_NEW_POPUP, CEF_WOD_NEW_WINDOW]);
|
||||
end;
|
||||
|
||||
procedure TForm1.chrmosrIMECompositionRangeChanged( Sender : TObject;
|
||||
const browser : ICefBrowser;
|
||||
const selected_range : PCefRange;
|
||||
@@ -910,11 +920,9 @@ begin
|
||||
chrmosr.IMECommitText(aText, replacement_range, relative_cursor_pos);
|
||||
end;
|
||||
|
||||
procedure TForm1.Panel1IMESetComposition( Sender : TObject;
|
||||
const aText : ustring;
|
||||
const underlines : TCefCompositionUnderlineDynArray;
|
||||
const replacement_range : TCefRange;
|
||||
const selection_range : TCefRange);
|
||||
procedure TForm1.Panel1IMESetComposition(Sender: TObject; const aText: ustring;
|
||||
const underlines: TCefCompositionUnderlineDynArray; const replacement_range,
|
||||
selection_range: TCefRange);
|
||||
begin
|
||||
chrmosr.IMESetComposition(aText, underlines, @replacement_range, @selection_range);
|
||||
end;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 847,
|
||||
"InternalVersion" : 848,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "144.0.12"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user