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;
|
||||
FOnBeforeClose : TNotifyEvent;
|
||||
FOnAfterCreated : TNotifyEvent;
|
||||
FUseSetFocus : boolean;
|
||||
|
||||
function GetBrowserInitialized : boolean;
|
||||
function GetChildWindowHandle : THandle; override;
|
||||
@@ -95,6 +96,7 @@ type
|
||||
property Initialized : boolean read GetBrowserInitialized;
|
||||
|
||||
published
|
||||
property UseSetFocus : boolean read FUseSetFocus write FUseSetFocus default True;
|
||||
property OnClose : TNotifyEvent read FOnClose write FOnClose;
|
||||
property OnBeforeClose : TNotifyEvent read FOnBeforeClose write FOnBeforeClose;
|
||||
property OnAfterCreated : TNotifyEvent read FOnAfterCreated write FOnAfterCreated;
|
||||
@@ -121,6 +123,7 @@ begin
|
||||
FOnClose := nil;
|
||||
FOnBeforeClose := nil;
|
||||
FOnAfterCreated := nil;
|
||||
FUseSetFocus := True;
|
||||
end;
|
||||
|
||||
procedure TChromiumWindow.AfterConstruction;
|
||||
@@ -152,7 +155,7 @@ begin
|
||||
case aMessage.Msg of
|
||||
WM_SETFOCUS:
|
||||
begin
|
||||
if (FChromium <> nil) then
|
||||
if FUseSetFocus and (FChromium <> nil) then
|
||||
FChromium.SetFocus(True)
|
||||
else
|
||||
begin
|
||||
|
Reference in New Issue
Block a user