1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2024-11-24 08:02:15 +02:00

Fixed #246: FMX doesn't have a OnMove event

This commit is contained in:
Andreas Hausladen 2019-11-13 21:35:11 +01:00
parent f96a7bc4f9
commit cbca087674
3 changed files with 34 additions and 0 deletions

View File

@ -137,6 +137,7 @@ type
procedure HandleSYSCHAR(const aMessage : TMsg);
procedure HandleSYSKEYDOWN(const aMessage : TMsg);
procedure HandleSYSKEYUP(const aMessage : TMsg);
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
end;
var
@ -791,6 +792,16 @@ begin
end;
end;
procedure TFMXExternalPumpBrowserFrm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var
PositionChanged: Boolean;
begin
PositionChanged := (ALeft <> Left) or (ATop <> Top);
inherited SetBounds(ALeft, ATop, AWidth, AHeight);
if PositionChanged then
NotifyMoveOrResizeStarted;
end;
procedure TFMXExternalPumpBrowserFrm.NotifyMoveOrResizeStarted;
begin
if (chrmosr <> nil) then chrmosr.NotifyMoveOrResizeStarted;
@ -934,4 +945,5 @@ begin
chrmosr.SendFocusEvent(False);
end;
end.

View File

@ -79,6 +79,7 @@ type
procedure NotifyMoveOrResizeStarted;
procedure DoDestroyParent;
procedure SendCloseMsg;
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
property Closing : boolean read FClosing;
property Homepage : string read FHomepage write FHomepage;
@ -227,6 +228,16 @@ begin
end;
end;
procedure TChildForm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var
PositionChanged: Boolean;
begin
PositionChanged := (ALeft <> Left) or (ATop <> Top);
inherited SetBounds(ALeft, ATop, AWidth, AHeight);
if PositionChanged then
NotifyMoveOrResizeStarted;
end;
procedure TChildForm.NotifyMoveOrResizeStarted;
begin
// This is needed to display some HTML elements correctly

View File

@ -105,6 +105,7 @@ type
procedure DoBrowserCreated;
procedure DoDestroyParent;
procedure NotifyMoveOrResizeStarted;
procedure SetBounds(ALeft: Integer; ATop: Integer; AWidth: Integer; AHeight: Integer); override;
end;
var
@ -318,6 +319,16 @@ begin
LoadURL;
end;
procedure TSimpleFMXBrowserFrm.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
var
PositionChanged: Boolean;
begin
PositionChanged := (ALeft <> Left) or (ATop <> Top);
inherited SetBounds(ALeft, ATop, AWidth, AHeight);
if PositionChanged then
NotifyMoveOrResizeStarted;
end;
procedure TSimpleFMXBrowserFrm.NotifyMoveOrResizeStarted;
begin
if (FMXChromium1 <> nil) then FMXChromium1.NotifyMoveOrResizeStarted;