You've already forked CEF4Delphi
mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-09-16 08:26:23 +02:00
Added the TChromiumWindow.UseSetFocus property
This commit is contained in:
@@ -69,6 +69,7 @@ type
|
|||||||
FOnClose : TNotifyEvent;
|
FOnClose : TNotifyEvent;
|
||||||
FOnBeforeClose : TNotifyEvent;
|
FOnBeforeClose : TNotifyEvent;
|
||||||
FOnAfterCreated : TNotifyEvent;
|
FOnAfterCreated : TNotifyEvent;
|
||||||
|
FUseSetFocus : boolean;
|
||||||
|
|
||||||
function GetBrowserInitialized : boolean;
|
function GetBrowserInitialized : boolean;
|
||||||
function GetChildWindowHandle : THandle; override;
|
function GetChildWindowHandle : THandle; override;
|
||||||
@@ -95,6 +96,7 @@ type
|
|||||||
property Initialized : boolean read GetBrowserInitialized;
|
property Initialized : boolean read GetBrowserInitialized;
|
||||||
|
|
||||||
published
|
published
|
||||||
|
property UseSetFocus : boolean read FUseSetFocus write FUseSetFocus default True;
|
||||||
property OnClose : TNotifyEvent read FOnClose write FOnClose;
|
property OnClose : TNotifyEvent read FOnClose write FOnClose;
|
||||||
property OnBeforeClose : TNotifyEvent read FOnBeforeClose write FOnBeforeClose;
|
property OnBeforeClose : TNotifyEvent read FOnBeforeClose write FOnBeforeClose;
|
||||||
property OnAfterCreated : TNotifyEvent read FOnAfterCreated write FOnAfterCreated;
|
property OnAfterCreated : TNotifyEvent read FOnAfterCreated write FOnAfterCreated;
|
||||||
@@ -121,6 +123,7 @@ begin
|
|||||||
FOnClose := nil;
|
FOnClose := nil;
|
||||||
FOnBeforeClose := nil;
|
FOnBeforeClose := nil;
|
||||||
FOnAfterCreated := nil;
|
FOnAfterCreated := nil;
|
||||||
|
FUseSetFocus := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromiumWindow.AfterConstruction;
|
procedure TChromiumWindow.AfterConstruction;
|
||||||
@@ -152,7 +155,7 @@ begin
|
|||||||
case aMessage.Msg of
|
case aMessage.Msg of
|
||||||
WM_SETFOCUS:
|
WM_SETFOCUS:
|
||||||
begin
|
begin
|
||||||
if (FChromium <> nil) then
|
if FUseSetFocus and (FChromium <> nil) then
|
||||||
FChromium.SetFocus(True)
|
FChromium.SetFocus(True)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user