You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-07-02 22:26:53 +02:00
Added the PopupBrowser2 demo for Linux
Set the CEFLinkedWindowParent1.TabStop to true to fix a focus issue Moved TCEFLinkedWindowParent.UpdateSize to the public section
This commit is contained in:
@ -39,13 +39,13 @@
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<TopLine Value="118"/>
|
||||
<CursorPos X="16" Y="145"/>
|
||||
<TopLine Value="442"/>
|
||||
<CursorPos X="6" Y="440"/>
|
||||
<UsageCount Value="24"/>
|
||||
<Bookmarks Count="3">
|
||||
<Item0 X="22" Y="471" ID="2"/>
|
||||
<Item1 X="50" Y="392" ID="3"/>
|
||||
<Item2 X="36" Y="415" ID="4"/>
|
||||
<Item0 X="22" Y="477" ID="2"/>
|
||||
<Item1 X="50" Y="397" ID="3"/>
|
||||
<Item2 X="36" Y="420" ID="4"/>
|
||||
</Bookmarks>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
@ -125,123 +125,127 @@
|
||||
<OtherDefines Count="1">
|
||||
<Define0 Value="UseCThreads"/>
|
||||
</OtherDefines>
|
||||
<JumpHistory Count="29" HistoryIndex="28">
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="124" Column="17" TopLine="103"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="463" Column="3" TopLine="436"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="117" Column="67" TopLine="84"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="128" Column="61" TopLine="103"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="144" Column="19" TopLine="123"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="128" Column="61" TopLine="103"/>
|
||||
<Caret Line="133" Column="90" TopLine="103"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="144" Column="19" TopLine="123"/>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="61" Column="67" TopLine="39"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="133" Column="90" TopLine="103"/>
|
||||
<Caret Line="131" Column="41" TopLine="103"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="61" Column="67" TopLine="39"/>
|
||||
<Caret Line="61" Column="19" TopLine="39"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="131" Column="41" TopLine="103"/>
|
||||
<Caret Line="126" Column="42" TopLine="103"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="61" Column="19" TopLine="39"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uBrowserTab.pas"/>
|
||||
<Caret Line="126" Column="42" TopLine="103"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="144" Column="19" TopLine="90"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="96" Column="28" TopLine="86"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="264" Column="38" TopLine="240"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="96" Column="28" TopLine="86"/>
|
||||
<Caret Line="87" Column="15" TopLine="71"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="264" Column="38" TopLine="240"/>
|
||||
<Caret Line="262" Column="75" TopLine="240"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="87" Column="15" TopLine="71"/>
|
||||
<Caret Line="303" Column="41" TopLine="261"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="262" Column="75" TopLine="240"/>
|
||||
<Caret Line="84" Column="15" TopLine="71"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="303" Column="41" TopLine="261"/>
|
||||
<Caret Line="271" Column="41" TopLine="264"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="84" Column="15" TopLine="71"/>
|
||||
<Caret Line="85" Column="15" TopLine="63"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="271" Column="41" TopLine="264"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="85" Column="15" TopLine="63"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="113" Column="73" TopLine="90"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="132" Column="32" TopLine="96"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="303" Column="69" TopLine="259"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="190" Column="3" TopLine="170"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="303" Column="69" TopLine="259"/>
|
||||
<Caret Line="219" TopLine="205"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="190" Column="3" TopLine="170"/>
|
||||
<Caret Line="71" TopLine="60"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="219" TopLine="205"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="78" Column="25" TopLine="62"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="uMainForm.pas"/>
|
||||
<Caret Line="71" TopLine="60"/>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="359" Column="49" TopLine="355"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="78" Column="25" TopLine="62"/>
|
||||
<Caret Line="77" Column="17" TopLine="56"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="359" Column="49" TopLine="355"/>
|
||||
<Caret Line="464" Column="59" TopLine="40"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="77" Column="17" TopLine="56"/>
|
||||
<Caret Line="73" Column="41" TopLine="63"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="464" Column="59" TopLine="40"/>
|
||||
<Caret Line="326" Column="43" TopLine="305"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="uBrowserFrame.pas"/>
|
||||
<Caret Line="79" Column="17" TopLine="50"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
|
@ -198,6 +198,7 @@ object BrowserFrame: TBrowserFrame
|
||||
Top = 28
|
||||
Width = 932
|
||||
Align = alClient
|
||||
TabStop = True
|
||||
TabOrder = 2
|
||||
OnEnter = CEFLinkedWindowParent1Enter
|
||||
OnExit = CEFLinkedWindowParent1Exit
|
||||
|
@ -309,18 +309,29 @@ begin
|
||||
SendCompMessage(CEF_AFTERCREATED);
|
||||
end;
|
||||
|
||||
// This is a workaround for the CEF issue #2026
|
||||
// https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on
|
||||
// We use CEFLinkedWindowParent1.OnEnter, CEFLinkedWindowParent1.OnExit and
|
||||
// TChromium.OnGotFocus to avoid most of the focus issues.
|
||||
// CEFLinkedWindowParent1.TabStop must be TRUE.
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) then
|
||||
Chromium1.SendCaptureLostEvent;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Enter(Sender: TObject);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) and
|
||||
Chromium1.Initialized and
|
||||
not(Chromium1.FrameIsFocused) then
|
||||
Chromium1.SendFocusEvent(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.CEFLinkedWindowParent1Exit(Sender: TObject);
|
||||
procedure TBrowserFrame.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
if not(csDesigning in ComponentState) then
|
||||
Chromium1.SendCaptureLostEvent;
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.BackBtnClick(Sender: TObject);
|
||||
@ -360,12 +371,6 @@ begin
|
||||
aAction := cbaClose;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.Chromium1GotFocus(Sender: TObject;
|
||||
const browser: ICefBrowser);
|
||||
begin
|
||||
CEFLinkedWindowParent1.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TBrowserFrame.Chromium1LoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer;
|
||||
const errorText, failedUrl: ustring);
|
||||
@ -431,7 +436,8 @@ var
|
||||
begin
|
||||
TempURL := BrowserAddress;
|
||||
|
||||
if (URLCbx.Items.IndexOf(TempURL) < 0) then URLCbx.Items.Add(TempURL);
|
||||
if (URLCbx.Items.IndexOf(TempURL) < 0) then
|
||||
URLCbx.Items.Add(TempURL);
|
||||
|
||||
URLCbx.Text := TempURL;
|
||||
end;
|
||||
|
Reference in New Issue
Block a user