1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Added a touch keyboard to SimpleOSRBrowser

This commit is contained in:
Salvador Díaz Fau
2018-07-29 10:58:26 +02:00
parent e321510ada
commit 61ff40bd9d
2 changed files with 49 additions and 11 deletions

View File

@ -2,8 +2,8 @@ object Form1: TForm1
Left = 0 Left = 0
Top = 0 Top = 0
Caption = 'Simple OSR Browser - Initializing browser. Please wait...' Caption = 'Simple OSR Browser - Initializing browser. Please wait...'
ClientHeight = 530 ClientHeight = 668
ClientWidth = 800 ClientWidth = 988
Color = clBtnFace Color = clBtnFace
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -23,7 +23,7 @@ object Form1: TForm1
object NavControlPnl: TPanel object NavControlPnl: TPanel
Left = 0 Left = 0
Top = 0 Top = 0
Width = 800 Width = 988
Height = 30 Height = 30
Align = alTop Align = alTop
BevelOuter = bvNone BevelOuter = bvNone
@ -37,7 +37,7 @@ object Form1: TForm1
object ComboBox1: TComboBox object ComboBox1: TComboBox
Left = 5 Left = 5
Top = 5 Top = 5
Width = 721 Width = 875
Height = 21 Height = 21
Align = alClient Align = alClient
ItemIndex = 0 ItemIndex = 0
@ -54,9 +54,9 @@ object Form1: TForm1
'https://frames-per-second.appspot.com/') 'https://frames-per-second.appspot.com/')
end end
object Panel2: TPanel object Panel2: TPanel
Left = 726 Left = 880
Top = 5 Top = 5
Width = 69 Width = 103
Height = 20 Height = 20
Margins.Left = 2 Margins.Left = 2
Margins.Top = 2 Margins.Top = 2
@ -80,7 +80,7 @@ object Form1: TForm1
OnEnter = GoBtnEnter OnEnter = GoBtnEnter
end end
object SnapshotBtn: TButton object SnapshotBtn: TButton
Left = 38 Left = 72
Top = 0 Top = 0
Width = 31 Width = 31
Height = 20 Height = 20
@ -100,13 +100,32 @@ object Form1: TForm1
OnClick = SnapshotBtnClick OnClick = SnapshotBtnClick
OnEnter = SnapshotBtnEnter OnEnter = SnapshotBtnEnter
end end
object KeyboardBtn: TButton
Left = 38
Top = 0
Width = 31
Height = 20
Hint = 'Touch keyboard'
Margins.Left = 5
Caption = '7'
Font.Charset = SYMBOL_CHARSET
Font.Color = clWindowText
Font.Height = -16
Font.Name = 'Wingdings'
Font.Style = []
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 2
OnClick = KeyboardBtnClick
end
end end
end end
object Panel1: TBufferPanel object Panel1: TBufferPanel
Left = 0 Left = 0
Top = 30 Top = 30
Width = 800 Width = 988
Height = 500 Height = 458
Align = alClient Align = alClient
Caption = 'Panel1' Caption = 'Panel1'
TabOrder = 1 TabOrder = 1
@ -120,6 +139,17 @@ object Form1: TForm1
OnResize = Panel1Resize OnResize = Panel1Resize
OnMouseLeave = Panel1MouseLeave OnMouseLeave = Panel1MouseLeave
end end
object TouchKeyboard1: TTouchKeyboard
Left = 0
Top = 488
Width = 988
Height = 180
Align = alBottom
GradientEnd = clSilver
GradientStart = clGray
Layout = 'Standard'
Visible = False
end
object chrmosr: TChromium object chrmosr: TChromium
OnTooltip = chrmosrTooltip OnTooltip = chrmosrTooltip
OnBeforePopup = chrmosrBeforePopup OnBeforePopup = chrmosrBeforePopup

View File

@ -45,10 +45,10 @@ uses
{$IFDEF DELPHI16_UP} {$IFDEF DELPHI16_UP}
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
System.SyncObjs, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.SyncObjs, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
Vcl.ExtCtrls, Vcl.AppEvnts, Vcl.ExtCtrls, Vcl.AppEvnts, Vcl.Touch.Keyboard,
{$ELSE} {$ELSE}
Windows, Messages, SysUtils, Variants, Classes, SyncObjs, Windows, Messages, SysUtils, Variants, Classes, SyncObjs,
Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, AppEvnts, Keyboard,
{$ENDIF} {$ENDIF}
uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uBufferPanel; uCEFChromium, uCEFTypes, uCEFInterfaces, uCEFConstants, uBufferPanel;
@ -64,6 +64,8 @@ type
SaveDialog1: TSaveDialog; SaveDialog1: TSaveDialog;
Timer1: TTimer; Timer1: TTimer;
Panel1: TBufferPanel; Panel1: TBufferPanel;
KeyboardBtn: TButton;
TouchKeyboard1: TTouchKeyboard;
procedure AppEventsMessage(var Msg: tagMSG; var Handled: Boolean); procedure AppEventsMessage(var Msg: tagMSG; var Handled: Boolean);
@ -103,6 +105,7 @@ type
procedure Timer1Timer(Sender: TObject); procedure Timer1Timer(Sender: TObject);
procedure SnapshotBtnEnter(Sender: TObject); procedure SnapshotBtnEnter(Sender: TObject);
procedure ComboBox1Enter(Sender: TObject); procedure ComboBox1Enter(Sender: TObject);
procedure KeyboardBtnClick(Sender: TObject);
protected protected
FPopUpBitmap : TBitmap; FPopUpBitmap : TBitmap;
@ -813,6 +816,11 @@ begin
FLastClickButton := mbLeft; FLastClickButton := mbLeft;
end; end;
procedure TForm1.KeyboardBtnClick(Sender: TObject);
begin
TouchKeyboard1.Visible := not(TouchKeyboard1.Visible);
end;
function TForm1.CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean; function TForm1.CancelPreviousClick(x, y : integer; var aCurrentTime : integer) : boolean;
begin begin
aCurrentTime := GetMessageTime; aCurrentTime := GetMessageTime;