mirror of
https://github.com/salvadordf/CEF4Delphi.git
synced 2025-03-27 20:20:31 +02:00
Added the MiniBrowserD7 demo for Delphi 7
This commit is contained in:
parent
7b2d343ec8
commit
d773926952
18
demos/Delphi_VCL/MiniBrowserD7/00-DeleteDCUs.bat
Normal file
18
demos/Delphi_VCL/MiniBrowserD7/00-DeleteDCUs.bat
Normal file
@ -0,0 +1,18 @@
|
||||
del /s /q *.dcu
|
||||
del /s /q *.exe
|
||||
del /s /q *.res
|
||||
del /s /q *.rsm
|
||||
del /s /q *.log
|
||||
del /s /q *.dsk
|
||||
del /s /q *.identcache
|
||||
del /s /q *.stat
|
||||
del /s /q *.local
|
||||
del /s /q *.~*
|
||||
rmdir Win32\Debug
|
||||
rmdir Win32\Release
|
||||
rmdir Win32
|
||||
rmdir Win64\Debug
|
||||
rmdir Win64\Release
|
||||
rmdir Win64
|
||||
rmdir __history
|
||||
rmdir __recovery
|
146
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dof
Normal file
146
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dof
Normal file
@ -0,0 +1,146 @@
|
||||
[FileVersion]
|
||||
Version=7.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
NamespacePrefix=
|
||||
SymbolDeprecated=1
|
||||
SymbolLibrary=1
|
||||
SymbolPlatform=1
|
||||
UnitLibrary=1
|
||||
UnitPlatform=1
|
||||
UnitDeprecated=1
|
||||
HResultCompat=1
|
||||
HidingMember=1
|
||||
HiddenVirtual=1
|
||||
Garbage=1
|
||||
BoundsError=1
|
||||
ZeroNilCompat=1
|
||||
StringConstTruncated=1
|
||||
ForLoopVarVarPar=1
|
||||
TypedConstVarPar=1
|
||||
AsgToTypedConst=1
|
||||
CaseLabelRange=1
|
||||
ForVariable=1
|
||||
ConstructingAbstract=1
|
||||
ComparisonFalse=1
|
||||
ComparisonTrue=1
|
||||
ComparingSignedUnsigned=1
|
||||
CombiningSignedUnsigned=1
|
||||
UnsupportedConstruct=1
|
||||
FileOpen=1
|
||||
FileOpenUnitSrc=1
|
||||
BadGlobalSymbol=1
|
||||
DuplicateConstructorDestructor=1
|
||||
InvalidDirective=1
|
||||
PackageNoLink=1
|
||||
PackageThreadVar=1
|
||||
ImplicitImport=1
|
||||
HPPEMITIgnored=1
|
||||
NoRetVal=1
|
||||
UseBeforeDef=1
|
||||
ForLoopVarUndef=1
|
||||
UnitNameMismatch=1
|
||||
NoCFGFileFound=1
|
||||
MessageDirective=1
|
||||
ImplicitVariants=1
|
||||
UnicodeToLocale=1
|
||||
LocaleToUnicode=1
|
||||
ImagebaseMultiple=1
|
||||
SuspiciousTypecast=1
|
||||
PrivatePropAccessor=1
|
||||
UnsafeType=0
|
||||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=..\..\..\bin
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=..\..\..\source
|
||||
Packages=vcl;rtl;vclx;indy;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP;CEF4Delphi;WebView4Delphi
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
[Version Info]
|
||||
IncludeVerInfo=0
|
||||
AutoIncBuild=0
|
||||
MajorVer=1
|
||||
MinorVer=0
|
||||
Release=0
|
||||
Build=0
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=3082
|
||||
CodePage=1252
|
||||
[Version Info Keys]
|
||||
CompanyName=
|
||||
FileDescription=
|
||||
FileVersion=1.0.0.0
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=
|
||||
ProductVersion=1.0.0.0
|
||||
Comments=
|
||||
[HistoryLists\hlUnitAliases]
|
||||
Count=1
|
||||
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
[HistoryLists\hlSearchPath]
|
||||
Count=2
|
||||
Item0=..\..\..\source
|
||||
Item1=..\..\source
|
||||
[HistoryLists\hlOutputDirectorry]
|
||||
Count=1
|
||||
Item0=..\..\..\bin
|
25
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dpr
Normal file
25
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dpr
Normal file
@ -0,0 +1,25 @@
|
||||
program MiniBrowser;
|
||||
|
||||
{$I cef.inc}
|
||||
|
||||
uses
|
||||
Forms,
|
||||
uCEFApplication,
|
||||
uMiniBrowser in 'uMiniBrowser.pas' {MiniBrowserFrm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
{$SetPEFlags $20}
|
||||
|
||||
begin
|
||||
CreateGlobalCEFApp;
|
||||
|
||||
if GlobalCEFApp.StartMainProcess then
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TMiniBrowserFrm, MiniBrowserFrm);
|
||||
Application.Run;
|
||||
end;
|
||||
|
||||
DestroyGlobalCEFApp;
|
||||
end.
|
1020
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dproj
Normal file
1020
demos/Delphi_VCL/MiniBrowserD7/MiniBrowser.dproj
Normal file
File diff suppressed because it is too large
Load Diff
507
demos/Delphi_VCL/MiniBrowserD7/cef.inc
Normal file
507
demos/Delphi_VCL/MiniBrowserD7/cef.inc
Normal file
@ -0,0 +1,507 @@
|
||||
// The complete list of compiler versions is here :
|
||||
// http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Compiler_Versions
|
||||
|
||||
{$DEFINE DELPHI_VERSION_UNKNOW}
|
||||
|
||||
// Delphi 5
|
||||
{$IFDEF VER130}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi 6
|
||||
{$IFDEF VER140}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi 7
|
||||
{$IFDEF VER150}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi 8
|
||||
{$IFDEF VER160}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi 2005
|
||||
{$IFDEF VER170}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF VER180}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
// Delphi 2007
|
||||
{$IFDEF VER185}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
// Delphi 2006
|
||||
{$ELSE}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi 2009
|
||||
{$IFDEF VER200}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$ENDIF}
|
||||
|
||||
//Delphi 2010
|
||||
{$IFDEF VER210}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE
|
||||
{$IFDEF VER220}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE2 (First FireMonkey and 64bit compiler)
|
||||
{$IFDEF VER230}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE3
|
||||
{$IFDEF VER240}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE4
|
||||
{$IFDEF VER250}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE5
|
||||
{$IFDEF VER260}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE6
|
||||
{$IFDEF VER270}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE7
|
||||
{$IFDEF VER280}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Delphi XE8
|
||||
{$IFDEF VER290}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$ENDIF VER290}
|
||||
|
||||
// Rad Studio 10 - Delphi Seattle
|
||||
{$IFDEF VER300}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 10.1 - Delphi Berlin
|
||||
{$IFDEF VER310}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 10.2 - Delphi Tokyo
|
||||
{$IFDEF VER320}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 10.3 - Delphi Rio
|
||||
{$IFDEF VER330}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 10.4 - Delphi Sydney
|
||||
{$IFDEF VER340}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$DEFINE DELPHI27_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 11.0 - Delphi Alexandria
|
||||
{$IFDEF VER350}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$DEFINE DELPHI27_UP}
|
||||
{$DEFINE DELPHI28_UP}
|
||||
{$ENDIF}
|
||||
|
||||
// Rad Studio 12.0 - Delphi Yukon
|
||||
{$IFDEF VER360}
|
||||
{$UNDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$DEFINE DELPHI27_UP}
|
||||
{$DEFINE DELPHI28_UP}
|
||||
{$DEFINE DELPHI29_UP}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$DEFINE SUPPORTS_INLINE}
|
||||
{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)}
|
||||
{$DEFINE FPC_VER_320}
|
||||
{$IFEND}
|
||||
{$ELSE}
|
||||
{$IFDEF DELPHI_VERSION_UNKNOW}
|
||||
{$DEFINE DELPHI5_UP}
|
||||
{$DEFINE DELPHI6_UP}
|
||||
{$DEFINE DELPHI7_UP}
|
||||
{$DEFINE DELPHI8_UP}
|
||||
{$DEFINE DELPHI9_UP}
|
||||
{$DEFINE DELPHI10_UP}
|
||||
{$DEFINE DELPHI11_UP}
|
||||
{$DEFINE DELPHI12_UP}
|
||||
{$DEFINE DELPHI14_UP}
|
||||
{$DEFINE DELPHI15_UP}
|
||||
{$DEFINE DELPHI16_UP}
|
||||
{$DEFINE DELPHI17_UP}
|
||||
{$DEFINE DELPHI18_UP}
|
||||
{$DEFINE DELPHI19_UP}
|
||||
{$DEFINE DELPHI20_UP}
|
||||
{$DEFINE DELPHI21_UP}
|
||||
{$DEFINE DELPHI22_UP}
|
||||
{$DEFINE DELPHI23_UP}
|
||||
{$DEFINE DELPHI24_UP}
|
||||
{$DEFINE DELPHI25_UP}
|
||||
{$DEFINE DELPHI26_UP}
|
||||
{$DEFINE DELPHI27_UP}
|
||||
{$DEFINE DELPHI28_UP}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF DELPHI9_UP}
|
||||
{$DEFINE SUPPORTS_INLINE}
|
||||
{$ENDIF}
|
||||
|
||||
{$IF DEFINED(CPUX32) OR
|
||||
DEFINED(CPU32) OR
|
||||
DEFINED(CPU32BITS) OR
|
||||
DEFINED(CPUARM32) OR
|
||||
DEFINED(WIN32) OR
|
||||
DEFINED(IOS32) OR
|
||||
DEFINED(MACOS32) OR
|
||||
DEFINED(LINUX32) OR
|
||||
DEFINED(POSIX32) OR
|
||||
DEFINED(ANDROID32)}
|
||||
{$DEFINE TARGET_32BITS}
|
||||
{$ELSE}
|
||||
{$IF DEFINED(CPUX64) OR
|
||||
DEFINED(CPU64) OR
|
||||
DEFINED(CPU64BITS) OR
|
||||
DEFINED(CPUARM64) OR
|
||||
DEFINED(WIN64) OR
|
||||
DEFINED(IOS64) OR
|
||||
DEFINED(MACOS64) OR
|
||||
DEFINED(LINUX64) OR
|
||||
DEFINED(POSIX64) OR
|
||||
DEFINED(ANDROID64)}
|
||||
{$DEFINE TARGET_64BITS}
|
||||
{$IFEND}
|
||||
{$IFEND}
|
||||
|
||||
// Delphi uses MACOS for the new MacOSX and DARWIN is not defined
|
||||
// FPC uses DARWIN for the new MacOSX and MACOS is defined for the classic Macintosh OS (System 7)
|
||||
// We define MACOSX to avoid conflicts in both situations
|
||||
{$IFDEF FPC}
|
||||
{$IFDEF DARWIN}
|
||||
{$DEFINE MACOSX}
|
||||
{$ENDIF}
|
||||
{$ELSE}
|
||||
{$IFDEF MACOS}
|
||||
{$DEFINE MACOSX}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
|
||||
{$IFDEF LINUX}
|
||||
{$IFDEF FPC}
|
||||
{$DEFINE LINUXFPC}
|
||||
{$ELSE}
|
||||
{$DEFINE LINUXFMX}
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
BIN
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.ddp
Normal file
BIN
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.ddp
Normal file
Binary file not shown.
303
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.dfm
Normal file
303
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.dfm
Normal file
@ -0,0 +1,303 @@
|
||||
object MiniBrowserFrm: TMiniBrowserFrm
|
||||
Left = 528
|
||||
Top = 154
|
||||
Width = 1196
|
||||
Height = 750
|
||||
Caption = 'MiniBrowser'
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = True
|
||||
Position = poScreenCenter
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object NavControlPnl: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1180
|
||||
Height = 41
|
||||
Align = alTop
|
||||
BevelOuter = bvNone
|
||||
Enabled = False
|
||||
TabOrder = 1
|
||||
object NavButtonPnl: TPanel
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 133
|
||||
Height = 41
|
||||
Align = alLeft
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 0
|
||||
object BackBtn: TButton
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = '3'
|
||||
Font.Charset = SYMBOL_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -19
|
||||
Font.Name = 'Webdings'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
OnClick = BackBtnClick
|
||||
end
|
||||
object ForwardBtn: TButton
|
||||
Left = 39
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = '4'
|
||||
Font.Charset = SYMBOL_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -19
|
||||
Font.Name = 'Webdings'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = ForwardBtnClick
|
||||
end
|
||||
object ReloadBtn: TButton
|
||||
Left = 70
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = 'q'
|
||||
Font.Charset = SYMBOL_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -19
|
||||
Font.Name = 'Webdings'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 2
|
||||
OnClick = ReloadBtnClick
|
||||
end
|
||||
object StopBtn: TButton
|
||||
Left = 101
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = '='
|
||||
Font.Charset = SYMBOL_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -19
|
||||
Font.Name = 'Webdings'
|
||||
Font.Style = []
|
||||
ParentFont = False
|
||||
TabOrder = 3
|
||||
OnClick = StopBtnClick
|
||||
end
|
||||
end
|
||||
object URLEditPnl: TPanel
|
||||
Left = 133
|
||||
Top = 0
|
||||
Width = 974
|
||||
Height = 41
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 1
|
||||
object URLCbx: TComboBox
|
||||
Left = 0
|
||||
Top = 9
|
||||
Width = 974
|
||||
Height = 21
|
||||
ItemHeight = 13
|
||||
ItemIndex = 0
|
||||
TabOrder = 0
|
||||
Text = 'https://www.google.com'
|
||||
Items.Strings = (
|
||||
'https://www.google.com'
|
||||
|
||||
'https://www.whatismybrowser.com/detect/what-http-headers-is-my-b' +
|
||||
'rowser-sending'
|
||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_win_close'
|
||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_alert'
|
||||
'https://www.w3schools.com/js/tryit.asp?filename=tryjs_loc_assign'
|
||||
|
||||
'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_styl' +
|
||||
'e_backgroundcolor'
|
||||
|
||||
'https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml_iframe' +
|
||||
'_name'
|
||||
|
||||
'https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input' +
|
||||
'_type_file'
|
||||
|
||||
'https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_stat' +
|
||||
'e_throw_error'
|
||||
'https://www.htmlquick.com/es/reference/tags/input-file.html'
|
||||
|
||||
'https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/' +
|
||||
'file'
|
||||
|
||||
'https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElemen' +
|
||||
't/webkitdirectory'
|
||||
'https://www.w3schools.com/html/html5_video.asp'
|
||||
'http://html5test.com/'
|
||||
|
||||
'https://webrtc.github.io/samples/src/content/devices/input-outpu' +
|
||||
't/'
|
||||
'https://test.webrtc.org/'
|
||||
'https://www.browserleaks.com/webrtc'
|
||||
'https://shaka-player-demo.appspot.com/demo/'
|
||||
'http://webglsamples.org/'
|
||||
'https://get.webgl.org/'
|
||||
'https://www.briskbard.com'
|
||||
'https://www.youtube.com'
|
||||
'https://html5demos.com/drag/'
|
||||
'https://frames-per-second.appspot.com/'
|
||||
|
||||
'https://www.sede.fnmt.gob.es/certificados/persona-fisica/verific' +
|
||||
'ar-estado'
|
||||
'https://www.kirupa.com/html5/accessing_your_webcam_in_html5.htm'
|
||||
'https://www.xdumaine.com/enumerateDevices/test/'
|
||||
|
||||
'https://dagrs.berkeley.edu/sites/default/files/2020-01/sample.pd' +
|
||||
'f'
|
||||
'chrome://version/'
|
||||
'chrome://net-internals/'
|
||||
'chrome://tracing/'
|
||||
'chrome://appcache-internals/'
|
||||
'chrome://blob-internals/'
|
||||
'chrome://view-http-cache/'
|
||||
'chrome://credits/'
|
||||
'chrome://histograms/'
|
||||
'chrome://media-internals/'
|
||||
'chrome://kill'
|
||||
'chrome://crash'
|
||||
'chrome://hang'
|
||||
'chrome://shorthang'
|
||||
'chrome://gpuclean'
|
||||
'chrome://gpucrash'
|
||||
'chrome://gpuhang'
|
||||
'chrome://extensions-support'
|
||||
'chrome://process-internals')
|
||||
end
|
||||
end
|
||||
object ConfigPnl: TPanel
|
||||
Left = 1107
|
||||
Top = 0
|
||||
Width = 73
|
||||
Height = 41
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
TabOrder = 2
|
||||
object ConfigBtn: TButton
|
||||
Left = 40
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = '='
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -17
|
||||
Font.Name = 'Arial'
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 0
|
||||
OnClick = ConfigBtnClick
|
||||
end
|
||||
object GoBtn: TButton
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 25
|
||||
Height = 25
|
||||
Caption = '>'
|
||||
Font.Charset = ANSI_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -17
|
||||
Font.Name = 'Arial Black'
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
TabOrder = 1
|
||||
OnClick = GoBtnClick
|
||||
end
|
||||
end
|
||||
end
|
||||
object CEFWindowParent1: TCEFWindowParent
|
||||
Left = 0
|
||||
Top = 41
|
||||
Width = 1180
|
||||
Height = 651
|
||||
Align = alClient
|
||||
TabStop = True
|
||||
TabOrder = 0
|
||||
DoubleBuffered = False
|
||||
end
|
||||
object StatusBar1: TStatusBar
|
||||
Left = 0
|
||||
Top = 692
|
||||
Width = 1180
|
||||
Height = 19
|
||||
Panels = <
|
||||
item
|
||||
Width = 100
|
||||
end
|
||||
item
|
||||
Width = 500
|
||||
end
|
||||
item
|
||||
Width = 100
|
||||
end
|
||||
item
|
||||
Width = 100
|
||||
end
|
||||
item
|
||||
Width = 50
|
||||
end>
|
||||
end
|
||||
object Chromium1: TChromium
|
||||
OnLoadEnd = Chromium1LoadEnd
|
||||
OnLoadError = Chromium1LoadError
|
||||
OnBeforeContextMenu = Chromium1BeforeContextMenu
|
||||
OnContextMenuCommand = Chromium1ContextMenuCommand
|
||||
OnAddressChange = Chromium1AddressChange
|
||||
OnTitleChange = Chromium1TitleChange
|
||||
OnStatusMessage = Chromium1StatusMessage
|
||||
OnAfterCreated = Chromium1AfterCreated
|
||||
OnBeforeClose = Chromium1BeforeClose
|
||||
OnClose = Chromium1Close
|
||||
Left = 32
|
||||
Top = 224
|
||||
end
|
||||
object PopupMenu1: TPopupMenu
|
||||
Left = 32
|
||||
Top = 168
|
||||
object Print1: TMenuItem
|
||||
Caption = 'Print'
|
||||
OnClick = Print1Click
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object Zoom1: TMenuItem
|
||||
Caption = 'Zoom'
|
||||
object Inczoom1: TMenuItem
|
||||
Caption = 'Inc zoom'
|
||||
OnClick = Inczoom1Click
|
||||
end
|
||||
object Deczoom1: TMenuItem
|
||||
Caption = 'Dec zoom'
|
||||
OnClick = Deczoom1Click
|
||||
end
|
||||
object Resetzoom1: TMenuItem
|
||||
Caption = 'Reset zoom'
|
||||
OnClick = Resetzoom1Click
|
||||
end
|
||||
end
|
||||
end
|
||||
object Timer1: TTimer
|
||||
Enabled = False
|
||||
Interval = 300
|
||||
OnTimer = Timer1Timer
|
||||
Left = 32
|
||||
Top = 104
|
||||
end
|
||||
end
|
414
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas
Normal file
414
demos/Delphi_VCL/MiniBrowserD7/uMiniBrowser.pas
Normal file
@ -0,0 +1,414 @@
|
||||
unit uMiniBrowser;
|
||||
|
||||
{$I cef.inc}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Menus,
|
||||
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls,
|
||||
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFTypes,
|
||||
uCEFConstants, uCEFWinControl, uCEFChromiumCore;
|
||||
|
||||
const
|
||||
MINIBROWSER_HOMEPAGE = 'https://www.google.com';
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_MUTEAUDIO = MENU_ID_USER_FIRST + 1;
|
||||
MINIBROWSER_CONTEXTMENU_UNMUTEAUDIO = MENU_ID_USER_FIRST + 2;
|
||||
MINIBROWSER_CONTEXTMENU_INCZOOM = MENU_ID_USER_FIRST + 3;
|
||||
MINIBROWSER_CONTEXTMENU_DECZOOM = MENU_ID_USER_FIRST + 4;
|
||||
MINIBROWSER_CONTEXTMENU_RESETZOOM = MENU_ID_USER_FIRST + 5;
|
||||
|
||||
type
|
||||
TMiniBrowserFrm = class(TForm)
|
||||
NavControlPnl: TPanel;
|
||||
NavButtonPnl: TPanel;
|
||||
URLEditPnl: TPanel;
|
||||
BackBtn: TButton;
|
||||
ForwardBtn: TButton;
|
||||
ReloadBtn: TButton;
|
||||
CEFWindowParent1: TCEFWindowParent;
|
||||
Chromium1: TChromium;
|
||||
StopBtn: TButton;
|
||||
StatusBar1: TStatusBar;
|
||||
URLCbx: TComboBox;
|
||||
ConfigPnl: TPanel;
|
||||
ConfigBtn: TButton;
|
||||
PopupMenu1: TPopupMenu;
|
||||
GoBtn: TButton;
|
||||
Print1: TMenuItem;
|
||||
N3: TMenuItem;
|
||||
Zoom1: TMenuItem;
|
||||
Inczoom1: TMenuItem;
|
||||
Deczoom1: TMenuItem;
|
||||
Resetzoom1: TMenuItem;
|
||||
Timer1: TTimer;
|
||||
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
|
||||
procedure Chromium1AddressChange(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
|
||||
procedure Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
procedure Chromium1BeforeContextMenu(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||
procedure Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
procedure Chromium1ContextMenuCommand(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer; eventFlags: Cardinal; out Result: Boolean);
|
||||
procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer);
|
||||
procedure Chromium1LoadError(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer; const errorText, failedUrl: ustring);
|
||||
procedure Chromium1StatusMessage(Sender: TObject; const browser: ICefBrowser; const value: ustring);
|
||||
procedure Chromium1TitleChange(Sender: TObject; const browser: ICefBrowser; const title: ustring);
|
||||
|
||||
procedure BackBtnClick(Sender: TObject);
|
||||
procedure ConfigBtnClick(Sender: TObject);
|
||||
procedure Deczoom1Click(Sender: TObject);
|
||||
procedure ForwardBtnClick(Sender: TObject);
|
||||
procedure GoBtnClick(Sender: TObject);
|
||||
procedure Inczoom1Click(Sender: TObject);
|
||||
procedure Print1Click(Sender: TObject);
|
||||
procedure ReloadBtnClick(Sender: TObject);
|
||||
procedure Resetzoom1Click(Sender: TObject);
|
||||
procedure StopBtnClick(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
|
||||
protected
|
||||
// Variables to control when can we destroy the form safely
|
||||
FCanClose : boolean; // Set to True in TChromium.OnBeforeClose
|
||||
FClosing : boolean; // Set to True in the CloseQuery event.
|
||||
|
||||
procedure AddURL(const aURL : string);
|
||||
|
||||
procedure BrowserCreatedMsg(var aMessage : TMessage); message CEF_AFTERCREATED;
|
||||
procedure BrowserDestroyMsg(var aMessage : TMessage); message CEF_DESTROY;
|
||||
procedure WMEnterMenuLoop(var aMessage: TMessage); message WM_ENTERMENULOOP;
|
||||
procedure WMExitMenuLoop(var aMessage: TMessage); message WM_EXITMENULOOP;
|
||||
procedure WMMove(var aMessage : TWMMove); message WM_MOVE;
|
||||
procedure WMMoving(var aMessage : TMessage); message WM_MOVING;
|
||||
|
||||
public
|
||||
procedure ShowStatusText(const aText : string);
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
MiniBrowserFrm : TMiniBrowserFrm;
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
// Destruction steps
|
||||
// =================
|
||||
// 1. FormCloseQuery sets CanClose to FALSE calls TChromium.CloseBrowser which triggers the TChromium.OnClose event.
|
||||
// 2. TChromium.OnClose sends a CEFBROWSER_DESTROY message to destroy CEFWindowParent1 in the main thread, which triggers the TChromium.OnBeforeClose event.
|
||||
// 3. TChromium.OnBeforeClose sets FCanClose := True and sends WM_CLOSE to the form.
|
||||
|
||||
procedure CreateGlobalCEFApp;
|
||||
begin
|
||||
GlobalCEFApp := TCefApplication.Create;
|
||||
GlobalCEFApp.cache := 'cache';
|
||||
GlobalCEFApp.EnablePrintPreview := True;
|
||||
GlobalCEFApp.EnableGPU := True;
|
||||
GlobalCEFApp.LogFile := 'debug.log';
|
||||
GlobalCEFApp.LogSeverity := LOGSEVERITY_INFO;
|
||||
//GlobalCEFApp.ChromeRuntime := True;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BackBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.GoBack;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.ForwardBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.GoForward;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.GoBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.LoadURL(URLCbx.Text);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.ReloadBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.Reload;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Resetzoom1Click(Sender: TObject);
|
||||
begin
|
||||
Chromium1.ResetZoomStep;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.StopBtnClick(Sender: TObject);
|
||||
begin
|
||||
Chromium1.StopLoad;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Inczoom1Click(Sender: TObject);
|
||||
begin
|
||||
Chromium1.IncZoomStep;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Deczoom1Click(Sender: TObject);
|
||||
begin
|
||||
Chromium1.DecZoomStep;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Print1Click(Sender: TObject);
|
||||
begin
|
||||
Chromium1.Print;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.ConfigBtnClick(Sender: TObject);
|
||||
var
|
||||
TempPoint : TPoint;
|
||||
begin
|
||||
TempPoint.x := ConfigBtn.left;
|
||||
TempPoint.y := ConfigBtn.top + ConfigBtn.Height;
|
||||
TempPoint := ConfigPnl.ClientToScreen(TempPoint);
|
||||
|
||||
PopupMenu1.Popup(TempPoint.x, TempPoint.y);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1AddressChange(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; const url: ustring);
|
||||
begin
|
||||
if Chromium1.IsSameBrowser(browser) then AddURL(url);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1AfterCreated(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
if Chromium1.IsSameBrowser(browser) then
|
||||
PostMessage(Handle, CEF_AFTERCREATED, 0, 0)
|
||||
else
|
||||
SendMessage(browser.Host.WindowHandle, WM_SETICON, 1, Application.Icon.Handle); // Use the same icon in the popup window
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1BeforeClose(Sender: TObject; const browser: ICefBrowser);
|
||||
begin
|
||||
// The main browser is being destroyed
|
||||
if (Chromium1.BrowserId = 0) then
|
||||
begin
|
||||
FCanClose := True;
|
||||
PostMessage(Handle, WM_CLOSE, 0, 0);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1BeforeContextMenu(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame;
|
||||
const params: ICefContextMenuParams; const model: ICefMenuModel);
|
||||
begin
|
||||
model.AddSeparator;
|
||||
if Chromium1.AudioMuted then
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_UNMUTEAUDIO, 'Unmute audio')
|
||||
else
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_MUTEAUDIO, 'Mute audio');
|
||||
|
||||
model.AddSeparator;
|
||||
if Chromium1.CanIncZoom then
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_INCZOOM, 'Increment zoom');
|
||||
|
||||
if Chromium1.CanDecZoom then
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_DECZOOM, 'Decrement zoom');
|
||||
|
||||
if Chromium1.CanResetZoom then
|
||||
model.AddItem(MINIBROWSER_CONTEXTMENU_RESETZOOM, 'Reset zoom');
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1Close(Sender: TObject; const browser: ICefBrowser; var aAction : TCefCloseBrowserAction);
|
||||
begin
|
||||
if (browser <> nil) and
|
||||
(Chromium1.BrowserId = browser.Identifier) and
|
||||
(CEFWindowParent1 <> nil) then
|
||||
begin
|
||||
PostMessage(Handle, CEF_DESTROY, 0, 0);
|
||||
aAction := cbaDelay;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1ContextMenuCommand(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame;
|
||||
const params: ICefContextMenuParams; commandId: Integer;
|
||||
eventFlags: Cardinal; out Result: Boolean);
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
case commandId of
|
||||
MINIBROWSER_CONTEXTMENU_UNMUTEAUDIO :
|
||||
Chromium1.AudioMuted := False;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_MUTEAUDIO :
|
||||
Chromium1.AudioMuted := True;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_INCZOOM :
|
||||
Chromium1.IncZoomCommand;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_DECZOOM :
|
||||
Chromium1.DecZoomCommand;
|
||||
|
||||
MINIBROWSER_CONTEXTMENU_RESETZOOM :
|
||||
Chromium1.ResetZoomCommand;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1LoadEnd(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame;
|
||||
httpStatusCode: Integer);
|
||||
var
|
||||
TempHandle : THandle;
|
||||
begin
|
||||
if FClosing or (frame = nil) or not(frame.IsValid) or (browser = nil) then exit;
|
||||
|
||||
if not Chromium1.IsSameBrowser(browser) then
|
||||
begin
|
||||
// This is a workaround for a focus issue in popup windows handled by CEF
|
||||
TempHandle := Windows.GetWindow(Browser.Host.WindowHandle, GW_OWNER);
|
||||
if (TempHandle <> Handle) then
|
||||
Windows.SetFocus(TempHandle);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1LoadError(Sender: TObject;
|
||||
const browser: ICefBrowser; const frame: ICefFrame; errorCode: Integer;
|
||||
const errorText, failedUrl: ustring);
|
||||
var
|
||||
TempString : string;
|
||||
begin
|
||||
if (errorCode = ERR_ABORTED) then exit;
|
||||
|
||||
TempString := '<html><body bgcolor="white">' +
|
||||
'<h2>Failed to load URL ' + failedUrl +
|
||||
' with error ' + errorText +
|
||||
' (' + inttostr(errorCode) + ').</h2></body></html>';
|
||||
|
||||
Chromium1.LoadString(TempString, frame);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.ShowStatusText(const aText : string);
|
||||
begin
|
||||
if not(FClosing) then StatusBar1.Panels[1].Text := aText;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1StatusMessage(Sender: TObject;
|
||||
const browser: ICefBrowser; const value: ustring);
|
||||
begin
|
||||
if Chromium1.IsSameBrowser(browser) then ShowStatusText(value);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Chromium1TitleChange(Sender: TObject;
|
||||
const browser: ICefBrowser; const title: ustring);
|
||||
begin
|
||||
if not(Chromium1.IsSameBrowser(browser)) then exit;
|
||||
|
||||
if (title <> '') then
|
||||
caption := 'MiniBrowser - ' + title
|
||||
else
|
||||
caption := 'MiniBrowser';
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
begin
|
||||
CanClose := FCanClose;
|
||||
|
||||
if not(FClosing) then
|
||||
begin
|
||||
FClosing := True;
|
||||
Visible := False;
|
||||
|
||||
// if TChromium.MultiBrowserMode is enabled then we have to close all
|
||||
// stored browsers and not only the main browser.
|
||||
Chromium1.CloseAllBrowsers;
|
||||
|
||||
// Workaround for the missing TChormium.OnClose event when "Chrome runtime" is enabled.
|
||||
if GlobalCEFApp.ChromeRuntime then
|
||||
CEFWindowParent1.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FCanClose := False;
|
||||
FClosing := False;
|
||||
|
||||
// The MultiBrowserMode store all the browser references in TChromium.
|
||||
// The first browser reference is the browser in the main form.
|
||||
// When MiniBrowser allows CEF to create child popup browsers it will also
|
||||
// store their reference inside TChromium and you can use all the TChromium's
|
||||
// methods and properties to manipulate those browsers.
|
||||
// To do that call TChromium.SelectBrowser with the browser ID that will be
|
||||
// used when you call any method or property in TChromium.
|
||||
Chromium1.MultiBrowserMode := True;
|
||||
Chromium1.DefaultURL := MINIBROWSER_HOMEPAGE;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.FormShow(Sender: TObject);
|
||||
begin
|
||||
ShowStatusText('Initializing browser. Please wait...');
|
||||
|
||||
// GlobalCEFApp.GlobalContextInitialized has to be TRUE before creating any browser
|
||||
// If it's not initialized yet, we use a simple timer to create the browser later.
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled := False;
|
||||
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) and not(Chromium1.Initialized) then
|
||||
Timer1.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.AddURL(const aURL : string);
|
||||
begin
|
||||
if (URLCbx.Items.IndexOf(aURL) < 0) then
|
||||
URLCbx.Items.Add(aURL);
|
||||
|
||||
URLCbx.Text := aURL;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BrowserCreatedMsg(var aMessage : TMessage);
|
||||
begin
|
||||
CEFWindowParent1.UpdateSize;
|
||||
NavControlPnl.Enabled := True;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.BrowserDestroyMsg(var aMessage : TMessage);
|
||||
begin
|
||||
FreeAndNil(CEFWindowParent1);
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.WMMove(var aMessage : TWMMove);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then
|
||||
Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.WMMoving(var aMessage : TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (Chromium1 <> nil) then
|
||||
Chromium1.NotifyMoveOrResizeStarted;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.WMEnterMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := True;
|
||||
end;
|
||||
|
||||
procedure TMiniBrowserFrm.WMExitMenuLoop(var aMessage: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if (aMessage.wParam = 0) and (GlobalCEFApp <> nil) then
|
||||
GlobalCEFApp.OsmodalLoop := False;
|
||||
end;
|
||||
|
||||
end.
|
@ -2,7 +2,7 @@
|
||||
"UpdateLazPackages" : [
|
||||
{
|
||||
"ForceNotify" : true,
|
||||
"InternalVersion" : 534,
|
||||
"InternalVersion" : 535,
|
||||
"Name" : "cef4delphi_lazarus.lpk",
|
||||
"Version" : "118.6.9"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user