mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-06-02 21:57:37 +02:00
SimpleOSRBrowser demo focus and mouse wheel fixes
- TChromium.Invalidate now also invalidates the browser in normal mode (non-OSR)
This commit is contained in:
parent
3949273b79
commit
28a5827e3e
@ -41,6 +41,7 @@ object Form1: TForm1
|
|||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Text = 'https://www.google.com'
|
Text = 'https://www.google.com'
|
||||||
|
OnEnter = ComboBox1Enter
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'https://www.google.com'
|
'https://www.google.com'
|
||||||
'https://html5demos.com/drag')
|
'https://html5demos.com/drag')
|
||||||
@ -69,6 +70,7 @@ object Form1: TForm1
|
|||||||
Caption = 'Go'
|
Caption = 'Go'
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnClick = GoBtnClick
|
OnClick = GoBtnClick
|
||||||
|
OnEnter = GoBtnEnter
|
||||||
end
|
end
|
||||||
object SnapshotBtn: TButton
|
object SnapshotBtn: TButton
|
||||||
Left = 38
|
Left = 38
|
||||||
@ -89,6 +91,7 @@ object Form1: TForm1
|
|||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
OnClick = SnapshotBtnClick
|
OnClick = SnapshotBtnClick
|
||||||
|
OnEnter = SnapshotBtnEnter
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -115,7 +118,6 @@ object Form1: TForm1
|
|||||||
OnMouseDown = PaintBoxMouseDown
|
OnMouseDown = PaintBoxMouseDown
|
||||||
OnMouseMove = PaintBoxMouseMove
|
OnMouseMove = PaintBoxMouseMove
|
||||||
OnMouseUp = PaintBoxMouseUp
|
OnMouseUp = PaintBoxMouseUp
|
||||||
OnMouseWheel = PaintBoxMouseWheel
|
|
||||||
OnMouseLeave = PaintBoxMouseLeave
|
OnMouseLeave = PaintBoxMouseLeave
|
||||||
OnResize = PaintBoxResize
|
OnResize = PaintBoxResize
|
||||||
end
|
end
|
||||||
|
@ -49,7 +49,7 @@ uses
|
|||||||
Windows, Messages, SysUtils, Variants, Classes,
|
Windows, Messages, SysUtils, Variants, Classes,
|
||||||
Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts,
|
Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
GR32_Image, // You need the Graphics32 components for this demo available at http://graphics32.org
|
GR32_Image, // You need the Graphics32 components for this demo available at http://graphics32.org and https://github.com/graphics32/graphics32
|
||||||
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants;
|
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -69,6 +69,8 @@ type
|
|||||||
procedure AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
|
procedure AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
|
||||||
|
|
||||||
procedure GoBtnClick(Sender: TObject);
|
procedure GoBtnClick(Sender: TObject);
|
||||||
|
procedure SnapshotBtnClick(Sender: TObject);
|
||||||
|
procedure Timer1Timer(Sender: TObject);
|
||||||
|
|
||||||
procedure Panel1Enter(Sender: TObject);
|
procedure Panel1Enter(Sender: TObject);
|
||||||
procedure Panel1Exit(Sender: TObject);
|
procedure Panel1Exit(Sender: TObject);
|
||||||
@ -83,7 +85,6 @@ type
|
|||||||
procedure PaintBoxMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure PaintBoxMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
procedure PaintBoxMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
procedure PaintBoxMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
procedure PaintBoxMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
procedure PaintBoxMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
|
||||||
procedure PaintBoxMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
|
||||||
procedure PaintBoxMouseLeave(Sender: TObject);
|
procedure PaintBoxMouseLeave(Sender: TObject);
|
||||||
|
|
||||||
procedure chrmosrPaint(Sender: TObject; const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer);
|
procedure chrmosrPaint(Sender: TObject; const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer);
|
||||||
@ -94,10 +95,9 @@ type
|
|||||||
procedure chrmosrPopupShow(Sender: TObject; const browser: ICefBrowser; show: Boolean);
|
procedure chrmosrPopupShow(Sender: TObject; const browser: ICefBrowser; show: Boolean);
|
||||||
procedure chrmosrPopupSize(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect);
|
procedure chrmosrPopupSize(Sender: TObject; const browser: ICefBrowser; const rect: PCefRect);
|
||||||
procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
procedure SnapshotBtnClick(Sender: TObject);
|
procedure GoBtnEnter(Sender: TObject);
|
||||||
procedure Timer1Timer(Sender: TObject);
|
procedure SnapshotBtnEnter(Sender: TObject);
|
||||||
|
procedure ComboBox1Enter(Sender: TObject); private
|
||||||
private
|
|
||||||
function getModifiers(Shift: TShiftState): TCefEventFlags;
|
function getModifiers(Shift: TShiftState): TCefEventFlags;
|
||||||
function GetButton(Button: TMouseButton): TCefMouseButtonType;
|
function GetButton(Button: TMouseButton): TCefMouseButtonType;
|
||||||
|
|
||||||
@ -123,109 +123,117 @@ uses
|
|||||||
|
|
||||||
procedure TForm1.AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
|
procedure TForm1.AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
|
||||||
var
|
var
|
||||||
TempEvent : TCefKeyEvent;
|
TempKeyEvent : TCefKeyEvent;
|
||||||
|
TempMouseEvent : TCefMouseEvent;
|
||||||
begin
|
begin
|
||||||
case Msg.message of
|
case Msg.message of
|
||||||
WM_SYSCHAR :
|
WM_SYSCHAR :
|
||||||
if (Panel1.Focused or chrmosr.FrameIsFocused) and
|
if Panel1.Focused and (Msg.wParam in [VK_BACK..VK_HELP]) then
|
||||||
(Msg.wParam in [VK_BACK..VK_HELP]) then
|
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_CHAR;
|
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(True);
|
TempKeyEvent.is_system_key := ord(True);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WM_SYSKEYDOWN :
|
WM_SYSKEYDOWN :
|
||||||
if (Panel1.Focused or chrmosr.FrameIsFocused) and
|
if Panel1.Focused and (Msg.wParam in [VK_BACK..VK_HELP]) then
|
||||||
(Msg.wParam in [VK_BACK..VK_HELP]) then
|
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_RAWKEYDOWN;
|
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(True);
|
TempKeyEvent.is_system_key := ord(True);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WM_SYSKEYUP :
|
WM_SYSKEYUP :
|
||||||
if (Panel1.Focused or chrmosr.FrameIsFocused) and
|
if Panel1.Focused and (Msg.wParam in [VK_BACK..VK_HELP]) then
|
||||||
(Msg.wParam in [VK_BACK..VK_HELP]) then
|
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_KEYUP;
|
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(True);
|
TempKeyEvent.is_system_key := ord(True);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WM_KEYDOWN :
|
WM_KEYDOWN :
|
||||||
if (Panel1.Focused or chrmosr.FrameIsFocused) and
|
if Panel1.Focused and (Msg.wParam in [VK_BACK..VK_HELP]) then
|
||||||
(Msg.wParam in [VK_BACK..VK_HELP]) then
|
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_RAWKEYDOWN;
|
TempKeyEvent.kind := KEYEVENT_RAWKEYDOWN;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(False);
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WM_KEYUP :
|
WM_KEYUP :
|
||||||
if (Panel1.Focused or chrmosr.FrameIsFocused) and
|
if Panel1.Focused and (Msg.wParam in [VK_BACK..VK_HELP]) then
|
||||||
(Msg.wParam in [VK_BACK..VK_HELP]) then
|
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_KEYUP;
|
TempKeyEvent.kind := KEYEVENT_KEYUP;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(False);
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WM_CHAR :
|
WM_CHAR :
|
||||||
if Panel1.Focused or chrmosr.FrameIsFocused then
|
if Panel1.Focused then
|
||||||
begin
|
begin
|
||||||
TempEvent.kind := KEYEVENT_CHAR;
|
TempKeyEvent.kind := KEYEVENT_CHAR;
|
||||||
TempEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
TempKeyEvent.modifiers := GetCefKeyboardModifiers(Msg.wParam, Msg.lParam);
|
||||||
TempEvent.windows_key_code := Msg.wParam;
|
TempKeyEvent.windows_key_code := Msg.wParam;
|
||||||
TempEvent.native_key_code := Msg.lParam;
|
TempKeyEvent.native_key_code := Msg.lParam;
|
||||||
TempEvent.is_system_key := ord(False);
|
TempKeyEvent.is_system_key := ord(False);
|
||||||
TempEvent.character := #0;
|
TempKeyEvent.character := #0;
|
||||||
TempEvent.unmodified_character := #0;
|
TempKeyEvent.unmodified_character := #0;
|
||||||
TempEvent.focus_on_editable_field := ord(False);
|
TempKeyEvent.focus_on_editable_field := ord(False);
|
||||||
|
|
||||||
chrmosr.SendKeyEvent(@TempEvent);
|
chrmosr.SendKeyEvent(@TempKeyEvent);
|
||||||
Handled := True;
|
Handled := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// The MouseWheel event in PaintBox doesn't receive any event
|
||||||
|
// so we'll catch the WM_MOUSEWHEEL message here.
|
||||||
|
WM_MOUSEWHEEL :
|
||||||
|
if Panel1.Focused and (GlobalCEFApp <> nil) then
|
||||||
|
begin
|
||||||
|
TempMouseEvent.x := Msg.lParam and $FFFF;
|
||||||
|
TempMouseEvent.y := Msg.lParam shr 16;
|
||||||
|
TempMouseEvent.modifiers := GetCefMouseModifiers(Msg.wParam);
|
||||||
|
DeviceToLogical(TempMouseEvent, GlobalCEFApp.DeviceScaleFactor);
|
||||||
|
chrmosr.SendMouseWheelEvent(@TempMouseEvent, 0, int16(Msg.wParam shr 16));
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -234,6 +242,11 @@ begin
|
|||||||
chrmosr.LoadURL(ComboBox1.Text);
|
chrmosr.LoadURL(ComboBox1.Text);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.GoBtnEnter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
chrmosr.SendFocusEvent(False);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
|
procedure TForm1.chrmosrAfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||||
begin
|
begin
|
||||||
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
PostMessage(Handle, CEF_AFTERCREATED, 0, 0);
|
||||||
@ -384,6 +397,11 @@ begin
|
|||||||
// LogicalToDevice(rect, GlobalCEFApp.DeviceScaleFactor);
|
// LogicalToDevice(rect, GlobalCEFApp.DeviceScaleFactor);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ComboBox1Enter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
chrmosr.SendFocusEvent(False);
|
||||||
|
end;
|
||||||
|
|
||||||
function TForm1.getModifiers(Shift: TShiftState): TCefEventFlags;
|
function TForm1.getModifiers(Shift: TShiftState): TCefEventFlags;
|
||||||
begin
|
begin
|
||||||
Result := EVENTFLAG_NONE;
|
Result := EVENTFLAG_NONE;
|
||||||
@ -435,6 +453,7 @@ end;
|
|||||||
|
|
||||||
procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage);
|
procedure TForm1.BrowserCreatedMsg(var aMessage : TMessage);
|
||||||
begin
|
begin
|
||||||
|
Caption := 'Simple OSR Browser';
|
||||||
NavControlPnl.Enabled := True;
|
NavControlPnl.Enabled := True;
|
||||||
GoBtn.Click;
|
GoBtn.Click;
|
||||||
end;
|
end;
|
||||||
@ -468,6 +487,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Caption := 'Simple OSR Browser - Initializing browser. Please wait...';
|
||||||
chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); // opaque white background color
|
chrmosr.Options.BackgroundColor := CefColorSetARGB($FF, $FF, $FF, $FF); // opaque white background color
|
||||||
|
|
||||||
if chrmosr.CreateBrowser(nil, '') then
|
if chrmosr.CreateBrowser(nil, '') then
|
||||||
@ -541,24 +561,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.PaintBoxMouseWheel(Sender : TObject;
|
|
||||||
Shift : TShiftState;
|
|
||||||
WheelDelta : Integer;
|
|
||||||
MousePos : TPoint;
|
|
||||||
var Handled : Boolean);
|
|
||||||
var
|
|
||||||
TempEvent : TCefMouseEvent;
|
|
||||||
begin
|
|
||||||
if (GlobalCEFApp <> nil) then
|
|
||||||
begin
|
|
||||||
TempEvent.x := MousePos.X;
|
|
||||||
TempEvent.y := MousePos.Y;
|
|
||||||
TempEvent.modifiers := getModifiers(Shift);
|
|
||||||
DeviceToLogical(TempEvent, GlobalCEFApp.DeviceScaleFactor);
|
|
||||||
chrmosr.SendMouseWheelEvent(@TempEvent, 0, WheelDelta);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.PaintBoxResize(Sender: TObject);
|
procedure TForm1.PaintBoxResize(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
PaintBox.Buffer.SetSize(PaintBox.Width, PaintBox.Height);
|
PaintBox.Buffer.SetSize(PaintBox.Width, PaintBox.Height);
|
||||||
@ -580,6 +582,11 @@ begin
|
|||||||
if SaveDialog1.Execute then PaintBox.Buffer.SaveToFile(SaveDialog1.FileName);
|
if SaveDialog1.Execute then PaintBox.Buffer.SaveToFile(SaveDialog1.FileName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.SnapshotBtnEnter(Sender: TObject);
|
||||||
|
begin
|
||||||
|
chrmosr.SendFocusEvent(False);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
Timer1.Enabled := False;
|
Timer1.Enabled := False;
|
||||||
|
@ -478,7 +478,7 @@ type
|
|||||||
procedure WasHidden(hidden: Boolean);
|
procedure WasHidden(hidden: Boolean);
|
||||||
procedure NotifyScreenInfoChanged;
|
procedure NotifyScreenInfoChanged;
|
||||||
procedure NotifyMoveOrResizeStarted;
|
procedure NotifyMoveOrResizeStarted;
|
||||||
procedure Invalidate(kind: TCefPaintElementType);
|
procedure Invalidate(kind: TCefPaintElementType = PET_VIEW);
|
||||||
procedure SendKeyEvent(const event: PCefKeyEvent);
|
procedure SendKeyEvent(const event: PCefKeyEvent);
|
||||||
procedure SendMouseClickEvent(const event: PCefMouseEvent; kind: TCefMouseButtonType; mouseUp: Boolean; clickCount: Integer);
|
procedure SendMouseClickEvent(const event: PCefMouseEvent; kind: TCefMouseButtonType; mouseUp: Boolean; clickCount: Integer);
|
||||||
procedure SendMouseMoveEvent(const event: PCefMouseEvent; mouseLeave: Boolean);
|
procedure SendMouseMoveEvent(const event: PCefMouseEvent; mouseLeave: Boolean);
|
||||||
@ -3320,7 +3320,13 @@ end;
|
|||||||
|
|
||||||
procedure TChromium.Invalidate(kind: TCefPaintElementType);
|
procedure TChromium.Invalidate(kind: TCefPaintElementType);
|
||||||
begin
|
begin
|
||||||
if Initialized then FBrowser.Host.Invalidate(kind);
|
if Initialized then
|
||||||
|
begin
|
||||||
|
if FIsOSR then
|
||||||
|
FBrowser.Host.Invalidate(kind)
|
||||||
|
else
|
||||||
|
InvalidateRect(FBrowser.Host.WindowHandle, nil, False);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TChromium.SendKeyEvent(const event: PCefKeyEvent);
|
procedure TChromium.SendKeyEvent(const event: PCefKeyEvent);
|
||||||
|
@ -77,8 +77,8 @@ type
|
|||||||
procedure CloseBrowser(aForceClose : boolean);
|
procedure CloseBrowser(aForceClose : boolean);
|
||||||
procedure LoadURL(const aURL : string);
|
procedure LoadURL(const aURL : string);
|
||||||
|
|
||||||
property ChromiumBrowser : TChromium read FChromium;
|
property ChromiumBrowser : TChromium read FChromium;
|
||||||
property Initialized : boolean read GetBrowserInitialized;
|
property Initialized : boolean read GetBrowserInitialized;
|
||||||
|
|
||||||
published
|
published
|
||||||
property OnClose : TNotifyEvent read FOnClose write FOnClose;
|
property OnClose : TNotifyEvent read FOnClose write FOnClose;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user