Importación inicial con versión 12.0.4
NO HAY CÓDIGO FUENTE git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.TRichView@1 b34d35ef-135b-4489-b9d1-9916e9c25524
This commit is contained in:
commit
fddb8c1dff
175
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.bdsproj
Normal file
175
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.bdsproj
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType">VCLApplication</Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{0977BF2F-F5DC-49B7-BE93-C86769B0709E}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Project1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||||
|
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="CodePage"></Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="GenerateHpps">False</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
14
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.dpr
Normal file
14
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.dpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
RVBlendBitmap in '..\..\RVBlendBitmap.pas';
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.res
Normal file
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Project1.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Unit1.dfm
Normal file
Binary file not shown.
94
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Unit1.pas
Normal file
94
12.0.4/Demos/Addins/BlendBitmap/Demo/Delphi/Unit1.pas
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
{==============================================================================}
|
||||||
|
{ Example of new item type for RichView: }
|
||||||
|
{ - TRVBlendBitmapItemInfo }
|
||||||
|
{ (semi-transparent image) }
|
||||||
|
{ - TRVHotBlendBitmapItemInfo }
|
||||||
|
{ (semi-transparent image - hypertext link) }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ (c) Sergey Tkachenko (svt@trichview.com) }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{==============================================================================}
|
||||||
|
|
||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
ExtCtrls, RVStyle, RVScroll, RichView, RVBlendBitmap, StdCtrls, ShellApi;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichView1: TRichView;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
Image1: TImage;
|
||||||
|
Image2: TImage;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RichView1Jump(Sender: TObject; id: Integer);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var bmp: TBitmap;
|
||||||
|
item: TRVHotBlendBitmapItemInfo;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
// Note: not very fast drawing, so do not use for large images
|
||||||
|
// Note: you can save RVF documents with semitransparent images
|
||||||
|
// (RVF reader must have RVBlendBMP.pas unit in order to
|
||||||
|
// load such files)
|
||||||
|
|
||||||
|
RichView1.AddBreak;
|
||||||
|
RichView1.AddNL('Example of Semitransparent Image',1,1);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNL('some text',0,0);
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.Assign(Image1.Picture.Bitmap);
|
||||||
|
item := TRVHotBlendBitmapItemInfo.CreateEx(RichView1.RVData, bmp, rvvaBaseline);
|
||||||
|
item.Transparency := 100;
|
||||||
|
item.HotTransparency := 0;
|
||||||
|
// 0 - no transparency,
|
||||||
|
// 255 - fully transparent (invisible)
|
||||||
|
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('', item);
|
||||||
|
RichView1.AddNL('www.trichview.com',4,1);
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNL('some text',0,0);
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.Assign(Image2.Picture.Bitmap);
|
||||||
|
item := TRVHotBlendBitmapItemInfo.CreateEx(RichView1.RVData, bmp, rvvaBaseline);
|
||||||
|
item.Transparency := 200;
|
||||||
|
item.HotTransparency := 100;
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('', item);
|
||||||
|
RichView1.AddNL('www.trichview.com',4,1);
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNL('some text',0,0);
|
||||||
|
|
||||||
|
RichView1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichView1Jump(Sender: TObject; id: Integer);
|
||||||
|
begin
|
||||||
|
ShellExecute(0, 'open', 'http://www.trichview.com', nil, nil, SW_SHOW)
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
RVBlendBitmap in '..\..\RVBlendBitmap.pas';
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{0977BF2F-F5DC-49B7-BE93-C86769B0709E}</ProjectGuid>
|
||||||
|
<MainSource>Project1.dpr</MainSource>
|
||||||
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
|
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||||
|
<ProjectVersion>12.0</ProjectVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<DCC_ImageBase>00400000</DCC_ImageBase>
|
||||||
|
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DependencyCheckOutputName>Project1.exe</DCC_DependencyCheckOutputName>
|
||||||
|
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
|
||||||
|
<DCC_Platform>x86</DCC_Platform>
|
||||||
|
<DCC_N>true</DCC_N>
|
||||||
|
<DCC_S>false</DCC_S>
|
||||||
|
<DCC_K>false</DCC_K>
|
||||||
|
<DCC_E>false</DCC_E>
|
||||||
|
<DCC_F>false</DCC_F>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||||
|
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DebugInformation>false</DCC_DebugInformation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="Project1.dpr">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="Unit1.pas">
|
||||||
|
<Form>Form1</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="..\..\RVBlendBitmap.pas"/>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Debug">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Project1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"/>
|
||||||
|
<VersionInfoKeys Name="FileDescription"/>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"/>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"/>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"/>
|
||||||
|
<VersionInfoKeys Name="ProductName"/>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"/>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
</Project>
|
||||||
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Project1.res
Normal file
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Project1.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Unit1.dfm
Normal file
Binary file not shown.
94
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Unit1.pas
Normal file
94
12.0.4/Demos/Addins/BlendBitmap/Demo/DelphiUnicode/Unit1.pas
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
{==============================================================================}
|
||||||
|
{ Example of new item type for RichView: }
|
||||||
|
{ - TRVBlendBitmapItemInfo }
|
||||||
|
{ (semi-transparent image) }
|
||||||
|
{ - TRVHotBlendBitmapItemInfo }
|
||||||
|
{ (semi-transparent image - hypertext link) }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ (c) Sergey Tkachenko (svt@trichview.com) }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{==============================================================================}
|
||||||
|
|
||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
ExtCtrls, RVStyle, RVScroll, RichView, RVBlendBitmap, StdCtrls, ShellApi;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichView1: TRichView;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
Image1: TImage;
|
||||||
|
Image2: TImage;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RichView1Jump(Sender: TObject; id: Integer);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var bmp: TBitmap;
|
||||||
|
item: TRVHotBlendBitmapItemInfo;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
// Note: not very fast drawing, so do not use for large images
|
||||||
|
// Note: you can save RVF documents with semitransparent images
|
||||||
|
// (RVF reader must have RVBlendBMP.pas unit in order to
|
||||||
|
// load such files)
|
||||||
|
|
||||||
|
RichView1.AddBreak;
|
||||||
|
RichView1.AddNLWTag('Example of Semitransparent Image',1,1,0);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNLWTag('some text',0,0,0);
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.Assign(Image1.Picture.Bitmap);
|
||||||
|
item := TRVHotBlendBitmapItemInfo.CreateEx(RichView1.RVData, bmp, rvvaBaseline);
|
||||||
|
item.Transparency := 100;
|
||||||
|
item.HotTransparency := 0;
|
||||||
|
// 0 - no transparency,
|
||||||
|
// 255 - fully transparent (invisible)
|
||||||
|
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('', item);
|
||||||
|
RichView1.AddNLWTag('www.trichview.com',4,1,0);
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNLWTag('some text',0,0,0);
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.Assign(Image2.Picture.Bitmap);
|
||||||
|
item := TRVHotBlendBitmapItemInfo.CreateEx(RichView1.RVData, bmp, rvvaBaseline);
|
||||||
|
item.Transparency := 200;
|
||||||
|
item.HotTransparency := 100;
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('', item);
|
||||||
|
RichView1.AddNLWTag('www.trichview.com',4,1,0);
|
||||||
|
|
||||||
|
for i := 0 to 10 do
|
||||||
|
RichView1.AddNLWTag('some text',0,0,0);
|
||||||
|
|
||||||
|
RichView1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichView1Jump(Sender: TObject; id: Integer);
|
||||||
|
begin
|
||||||
|
ShellExecute(0, 'open', 'http://www.trichview.com', nil, nil, SW_SHOW)
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
201
12.0.4/Demos/Addins/BlendBitmap/RVBlendBitmap.pas
Normal file
201
12.0.4/Demos/Addins/BlendBitmap/RVBlendBitmap.pas
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
unit RVBlendBitmap;
|
||||||
|
|
||||||
|
interface
|
||||||
|
{$I RV_Defs.inc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF RICHVIEWDEF2009}AnsiStrings,{$ENDIF}
|
||||||
|
SysUtils, Classes, Windows, Graphics,
|
||||||
|
RVStyle, RVItem, RVFMisc, DLines, CRVFData, RVTypes;
|
||||||
|
|
||||||
|
const
|
||||||
|
rvsBlendBitmap = -50;
|
||||||
|
rvsHotBlendBitmap = -51;
|
||||||
|
|
||||||
|
type
|
||||||
|
TRVBlendBitmapItemInfo = class(TRVGraphicItemInfo)
|
||||||
|
protected
|
||||||
|
Back: TBitmap;
|
||||||
|
function SaveRVFHeaderTail(RVData: TPersistent): TRVRawByteString; override;
|
||||||
|
function GetTransparency(State: TRVItemDrawStates): Byte; virtual;
|
||||||
|
public
|
||||||
|
Transparency: Byte;
|
||||||
|
constructor CreateEx(RVData: TPersistent; AImage: TGraphic; AVAlign: TRVVAlign); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure Paint(x,y: Integer; Canvas: TCanvas; State: TRVItemDrawStates;
|
||||||
|
Style: TRVStyle; dli: TRVDrawLineInfo); override;
|
||||||
|
procedure AfterLoading(FileFormat: TRVLoadFormat); override;
|
||||||
|
function ReadRVFHeaderTail(var P: PRVAnsiChar; RVData: TPersistent;
|
||||||
|
UTF8Strings: Boolean; var AssStyleNameUsed: Boolean): Boolean; override;
|
||||||
|
procedure Assign(Source: TCustomRVItemInfo); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TRVHotBlendBitmapItemInfo = class(TRVBlendBitmapItemInfo)
|
||||||
|
protected
|
||||||
|
function GetTransparency(State: TRVItemDrawStates): Byte; override;
|
||||||
|
public
|
||||||
|
HotTransparency: Byte;
|
||||||
|
function GetBoolValueEx(Prop: TRVItemBoolPropertyEx; RVStyle: TRVStyle): Boolean; override;
|
||||||
|
constructor CreateEx(RVData: TPersistent; AImage: TGraphic; AVAlign: TRVVAlign); override;
|
||||||
|
procedure Execute(RVData:TPersistent); override;
|
||||||
|
procedure Assign(Source: TCustomRVItemInfo); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R-}
|
||||||
|
procedure DrawTransparent(Canvas: TCanvas;
|
||||||
|
x,y: Integer;
|
||||||
|
Transparency: Byte;
|
||||||
|
Back: TBitmap;
|
||||||
|
Bitmap: TBitmap);
|
||||||
|
type
|
||||||
|
RGBARR = array [0..0] of TRGBQUAD;
|
||||||
|
PRGBARR = ^RGBARR;
|
||||||
|
var rgb1,rgb2: PRGBARR;
|
||||||
|
i,j: Integer;
|
||||||
|
op, tr: Integer;
|
||||||
|
begin
|
||||||
|
tr := Transparency;
|
||||||
|
op := 255-Transparency;
|
||||||
|
Back.Canvas.CopyRect(Rect(0,0,Back.Width,Back.Height), Canvas,
|
||||||
|
Bounds(x,y,Back.Width,Back.Height));
|
||||||
|
for i:=0 to Back.Height-1 do begin
|
||||||
|
rgb1 := PRGBARR(Back.ScanLine[i]);
|
||||||
|
rgb2 := PRGBARR(Bitmap.ScanLine[i]);
|
||||||
|
for j:=0 to Back.Width-1 do
|
||||||
|
if not CompareMem(@rgb1[j], @rgb2[j],3) then
|
||||||
|
with rgb1[j] do begin
|
||||||
|
rgbBlue := (rgbBlue*tr + rgb2[j].rgbBlue*op) div 255;
|
||||||
|
rgbGreen := (rgbGreen*tr + rgb2[j].rgbGreen*op)div 255;
|
||||||
|
rgbRed := (rgbRed*tr + rgb2[j].rgbRed*op) div 255;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Canvas.Draw(x,y, Back);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{======================= TRVBlendBitmapItemInfo ===============================}
|
||||||
|
constructor TRVBlendBitmapItemInfo.CreateEx(RVData: TPersistent; AImage: TGraphic; AVAlign: TRVVAlign);
|
||||||
|
begin
|
||||||
|
inherited CreateEx(RVData, AImage as TBitmap, AValign);
|
||||||
|
Transparency := 0;
|
||||||
|
StyleNo := rvsBlendBitmap;
|
||||||
|
AfterLoading(rvlfRVF);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVBlendBitmapItemInfo.AfterLoading(FileFormat: TRVLoadFormat);
|
||||||
|
begin
|
||||||
|
inherited AfterLoading(FileFormat);
|
||||||
|
TBitmap(Image).PixelFormat := pf32bit;
|
||||||
|
Back := TBitmap.Create;
|
||||||
|
Back.PixelFormat := pf32bit;
|
||||||
|
Back.Width := TBitmap(Image).Width;
|
||||||
|
Back.Height := TBitmap(Image).Height;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
destructor TRVBlendBitmapItemInfo.Destroy;
|
||||||
|
begin
|
||||||
|
Back.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVBlendBitmapItemInfo.GetTransparency(State: TRVItemDrawStates): Byte;
|
||||||
|
begin
|
||||||
|
Result := Transparency;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVBlendBitmapItemInfo.Paint(x,y: Integer; Canvas: TCanvas; State: TRVItemDrawStates;
|
||||||
|
Style: TRVStyle; dli: TRVDrawLineInfo);
|
||||||
|
begin
|
||||||
|
if ImageCopy<>nil then
|
||||||
|
inherited Paint(x, y, Canvas, State, Style, dli)
|
||||||
|
else begin
|
||||||
|
inc(x); inc(y);
|
||||||
|
DrawTransparent(Canvas, x, y, GetTransparency(State), Back, TBitmap(Image));
|
||||||
|
if (rvidsCurrent in State) and (Style.HoverColor<>clNone) then begin
|
||||||
|
Canvas.Pen.Color := Style.HoverColor;
|
||||||
|
Canvas.Pen.Style := psSolid;
|
||||||
|
Canvas.Rectangle(x-2,y-2, x+Image.Width+2, y+Image.Height+2);
|
||||||
|
end;
|
||||||
|
if (rvidsSelected in State) then begin
|
||||||
|
Canvas.Pen.Color := Style.SelColor;
|
||||||
|
Canvas.Pen.Style := psSolid;
|
||||||
|
Canvas.Rectangle(x-1,y-1, x+Image.Width+1, y+Image.Height+1);
|
||||||
|
end
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVBlendBitmapItemInfo.SaveRVFHeaderTail(RVData: TPersistent): TRVRawByteString;
|
||||||
|
begin
|
||||||
|
Result := {$IFDEF RVUNICODESTR}AnsiStrings.{$ENDIF}Format('%s %d', [inherited SaveRVFHeaderTail(RVData), Integer(Transparency)]);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVBlendBitmapItemInfo.ReadRVFHeaderTail(var P: PRVAnsiChar;
|
||||||
|
RVData: TPersistent; UTF8Strings: Boolean;
|
||||||
|
var AssStyleNameUsed: Boolean): Boolean;
|
||||||
|
var tr: Integer;
|
||||||
|
begin
|
||||||
|
Result := inherited ReadRVFHeaderTail(P, RVData, UTF8Strings, AssStyleNameUsed);
|
||||||
|
if not Result then exit;
|
||||||
|
if not (P^ in [#0, #10, #13]) then
|
||||||
|
Result := RVFReadInteger(P,tr)
|
||||||
|
else
|
||||||
|
Result := False;
|
||||||
|
if Result then
|
||||||
|
Transparency := Byte(tr);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVBlendBitmapItemInfo.Assign(Source: TCustomRVItemInfo);
|
||||||
|
begin
|
||||||
|
if (Source is TRVBlendBitmapItemInfo) then
|
||||||
|
Transparency := TRVBlendBitmapItemInfo(Source).Transparency;
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
{======================= TRVHotBlendBitmapItemInfo ============================}
|
||||||
|
constructor TRVHotBlendBitmapItemInfo.CreateEx(RVData: TPersistent;
|
||||||
|
AImage: TGraphic; AVAlign: TRVVAlign);
|
||||||
|
begin
|
||||||
|
inherited CreateEx(RVData, AImage, AVAlign);
|
||||||
|
StyleNo := rvsHotBlendBitmap;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVHotBlendBitmapItemInfo.GetBoolValueEx(Prop: TRVItemBoolPropertyEx;
|
||||||
|
RVStyle: TRVStyle): Boolean;
|
||||||
|
begin
|
||||||
|
case Prop of
|
||||||
|
rvbpJump, rvbpAllowsFocus, rvbpXORFocus, rvbpHotColdJump:
|
||||||
|
Result := True;
|
||||||
|
else
|
||||||
|
Result := inherited GetBoolValueEx(Prop, RVStyle);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVHotBlendBitmapItemInfo.Execute(RVData:TPersistent);
|
||||||
|
begin
|
||||||
|
if RVData is TCustomRVFormattedData then
|
||||||
|
TCustomRVFormattedData(RVData).DoJump(JumpID+
|
||||||
|
TCustomRVFormattedData(RVData).FirstJumpNo)
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVHotBlendBitmapItemInfo.Assign(Source: TCustomRVItemInfo);
|
||||||
|
begin
|
||||||
|
if (Source is TRVHotBlendBitmapItemInfo) then
|
||||||
|
HotTransparency := TRVHotBlendBitmapItemInfo(Source).HotTransparency;
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVHotBlendBitmapItemInfo.GetTransparency(State: TRVItemDrawStates): Byte;
|
||||||
|
begin
|
||||||
|
if rvidsHover in State then
|
||||||
|
Result := HotTransparency
|
||||||
|
else
|
||||||
|
Result := Transparency;
|
||||||
|
end;
|
||||||
|
{==============================================================================}
|
||||||
|
initialization
|
||||||
|
|
||||||
|
RegisterRichViewItemClass(rvsBlendBitmap, TRVBlendBitmapItemInfo);
|
||||||
|
RegisterRichViewItemClass(rvsHotBlendBitmap, TRVHotBlendBitmapItemInfo);
|
||||||
|
|
||||||
|
end.
|
||||||
11
12.0.4/Demos/Addins/BlendBitmap/readme.txt
Normal file
11
12.0.4/Demos/Addins/BlendBitmap/readme.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
BlendBitmap Version 3.3
|
||||||
|
|
||||||
|
This is a demonstration of custom item types for TRichView
|
||||||
|
|
||||||
|
Installing: RichView plug-ins are not components, so no special
|
||||||
|
installing required. Just include RVBlendBitmap in "uses" of
|
||||||
|
your unit.
|
||||||
|
|
||||||
|
Sergey Tkachenko,
|
||||||
|
svt@trichview.com
|
||||||
|
http://www.trichview.com
|
||||||
72
12.0.4/Demos/Addins/ChartItem/ChartItem.pas
Normal file
72
12.0.4/Demos/Addins/ChartItem/ChartItem.pas
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
unit ChartItem;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses Windows, Classes, Graphics, RVFuncs, RVScroll, DLines, RVItem, Chart, RVStyle;
|
||||||
|
|
||||||
|
const
|
||||||
|
rvsChart = -1001;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
TRVChartItemInfo = class (TRVControlItemInfo)
|
||||||
|
public
|
||||||
|
constructor Create(RVData: TPersistent); override;
|
||||||
|
constructor CreateEx(RVData: TPersistent; AChart: TChart; AVAlign: TRVVAlign);
|
||||||
|
function GetBoolValueEx(Prop: TRVItemBoolPropertyEx; RVStyle: TRVStyle): Boolean; override;
|
||||||
|
procedure Print(Canvas: TCanvas; x,y,x2: Integer; Preview, Correction: Boolean;
|
||||||
|
const sad: TRVScreenAndDevice; RichView: TRVScroller; dli: TRVDrawLineInfo;
|
||||||
|
Part: Integer; ColorMode: TRVColorMode; RVData: TPersistent); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{============================ TRVChartItemInfo ================================}
|
||||||
|
constructor TRVChartItemInfo.Create(RVData: TPersistent);
|
||||||
|
begin
|
||||||
|
inherited Create(RVData);
|
||||||
|
StyleNo := rvsChart;
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TRVChartItemInfo.CreateEx(RVData: TPersistent; AChart: TChart; AVAlign: TRVVAlign);
|
||||||
|
begin
|
||||||
|
inherited CreateEx(RVData, AChart, AVAlign);
|
||||||
|
StyleNo := rvsChart;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRVChartItemInfo.GetBoolValueEx(Prop: TRVItemBoolPropertyEx; RVStyle: TRVStyle): Boolean;
|
||||||
|
begin
|
||||||
|
case Prop of
|
||||||
|
rvbpPrintToBMP:
|
||||||
|
Result := False;
|
||||||
|
else
|
||||||
|
Result := inherited GetBoolValueEx(Prop, RVStyle);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRVChartItemInfo.Print(Canvas: TCanvas; x, y, x2: Integer;
|
||||||
|
Preview, Correction: Boolean; const sad: TRVScreenAndDevice;
|
||||||
|
RichView: TRVScroller; dli: TRVDrawLineInfo; Part: Integer;
|
||||||
|
ColorMode: TRVColorMode; RVData: TPersistent);
|
||||||
|
var sv: Integer;
|
||||||
|
bmp: TBitmap;
|
||||||
|
begin
|
||||||
|
if Preview then begin
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.Width := Control.Width;
|
||||||
|
bmp.Height := Control.Height;
|
||||||
|
TChart(Control).Draw(bmp.Canvas, Rect(0,0, Control.Width,Control.Height));
|
||||||
|
Canvas.StretchDraw(Bounds(x,y,dli.Width,dli.Height),bmp);
|
||||||
|
bmp.Free;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
sv := SaveDC(Canvas.Handle);
|
||||||
|
TChart(Control).PrintPartial(Bounds(x,y,dli.Width,dli.Height));
|
||||||
|
RestoreDC(Canvas.Handle, sv);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterRichViewItemClass(rvsChart, TRVChartItemInfo);
|
||||||
|
|
||||||
|
end.
|
||||||
175
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.bdsproj
Normal file
175
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.bdsproj
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType">VCLApplication</Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{F8E0F7F3-B449-4D1D-AB46-ABDD192E9D05}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Project1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||||
|
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="CodePage"></Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="GenerateHpps">False</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
14
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.dpr
Normal file
14
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.dpr
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
ChartItem in '..\..\ChartItem.pas';
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.res
Normal file
BIN
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Project1.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Unit1.dfm
Normal file
Binary file not shown.
85
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Unit1.pas
Normal file
85
12.0.4/Demos/Addins/ChartItem/Demo/Delphi/Unit1.pas
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
TeEngine, Series, ExtCtrls, TeeProcs, Chart, TeeFunci, PtblRV,
|
||||||
|
RVStyle, RVScroll, RichView, StdCtrls,
|
||||||
|
ChartItem;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Chart1: TChart;
|
||||||
|
Series1: TPieSeries;
|
||||||
|
TeeFunction1: TAverageTeeFunction;
|
||||||
|
RichView1: TRichView;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
RVPrint1: TRVPrint;
|
||||||
|
Button1: TButton;
|
||||||
|
Chart2: TChart;
|
||||||
|
Series2: THorizBarSeries;
|
||||||
|
Series3: THorizBarSeries;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var item: TRVChartItemInfo;
|
||||||
|
begin
|
||||||
|
// Filling charts
|
||||||
|
Chart1.Series[0].Add(1,'1',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(2,'2',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(3,'3',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(4,'4',clTeeColor);
|
||||||
|
|
||||||
|
Chart2.Series[0].Add(1,'1',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(2,'2',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(3,'3',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(4,'4',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(4,'4',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(3,'3',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(2,'2',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(1,'1',clTeeColor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RichView1.AddNL('Printing example',1,1);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart1, rvvaBaseline);
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('',item);
|
||||||
|
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart2, rvvaBaseline);
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('',item);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
RichView1.AddNL('END OF DOC',0,0);
|
||||||
|
|
||||||
|
|
||||||
|
RichView1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RVPrint1.AssignSource(RichView1);
|
||||||
|
RVPrint1.FormatPages(rvdoAll) ;
|
||||||
|
RVPrint1.Print('Chart',1,False) ;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
program ChartDemo;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
ChartItem in '..\..\ChartItem.pas';
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
108
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/ChartDemo.dproj
Normal file
108
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/ChartDemo.dproj
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{F8E0F7F3-B449-4D1D-AB46-ABDD192E9D05}</ProjectGuid>
|
||||||
|
<MainSource>ChartDemo.dpr</MainSource>
|
||||||
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
|
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||||
|
<ProjectVersion>12.0</ProjectVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<DCC_ImageBase>00400000</DCC_ImageBase>
|
||||||
|
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DependencyCheckOutputName>ChartDemo.exe</DCC_DependencyCheckOutputName>
|
||||||
|
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
|
||||||
|
<DCC_Platform>x86</DCC_Platform>
|
||||||
|
<DCC_N>true</DCC_N>
|
||||||
|
<DCC_S>false</DCC_S>
|
||||||
|
<DCC_K>false</DCC_K>
|
||||||
|
<DCC_E>false</DCC_E>
|
||||||
|
<DCC_F>false</DCC_F>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||||
|
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DebugInformation>false</DCC_DebugInformation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="ChartDemo.dpr">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="Unit1.pas">
|
||||||
|
<Form>Form1</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="..\..\ChartItem.pas"/>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Debug">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">ChartDemo.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"/>
|
||||||
|
<VersionInfoKeys Name="FileDescription"/>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"/>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"/>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"/>
|
||||||
|
<VersionInfoKeys Name="ProductName"/>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"/>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
</Project>
|
||||||
BIN
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/ChartDemo.res
Normal file
BIN
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/ChartDemo.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/Unit1.dfm
Normal file
Binary file not shown.
85
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/Unit1.pas
Normal file
85
12.0.4/Demos/Addins/ChartItem/Demo/DelphiUnicode/Unit1.pas
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
TeEngine, Series, ExtCtrls, TeeProcs, Chart, TeeFunci, PtblRV,
|
||||||
|
RVStyle, RVScroll, RichView, StdCtrls,
|
||||||
|
ChartItem;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Chart1: TChart;
|
||||||
|
Series1: TPieSeries;
|
||||||
|
TeeFunction1: TAverageTeeFunction;
|
||||||
|
RichView1: TRichView;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
RVPrint1: TRVPrint;
|
||||||
|
Button1: TButton;
|
||||||
|
Chart2: TChart;
|
||||||
|
Series2: THorizBarSeries;
|
||||||
|
Series3: THorizBarSeries;
|
||||||
|
Label1: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var item: TRVChartItemInfo;
|
||||||
|
begin
|
||||||
|
// Filling charts
|
||||||
|
Chart1.Series[0].Add(1,'1',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(2,'2',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(3,'3',clTeeColor);
|
||||||
|
Chart1.Series[0].Add(4,'4',clTeeColor);
|
||||||
|
|
||||||
|
Chart2.Series[0].Add(1,'1',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(2,'2',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(3,'3',clTeeColor);
|
||||||
|
Chart2.Series[0].Add(4,'4',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(4,'4',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(3,'3',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(2,'2',clTeeColor);
|
||||||
|
Chart2.Series[1].Add(1,'1',clTeeColor);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
RichView1.AddNLWTag('Printing example',1,1,0);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart1, rvvaBaseline);
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('',item);
|
||||||
|
|
||||||
|
RichView1.AddBreak;
|
||||||
|
|
||||||
|
item := TRVChartItemInfo.CreateEx(RichView1.RVData, Chart2, rvvaBaseline);
|
||||||
|
item.ParaNo := 1;
|
||||||
|
RichView1.AddItem('',item);
|
||||||
|
RichView1.AddBreak;
|
||||||
|
RichView1.AddNLWTag('END OF DOC',0,0,0);
|
||||||
|
|
||||||
|
|
||||||
|
RichView1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RVPrint1.AssignSource(RichView1);
|
||||||
|
RVPrint1.FormatPages(rvdoAll) ;
|
||||||
|
RVPrint1.Print('Chart',1,False) ;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
13
12.0.4/Demos/Addins/ChartItem/readme.txt
Normal file
13
12.0.4/Demos/Addins/ChartItem/readme.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Version 3.2
|
||||||
|
|
||||||
|
By default, RichView prints inserted controls using a temporal bitmap provided by programmer
|
||||||
|
in OnPrintComponent event.
|
||||||
|
This technique cannot provide a high quality image printing since this bitmap has screen resolution,
|
||||||
|
which is usually much lower than resolution of printer *.
|
||||||
|
This plugin does a high quality printing of TChart components inserted in RichView editor or viewer.
|
||||||
|
A good example how to implement printing for custom types of controls. Demo included
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
* - since v1.6, this temporal bitmap can have size larger than size of the control.
|
||||||
|
It will be stretched to privide higher quality of printing.
|
||||||
|
But using this item class is still preferable.
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType">VCLApplication</Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{2660954C-9E85-405A-AA17-ACDC58741B30}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Project1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||||
|
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="CodePage"></Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="GenerateHpps">False</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
ComboItem in '..\..\ComboItem.pas';
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Addins/ComboItem/ComboItem Demo/Delphi/Project1.res
Normal file
BIN
12.0.4/Demos/Addins/ComboItem/ComboItem Demo/Delphi/Project1.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Addins/ComboItem/ComboItem Demo/Delphi/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Addins/ComboItem/ComboItem Demo/Delphi/Unit1.dfm
Normal file
Binary file not shown.
@ -0,0 +1,79 @@
|
|||||||
|
{*******************************************************}
|
||||||
|
{ }
|
||||||
|
{ RichView }
|
||||||
|
{ Combo Item Demo }
|
||||||
|
{ }
|
||||||
|
{ Copyright (c) Sergey Tkachenko }
|
||||||
|
{ svt@trichview.com }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{ }
|
||||||
|
{*******************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
|
||||||
|
Dialogs, RVScroll, RichView, RVStyle, ComboItem, RVTable;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
rv: TRichView;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var item: TRVComboItemInfo;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
begin
|
||||||
|
rv.AddNL('Virtual Greengrocery',0,1);
|
||||||
|
rv.AddNL('',0,1);
|
||||||
|
table := TRVTableItemInfo.CreateEx(2,2,rv.RVData);
|
||||||
|
table.BorderColor := clSilver;
|
||||||
|
table.BorderStyle := rvtbColor;
|
||||||
|
table.BorderWidth := 2;
|
||||||
|
|
||||||
|
table.Cells[0,0].Clear;
|
||||||
|
table.Cells[1,0].Clear;
|
||||||
|
table.Cells[0,1].Clear;
|
||||||
|
table.Cells[1,1].Clear;
|
||||||
|
table.Cells[0,0].AddNL('Select fruits:',0,0);
|
||||||
|
table.Cells[1,0].AddNL('Select vegetables:',0,0);
|
||||||
|
table.Cells[0,0].BestWidth := 200;
|
||||||
|
table.Cells[0,1].BestWidth := 120;
|
||||||
|
table.CellPadding := 5;
|
||||||
|
table.ParaNo := 1;
|
||||||
|
|
||||||
|
item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
|
||||||
|
item.MinWidth := 100;
|
||||||
|
item.Items.Add('apple');
|
||||||
|
item.Items.Add('banana');
|
||||||
|
item.Items.Add('pear');
|
||||||
|
table.Cells[0,1].AddItem('', item);
|
||||||
|
|
||||||
|
item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
|
||||||
|
item.Items.Add('cucumber');
|
||||||
|
item.Items.Add('tomato');
|
||||||
|
item.MinWidth := 100;
|
||||||
|
table.Cells[1,1].AddItem('', item);
|
||||||
|
rv.AddItem('', table);
|
||||||
|
rv.AddNL('(click the gray square to select)',0,1);
|
||||||
|
rv.Format;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1},
|
||||||
|
ComboItem in '..\..\ComboItem.pas';
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{2660954C-9E85-405A-AA17-ACDC58741B30}</ProjectGuid>
|
||||||
|
<MainSource>Project1.dpr</MainSource>
|
||||||
|
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||||
|
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||||
|
<ProjectVersion>12.0</ProjectVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
|
||||||
|
<Cfg_1>true</Cfg_1>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
|
||||||
|
<Cfg_2>true</Cfg_2>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
<Base>true</Base>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Base)'!=''">
|
||||||
|
<DCC_ImageBase>00400000</DCC_ImageBase>
|
||||||
|
<DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DependencyCheckOutputName>Project1.exe</DCC_DependencyCheckOutputName>
|
||||||
|
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
|
||||||
|
<DCC_Platform>x86</DCC_Platform>
|
||||||
|
<DCC_N>true</DCC_N>
|
||||||
|
<DCC_S>false</DCC_S>
|
||||||
|
<DCC_K>false</DCC_K>
|
||||||
|
<DCC_E>false</DCC_E>
|
||||||
|
<DCC_F>false</DCC_F>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||||
|
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||||
|
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||||
|
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||||
|
<DCC_DebugInformation>false</DCC_DebugInformation>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||||
|
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<DelphiCompile Include="Project1.dpr">
|
||||||
|
<MainSource>MainSource</MainSource>
|
||||||
|
</DelphiCompile>
|
||||||
|
<DCCReference Include="Unit1.pas">
|
||||||
|
<Form>Form1</Form>
|
||||||
|
</DCCReference>
|
||||||
|
<DCCReference Include="..\..\ComboItem.pas"/>
|
||||||
|
<BuildConfiguration Include="Base">
|
||||||
|
<Key>Base</Key>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Debug">
|
||||||
|
<Key>Cfg_2</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
<BuildConfiguration Include="Release">
|
||||||
|
<Key>Cfg_1</Key>
|
||||||
|
<CfgParent>Base</CfgParent>
|
||||||
|
</BuildConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
|
||||||
|
<ProjectExtensions>
|
||||||
|
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||||
|
<Borland.ProjectType>VCLApplication</Borland.ProjectType>
|
||||||
|
<BorlandProject>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Project1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"/>
|
||||||
|
<VersionInfoKeys Name="FileDescription"/>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"/>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"/>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"/>
|
||||||
|
<VersionInfoKeys Name="ProductName"/>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"/>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
|
<ProjectFileVersion>12</ProjectFileVersion>
|
||||||
|
</ProjectExtensions>
|
||||||
|
</Project>
|
||||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,79 @@
|
|||||||
|
{*******************************************************}
|
||||||
|
{ }
|
||||||
|
{ RichView }
|
||||||
|
{ Combo Item Demo }
|
||||||
|
{ }
|
||||||
|
{ Copyright (c) Sergey Tkachenko }
|
||||||
|
{ svt@trichview.com }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{ }
|
||||||
|
{*******************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, StdCtrls,
|
||||||
|
Dialogs, RVScroll, RichView, RVStyle, ComboItem, RVTable;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
rv: TRichView;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var item: TRVComboItemInfo;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
begin
|
||||||
|
rv.AddNLWTag('Virtual Greengrocery',0,1,0);
|
||||||
|
rv.AddNLWTag('',0,1,0);
|
||||||
|
table := TRVTableItemInfo.CreateEx(2,2,rv.RVData);
|
||||||
|
table.BorderColor := clSilver;
|
||||||
|
table.BorderStyle := rvtbColor;
|
||||||
|
table.BorderWidth := 2;
|
||||||
|
|
||||||
|
table.Cells[0,0].Clear;
|
||||||
|
table.Cells[1,0].Clear;
|
||||||
|
table.Cells[0,1].Clear;
|
||||||
|
table.Cells[1,1].Clear;
|
||||||
|
table.Cells[0,0].AddNLWTag('Select fruits:',0,0,0);
|
||||||
|
table.Cells[1,0].AddNLWTag('Select vegetables:',0,0,0);
|
||||||
|
table.Cells[0,0].BestWidth := 200;
|
||||||
|
table.Cells[0,1].BestWidth := 120;
|
||||||
|
table.CellPadding := 5;
|
||||||
|
table.ParaNo := 1;
|
||||||
|
|
||||||
|
item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
|
||||||
|
item.MinWidth := 100;
|
||||||
|
item.Items.Add('apple');
|
||||||
|
item.Items.Add('banana');
|
||||||
|
item.Items.Add('pear');
|
||||||
|
table.Cells[0,1].AddItem('', item);
|
||||||
|
|
||||||
|
item := TRVComboItemInfo.CreateEx(rv.RVData, 1, '');
|
||||||
|
item.Items.Add('cucumber');
|
||||||
|
item.Items.Add('tomato');
|
||||||
|
item.MinWidth := 100;
|
||||||
|
table.Cells[1,1].AddItem('', item);
|
||||||
|
rv.AddItem('', table);
|
||||||
|
rv.AddNLWTag('(click the gray square to select)',0,1,0);
|
||||||
|
rv.Format;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
238
12.0.4/Demos/Addins/ComboItem/ComboItem.pas
Normal file
238
12.0.4/Demos/Addins/ComboItem/ComboItem.pas
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
{*******************************************************}
|
||||||
|
{ }
|
||||||
|
{ RichView }
|
||||||
|
{ Combo Item - item class for RichView. }
|
||||||
|
{ Non-text item that looks like a text }
|
||||||
|
{ (but cannot be wrapped and edited) }
|
||||||
|
{ and shows combobox when focused. }
|
||||||
|
{ Does not support Unicode. }
|
||||||
|
{ Shows combobox only in TRichView, }
|
||||||
|
{ not in TRichViewEdit }
|
||||||
|
{ }
|
||||||
|
{ Copyright (c) Sergey Tkachenko }
|
||||||
|
{ svt@trichview.com }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{ }
|
||||||
|
{*******************************************************}
|
||||||
|
|
||||||
|
unit ComboItem;
|
||||||
|
|
||||||
|
{$I RV_Defs.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
uses {$IFDEF RICHVIEWDEF2009}AnsiStrings,{$ENDIF}
|
||||||
|
Windows, SysUtils, Graphics, Classes, Controls, StdCtrls,
|
||||||
|
RVItem, CRVData, CRVFData, RVStyle, RVScroll, RVFMisc,
|
||||||
|
RVLabelItem, RVTypes;
|
||||||
|
|
||||||
|
const
|
||||||
|
rvsCombo = -201;
|
||||||
|
|
||||||
|
type
|
||||||
|
TRVComboItemInfo = class (TRVLabelItemInfo)
|
||||||
|
private
|
||||||
|
FItems: TStringList;
|
||||||
|
FComboBox: TComboBox;
|
||||||
|
FRVData: TCustomRVData;
|
||||||
|
function GetItems: TStrings;
|
||||||
|
procedure SetItems(const Value: TStrings);
|
||||||
|
procedure DoComboBoxClick(Sender: TObject);
|
||||||
|
protected
|
||||||
|
function GetRVFExtraPropertyCount: Integer; override;
|
||||||
|
procedure SaveRVFExtraProperties(Stream: TStream); override;
|
||||||
|
public
|
||||||
|
constructor Create(RVData: TPersistent); override;
|
||||||
|
constructor CreateEx(RVData: TPersistent; TextStyleNo: Integer; const Text: String);
|
||||||
|
destructor Destroy; override;
|
||||||
|
function SetExtraCustomProperty(const PropName: TRVAnsiString;
|
||||||
|
const Value: String): Boolean; override;
|
||||||
|
function ReadRVFLine(const s: TRVRawByteString; RVData: TPersistent;
|
||||||
|
ReadType, LineNo, LineCount: Integer; var Name: TRVRawByteString;
|
||||||
|
var ReadMode: TRVFReadMode; var ReadState: TRVFReadState;
|
||||||
|
UTF8Strings: Boolean; var AssStyleNameUsed: Boolean): Boolean; override;
|
||||||
|
function GetBoolValueEx(Prop: TRVItemBoolPropertyEx; RVStyle: TRVStyle): Boolean; override;
|
||||||
|
function GetBoolValue(Prop: TRVItemBoolProperty): Boolean; override;
|
||||||
|
procedure Focusing; override;
|
||||||
|
procedure ClearFocus; override;
|
||||||
|
procedure Inserting(RVData: TObject; var Text: TRVRawByteString; Safe: Boolean); override;
|
||||||
|
function OwnsControl(AControl: TControl): Boolean; override;
|
||||||
|
procedure AdjustInserted(x,y: Integer; adjusty: Boolean); override;
|
||||||
|
property Items: TStrings read GetItems write SetItems;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{============================== TRVComboItemInfo ==============================}
|
||||||
|
constructor TRVComboItemInfo.Create(RVData: TPersistent);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
StyleNo := rvsCombo;
|
||||||
|
Spacing := 0;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
constructor TRVComboItemInfo.CreateEx(RVData: TPersistent;
|
||||||
|
TextStyleNo: Integer; const Text: String);
|
||||||
|
begin
|
||||||
|
inherited CreateEx(RVData, TextStyleNo, Text);
|
||||||
|
StyleNo := rvsCombo;
|
||||||
|
Spacing := 0;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
destructor TRVComboItemInfo.Destroy;
|
||||||
|
begin
|
||||||
|
FItems.Free;
|
||||||
|
ClearFocus;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.ClearFocus;
|
||||||
|
var ComboBox: TComboBox;
|
||||||
|
begin
|
||||||
|
ComboBox := FComboBox;
|
||||||
|
FComboBox := nil;
|
||||||
|
ComboBox.Free;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.Focusing;
|
||||||
|
var ItemNo, DItemNo: Integer;
|
||||||
|
begin
|
||||||
|
ClearFocus;
|
||||||
|
if FRVData<>nil then begin
|
||||||
|
FComboBox := TComboBox.Create(nil);
|
||||||
|
FComboBox.Visible := False;
|
||||||
|
FComboBox.Parent := FRVData.GetParentControl;
|
||||||
|
ItemNo := FRVData.GetItemNo(Self);
|
||||||
|
TCustomRVFormattedData(FRVData).Item2FirstDrawItem(ItemNo, DItemNo);
|
||||||
|
with TCustomRVFormattedData(FRVData).DrawItems[DItemNo] do begin
|
||||||
|
FComboBox.Width := Width{+GetSystemMetrics(SM_CXVSCROLL)};
|
||||||
|
FComboBox.Height := Height;
|
||||||
|
FComboBox.Font.Assign(FRVData.GetRVStyle.TextStyles[TextStyleNo]);
|
||||||
|
if FRVData.GetRVStyle.TextStyles[TextStyleNo].BackColor<>clNone then
|
||||||
|
FComboBox.Color := FRVData.GetRVStyle.TextStyles[TextStyleNo].BackColor;
|
||||||
|
FComboBox.Style := csDropDownList;
|
||||||
|
FComboBox.Items := Items;
|
||||||
|
FComboBox.ItemIndex := FComboBox.Items.IndexOf(Text);
|
||||||
|
FComboBox.OnClick := DoComboBoxClick;
|
||||||
|
TCustomRVFormattedData(FRVData).ResetSubCoords;
|
||||||
|
AdjustInserted(Left-TCustomRVFormattedData(FRVData).GetHOffs,
|
||||||
|
Top-TCustomRVFormattedData(FRVData).GetVOffs, True);
|
||||||
|
end;
|
||||||
|
FComboBox.Visible := True;
|
||||||
|
FComboBox.SetFocus;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.GetBoolValueEx(Prop: TRVItemBoolPropertyEx;
|
||||||
|
RVStyle: TRVStyle): Boolean;
|
||||||
|
begin
|
||||||
|
case Prop of
|
||||||
|
rvbpAllowsFocus:
|
||||||
|
Result := True;
|
||||||
|
rvbpXORFocus:
|
||||||
|
Result := False;
|
||||||
|
else
|
||||||
|
Result := inherited GetBoolValueEx(Prop, RVStyle);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.GetBoolValue(Prop: TRVItemBoolProperty): Boolean;
|
||||||
|
begin
|
||||||
|
case Prop of
|
||||||
|
rvbpImmediateControlOwner:
|
||||||
|
Result := FComboBox<>nil;
|
||||||
|
else
|
||||||
|
Result := inherited GetBoolValue(Prop);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.GetItems: TStrings;
|
||||||
|
begin
|
||||||
|
if FItems=nil then
|
||||||
|
FItems := TStringList.Create;
|
||||||
|
Result := FItems;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.SetItems(const Value: TStrings);
|
||||||
|
begin
|
||||||
|
FItems.Assign(Value);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.Inserting(RVData: TObject; var Text: TRVRawByteString;
|
||||||
|
Safe: Boolean);
|
||||||
|
begin
|
||||||
|
FRVData := TCustomRVData(RVData);
|
||||||
|
if FComboBox<>nil then begin
|
||||||
|
FComboBox.Visible := False;
|
||||||
|
if not Safe and (RVData<>nil) then
|
||||||
|
FComboBox.Parent := FRVData.GetParentControl
|
||||||
|
else
|
||||||
|
FComboBox.Parent := nil;
|
||||||
|
end;
|
||||||
|
inherited Inserting(RVData, Text, Safe);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.OwnsControl(AControl: TControl): Boolean;
|
||||||
|
begin
|
||||||
|
Result := AControl=FComboBox;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.AdjustInserted(x, y: Integer; adjusty: Boolean);
|
||||||
|
begin
|
||||||
|
if FComboBox<>nil then begin
|
||||||
|
FComboBox.Left := x+Spacing;
|
||||||
|
FComboBox.Tag := y+Spacing;
|
||||||
|
if adjusty then
|
||||||
|
RV_Tag2Y(FComboBox);
|
||||||
|
FComboBox.Visible := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.DoComboBoxClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if FComboBox.ItemIndex>=0 then begin
|
||||||
|
Text := FComboBox.Text;
|
||||||
|
UpdateMe;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.GetRVFExtraPropertyCount: Integer;
|
||||||
|
begin
|
||||||
|
Result := Items.Count + inherited GetRVFExtraPropertyCount;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TRVComboItemInfo.SaveRVFExtraProperties(Stream: TStream);
|
||||||
|
var i: Integer;
|
||||||
|
begin
|
||||||
|
inherited SaveRVFExtraProperties(Stream);
|
||||||
|
for i := 0 to items.Count-1 do
|
||||||
|
RVFWriteLine(Stream, {$IFDEF RVUNICODESTR}AnsiStrings.{$ENDIF}
|
||||||
|
Format('item=%s', [StringToRVFString(Items[i])]));
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.SetExtraCustomProperty(const PropName: TRVAnsiString;
|
||||||
|
const Value: String): Boolean;
|
||||||
|
begin
|
||||||
|
if PropName='item' then begin
|
||||||
|
Items.Add(Value);
|
||||||
|
Result := True;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := inherited SetExtraCustomProperty(PropName, Value);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
function TRVComboItemInfo.ReadRVFLine(const s: TRVRawByteString; RVData: TPersistent;
|
||||||
|
ReadType, LineNo, LineCount: Integer; var Name: TRVRawByteString;
|
||||||
|
var ReadMode: TRVFReadMode; var ReadState: TRVFReadState;
|
||||||
|
UTF8Strings: Boolean; var AssStyleNameUsed: Boolean): Boolean;
|
||||||
|
begin
|
||||||
|
if LineNo=0 then
|
||||||
|
Items.Clear;
|
||||||
|
Result := inherited ReadRVFLine(s, RVData, ReadType, LineNo, LineCount, Name,
|
||||||
|
ReadMode, ReadState, UTF8Strings, AssStyleNameUsed);
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
|
||||||
|
RegisterRichViewItemClass(rvsCombo, TRVComboItemInfo);
|
||||||
|
|
||||||
|
end.
|
||||||
23
12.0.4/Demos/Addins/ComboItem/readme.txt
Normal file
23
12.0.4/Demos/Addins/ComboItem/readme.txt
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
ComboItem Version 1.3
|
||||||
|
|
||||||
|
Combo Item - item class for RichView.
|
||||||
|
It's an label item that displays combo-box when focused: clicked or activated by Tab key.
|
||||||
|
It can show combobox only in TRichView, not in TRichViewEdit (because items in TRichViewEdit
|
||||||
|
cannot be focused).
|
||||||
|
|
||||||
|
|
||||||
|
{----------------------------------- COMBOITEM ---------------------------------}
|
||||||
|
|
||||||
|
This item has all properties of LabelItem.
|
||||||
|
It cannot resize itself when new text is chosen from the combobox, so you should
|
||||||
|
assign MinWidth to value large enough to show the whole text.
|
||||||
|
|
||||||
|
Properties:
|
||||||
|
property Items: TStrings
|
||||||
|
|
||||||
|
History
|
||||||
|
|
||||||
|
v1.3 Compatibility with TRichView v11
|
||||||
|
v1.2 Compatibility with TRichView v10
|
||||||
|
(where LabelItem is included in the standard set of items)
|
||||||
|
v1.1 Saving items in RVF
|
||||||
165
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.bdsproj
Normal file
165
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.bdsproj
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{E1C55C2F-4093-4E63-AAAF-6A7CC276823F}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">Autocomplete.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
13
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.dpr
Normal file
13
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.dpr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
program Autocomplete;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
MainFrm in 'MainFrm.pas' {frmMain};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TfrmMain, frmMain);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.res
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Autocomplete/Autocomplete.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Autocomplete/MainFrm.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Autocomplete/MainFrm.dfm
Normal file
Binary file not shown.
93
12.0.4/Demos/Delphi/Assorted/Autocomplete/MainFrm.pas
Normal file
93
12.0.4/Demos/Delphi/Assorted/Autocomplete/MainFrm.pas
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
{*******************************************************}
|
||||||
|
{ }
|
||||||
|
{ RichView }
|
||||||
|
{ AutoComplete demo }
|
||||||
|
{ }
|
||||||
|
{ Copyright (c) Sergey Tkachenko }
|
||||||
|
{ svt@trichview.com }
|
||||||
|
{ http://www.trichview.com }
|
||||||
|
{ }
|
||||||
|
{*******************************************************}
|
||||||
|
|
||||||
|
unit MainFrm;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
{$I RV_Defs.inc}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, Menus, RVStyle, RVScroll, RichView, RVEdit, RVGetText;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmMain = class(TForm)
|
||||||
|
RichViewEdit1: TRichViewEdit;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
PopupMenu1: TPopupMenu;
|
||||||
|
procedure RichViewEdit1KeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure AddPopupMenuItem(s: String);
|
||||||
|
procedure AutoCompletePopupMenuClick(Sender: TObject);
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmMain: TfrmMain;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
{$IFDEF RICHVIEWDEF6}
|
||||||
|
PopupMenu1.AutoHotkeys := maManual;
|
||||||
|
{$ENDIF}
|
||||||
|
RichViewEdit1.Clear;
|
||||||
|
RichViewEdit1.AddNL(
|
||||||
|
'Type a word and press Ctrl+Space for suggestions', 0,0);
|
||||||
|
RichViewEdit1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.AddPopupMenuItem(s: String);
|
||||||
|
var mi: TMenuItem;
|
||||||
|
begin
|
||||||
|
mi := TMenuItem.Create(PopupMenu1);
|
||||||
|
mi.Caption := s;
|
||||||
|
mi.OnClick := AutoCompletePopupMenuClick;
|
||||||
|
PopupMenu1.Items.Add(mi);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.AutoCompletePopupMenuClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichViewEdit1.SelectCurrentWord;
|
||||||
|
RichViewEdit1.InsertText((Sender as TMenuItem).Caption, False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.RichViewEdit1KeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
var s: String;
|
||||||
|
pt: TPoint;
|
||||||
|
begin
|
||||||
|
if (Key=VK_SPACE) and (ssCtrl in Shift) then begin
|
||||||
|
s := GetCurrentWord(RichViewEdit1);
|
||||||
|
if s<>'' then begin
|
||||||
|
while PopupMenu1.Items.Count>0 do
|
||||||
|
PopupMenu1.Items[0].Free;
|
||||||
|
AddPopupMenuItem('super'+s);
|
||||||
|
AddPopupMenuItem('mega'+s);
|
||||||
|
AddPopupMenuItem('ultra'+s);
|
||||||
|
AddPopupMenuItem('grand'+s);
|
||||||
|
GetCaretPos(pt);
|
||||||
|
pt := RichViewEdit1.TopLevelEditor.ClientToScreen(pt);
|
||||||
|
PopupMenu1.Popup(pt.X, pt.Y+10);
|
||||||
|
end;
|
||||||
|
Key := 0;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{E7926571-53F4-42EF-97EC-2ED3A7CABADB}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">CustomDraw.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program CustomDraw;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Custom Draw/CustomDraw/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Custom Draw/CustomDraw/Unit1.dfm
Normal file
Binary file not shown.
312
12.0.4/Demos/Delphi/Assorted/Custom Draw/CustomDraw/Unit1.pas
Normal file
312
12.0.4/Demos/Delphi/Assorted/Custom Draw/CustomDraw/Unit1.pas
Normal file
@ -0,0 +1,312 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
RVStyle, RVScroll, RichView, RVTypes;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichView1: TRichView;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
RichView2: TRichView;
|
||||||
|
procedure RVStyle1DrawStyleText(Sender: TRVStyle; const s: TRVRawByteString;
|
||||||
|
Canvas: TCanvas; StyleNo, SpaceBefore, Left, Top, Width,
|
||||||
|
Height: Integer; DrawState: TRVTextDrawStates;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RVStyle1StyleHoverSensitive(Sender: TRVStyle;
|
||||||
|
StyleNo: Integer; var Sensitive: Boolean);
|
||||||
|
procedure RVStyle1DrawTextBack(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
StyleNo, Left, Top, Width, Height: Integer;
|
||||||
|
DrawState: TRVTextDrawStates; var DoDefault: Boolean);
|
||||||
|
procedure RVStyle1DrawCheckpoint(Sender: TRVStyle; Canvas: TCanvas; X,
|
||||||
|
Y, ItemNo, XShift: Integer; RaiseEvent: Boolean; Control: TControl;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
procedure RVStyle1DrawPageBreak(Sender: TRVStyle; Canvas: TCanvas; Y,
|
||||||
|
XShift: Integer; PageBreakType: TRVPageBreakType; Control: TControl; var DoDefault: Boolean);
|
||||||
|
procedure RVStyle1DrawParaBack(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
ParaNo: Integer; ARect: TRect; var DoDefault: Boolean);
|
||||||
|
procedure RichView2Paint(Sender: TCustomRichView; Canvas: TCanvas;
|
||||||
|
Prepaint: Boolean);
|
||||||
|
procedure RichView2RVMouseUp(Sender: TCustomRichView;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
{============================== DRAWING ROUTINES ==============================}
|
||||||
|
|
||||||
|
{$R-} // turning off range checking (required for DrawTrRect)
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing left to right arrow }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure DrawArrow(Canvas: TCanvas; Left, Top, Width, Height: Integer);
|
||||||
|
var midx,midy: Integer;
|
||||||
|
one, two : Integer;
|
||||||
|
begin
|
||||||
|
midx := Left+Width div 2;
|
||||||
|
midy := Top+Height div 2;
|
||||||
|
if Width>0 then begin
|
||||||
|
one := 1;
|
||||||
|
two := -2;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
one := -1;
|
||||||
|
two := 2;
|
||||||
|
end;
|
||||||
|
Canvas.PolyLine([Point(Left+one,Top+3),
|
||||||
|
Point(midx,Top+3),
|
||||||
|
Point(midx,Top+1),
|
||||||
|
Point(Left+Width+two, midy),
|
||||||
|
Point(midx, Top+Height-2),
|
||||||
|
Point(midx, Top+Height-4),
|
||||||
|
Point(Left+one,Top+Height-4),
|
||||||
|
Point(Left+one,Top+3)
|
||||||
|
]);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing an icon for page breaks }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure DrawPageIcon(Canvas: TCanvas; Left, Top, Width, Height: Integer);
|
||||||
|
var LeftS, RightS: Integer;
|
||||||
|
begin
|
||||||
|
LeftS := Left+2;
|
||||||
|
RightS := Left+Width-4;
|
||||||
|
Canvas.PolyLine([Point(RightS-3,Top),
|
||||||
|
Point(LeftS,Top),
|
||||||
|
Point(LeftS, Top+Height),
|
||||||
|
Point(RightS,Top+Height),
|
||||||
|
Point(RightS,Top+3),
|
||||||
|
Point(RightS-3,Top),
|
||||||
|
Point(RightS-3,Top+3),
|
||||||
|
Point(RightS,Top+3)
|
||||||
|
]);
|
||||||
|
Canvas.Pen.Style := psDot;
|
||||||
|
Canvas.Pen.Color := clRed;
|
||||||
|
Canvas.MoveTo(Left, Top+Height div 2);
|
||||||
|
Canvas.LineTo(Left+Width, Top+Height div 2);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing a colored rectangle with specified degree of opacity (0..255) }
|
||||||
|
{ (quite slow...) }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure DrawTrRect(Canvas: TCanvas; const ARect: TRect;
|
||||||
|
Color: TColor;
|
||||||
|
Opacity: Integer);
|
||||||
|
type
|
||||||
|
RGBARR = array [0..0] of TRGBQUAD;
|
||||||
|
PRGBARR = ^RGBARR;
|
||||||
|
var prgb: PRGBARR;
|
||||||
|
rgb : TRGBQUAD;
|
||||||
|
i,j: Integer;
|
||||||
|
tr : Integer;
|
||||||
|
Clr: LongInt;
|
||||||
|
bmp: TBitmap;
|
||||||
|
begin
|
||||||
|
Clr := ColorToRGB(Color);
|
||||||
|
rgb.rgbRed := Clr and $000000FF;
|
||||||
|
rgb.rgbGreen := (Clr and $0000FF00) shr 8;
|
||||||
|
rgb.rgbBlue := (Clr and $00FFFFFF) shr 16;
|
||||||
|
rgb.rgbReserved := 0;
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
bmp.PixelFormat := pf32bit;
|
||||||
|
bmp.Width := ARect.Right-ARect.Left;
|
||||||
|
bmp.Height := ARect.Bottom-ARect.Top;
|
||||||
|
bmp.Canvas.CopyRect(Rect(0,0,bmp.Width,bmp.Height), Canvas, ARect);
|
||||||
|
|
||||||
|
tr := 255 - Opacity;
|
||||||
|
for i := 0 to bmp.Height-1 do begin
|
||||||
|
prgb := PRGBARR(bmp.ScanLine[i]);
|
||||||
|
for j := 0 to bmp.Width-1 do
|
||||||
|
with prgb[j] do begin
|
||||||
|
rgbBlue := (rgbBlue*tr + rgb.rgbBlue*Opacity) div 255;
|
||||||
|
rgbGreen := (rgbGreen*tr + rgb.rgbGreen*Opacity)div 255;
|
||||||
|
rgbRed := (rgbRed*tr + rgb.rgbRed*Opacity) div 255;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Canvas.Draw(ARect.Left, ARect.Top, bmp);
|
||||||
|
bmp.Free;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var i: Integer;
|
||||||
|
begin
|
||||||
|
RichView1.AddNL('Example',1,1);
|
||||||
|
RichView1.AddNL('This is an example of ',0,0);
|
||||||
|
RichView1.Add('custom drawn text',3);
|
||||||
|
RichView1.Add('.',0);
|
||||||
|
RichView1.AddNL(' Hot link 1 ',4,1);
|
||||||
|
RichView1.AddNL(' Hot link 2 ',5,1);
|
||||||
|
RichView1.AddBreakEx(1, rvbsLine, clBtnShadow);
|
||||||
|
RichView1.AddCheckpoint;
|
||||||
|
RichView1.AddNL('Another example - a custom drawing of checkpoints.',0,0);
|
||||||
|
RichView1.AddCheckpoint;
|
||||||
|
RichView1.AddNL('For example, you can draw a little nice arrow instead of default dotted line.',0,0);
|
||||||
|
RichView1.AddBreakEx(1, rvbsLine, clBtnShadow);
|
||||||
|
RichView1.AddNL('One more example - a custom displaying of page break',0,0);
|
||||||
|
RichView1.PageBreaksBeforeItems[RichView1.ItemCount-1] := True;
|
||||||
|
RichView1.Format;
|
||||||
|
|
||||||
|
RichView2.AddNL('Cool Effect - ',2,2);
|
||||||
|
RichView2.SetAddParagraphMode(False);
|
||||||
|
RichView2.AddNL('Transparent paragraph background.',2,2);
|
||||||
|
RichView2.AddNL('example of custom painting of paragraph background',0,2);
|
||||||
|
RichView2.SetAddParagraphMode(True);
|
||||||
|
for i := 0 to 20 do
|
||||||
|
RichView2.AddNL('This is the example how to use OnDrawParaBack and OnPaint events.',0,0);
|
||||||
|
RichView2.Format;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Should RichView repaint itself if mouse is over text of specified style? }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1StyleHoverSensitive(Sender: TRVStyle;
|
||||||
|
StyleNo: Integer; var Sensitive: Boolean);
|
||||||
|
begin
|
||||||
|
if StyleNo in [4,5] then
|
||||||
|
Sensitive := True; // (default for other styles)
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing a background of text }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1DrawTextBack(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
StyleNo, Left, Top, Width, Height: Integer; DrawState: TRVTextDrawStates;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
var r: TRect;
|
||||||
|
begin
|
||||||
|
case StyleNo of
|
||||||
|
5:
|
||||||
|
begin
|
||||||
|
// drawing a sunken edge for the 5th style
|
||||||
|
r := Bounds(Left,Top, Width, Height);
|
||||||
|
if rvtsHover in DrawState then
|
||||||
|
DrawEdge(Canvas.Handle, r, BDR_SUNKENOUTER or BF_ADJUST, BF_RECT)
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing a text }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1DrawStyleText(Sender: TRVStyle; const s: TRVRawByteString;
|
||||||
|
Canvas: TCanvas; StyleNo, SpaceBefore, Left, Top, Width, Height: Integer;
|
||||||
|
DrawState: TRVTextDrawStates; var DoDefault: Boolean);
|
||||||
|
begin
|
||||||
|
// This implementation does not support Unicode text items.
|
||||||
|
// For Unicode text items, s contains "raw Unicode". It must be
|
||||||
|
// converted to ANSI or Unicode string before using.
|
||||||
|
// See the same example for Delphi 2009+ (Demos\DelphiUnicode\)
|
||||||
|
|
||||||
|
if rvtsSelected in DrawState then
|
||||||
|
exit; // default drawing for selected text
|
||||||
|
inc(Left, SpaceBefore);
|
||||||
|
case StyleNo of
|
||||||
|
0:
|
||||||
|
begin
|
||||||
|
// sunken effect
|
||||||
|
Canvas.Font.Color := clBtnHighlight;
|
||||||
|
Canvas.TextOut(Left+1,Top+1, s);
|
||||||
|
Canvas.Font.Color := clBtnShadow;
|
||||||
|
Canvas.TextOut(Left,Top, s);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
3:
|
||||||
|
begin
|
||||||
|
// raised effect
|
||||||
|
Canvas.Font.Color := clBtnHighlight;
|
||||||
|
Canvas.TextOut(Left-1,Top-1, s);
|
||||||
|
Canvas.Font.Color := clBtnShadow;
|
||||||
|
Canvas.TextOut(Left+1,Top+1, s);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
4:
|
||||||
|
begin
|
||||||
|
if rvtsHover in DrawState then begin
|
||||||
|
// hot glow effect
|
||||||
|
Canvas.Font.Color := Sender.TextStyles[StyleNo].HoverColor;
|
||||||
|
Canvas.TextOut(Left+1,Top+1, s);
|
||||||
|
Canvas.TextOut(Left-1,Top-1, s);
|
||||||
|
Canvas.Font.Color := Sender.TextStyles[StyleNo].Color;
|
||||||
|
Canvas.TextOut(Left,Top, s);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing checkpoint as arrow icon }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1DrawCheckpoint(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
X, Y, ItemNo, XShift: Integer; RaiseEvent: Boolean; Control: TControl;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
begin
|
||||||
|
if RaiseEvent then
|
||||||
|
Canvas.Pen.Color := Sender.CheckpointEvColor
|
||||||
|
else
|
||||||
|
Canvas.Pen.Color := Sender.CheckpointColor;
|
||||||
|
DrawArrow(Canvas, -XShift+2, Y-5, RichView1.LeftMargin-4, 10);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing page break as icon }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1DrawPageBreak(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
Y, XShift: Integer; PageBreakType: TRVPageBreakType; Control: TControl; var DoDefault: Boolean);
|
||||||
|
begin
|
||||||
|
Canvas.Pen.Color := Sender.PageBreakColor;
|
||||||
|
DrawPageIcon(Canvas, -XShift+2, Y-8, 16, 16);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing a background of paragraphs }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RVStyle1DrawParaBack(Sender: TRVStyle; Canvas: TCanvas;
|
||||||
|
ParaNo: Integer; ARect: TRect; var DoDefault: Boolean);
|
||||||
|
begin
|
||||||
|
if ParaNo=2 then begin
|
||||||
|
// semi-transparent background for paragraph style #2:
|
||||||
|
DrawTrRect(Canvas, ARect, Sender.ParaStyles[ParaNo].Background.Color, 150);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Drawing unscrollable picture }
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.RichView2Paint(Sender: TCustomRichView; Canvas: TCanvas;
|
||||||
|
Prepaint: Boolean);
|
||||||
|
var x,y: Integer;
|
||||||
|
r: TRect;
|
||||||
|
begin
|
||||||
|
Canvas.Pen.Color := clRed;
|
||||||
|
Canvas.Pen.Width := 3;
|
||||||
|
Canvas.Brush.Color := clBlack;
|
||||||
|
x := Sender.ClientWidth-10;
|
||||||
|
y := Sender.ClientHeight-10;
|
||||||
|
Canvas.Ellipse(x-10, y-10, x+10, y+10);
|
||||||
|
r := Bounds(x-10, y-10, 20, 20);
|
||||||
|
Canvas.Brush.Style := bsClear;
|
||||||
|
Canvas.Font.Color := clRed;
|
||||||
|
Canvas.Font.Name := 'Arial';
|
||||||
|
Canvas.Font.Style := [fsBold];
|
||||||
|
Canvas.Font.Size := 12;
|
||||||
|
DrawText(Canvas.Handle, '!', 1, r, DT_SINGLELINE or DT_CENTER or DT_VCENTER);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichView2RVMouseUp(Sender: TCustomRichView;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; ItemNo, X, Y: Integer);
|
||||||
|
begin
|
||||||
|
if (x>Sender.ClientWidth-20) and (y>Sender.ClientHeight-20) then
|
||||||
|
Application.MessageBox('!','!', MB_OK or MB_ICONINFORMATION);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{CA19930D-099A-4972-9FB4-8A9A8902C433}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">CustomDrawMath.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program CustomDrawMath;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.RES}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Custom Draw/Mathematics/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Custom Draw/Mathematics/Unit1.dfm
Normal file
Binary file not shown.
@ -0,0 +1,83 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||||
|
RVStyle, RVScroll, RichView, RVEdit, CRVFData, RVTypes;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
RichViewEdit1: TRichViewEdit;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RVStyle1DrawStyleText(Sender: TRVStyle; const s: TRVRawByteString;
|
||||||
|
Canvas: TCanvas; StyleNo, SpaceBefore, Left, Top, Width,
|
||||||
|
Height: Integer; DrawState: TRVTextDrawStates;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
with RichViewEdit1 do begin
|
||||||
|
Clear;
|
||||||
|
AddNL('M',1,0);
|
||||||
|
Add('=||m',0);
|
||||||
|
Add('i,j',3);
|
||||||
|
Add('||',0);
|
||||||
|
// Note: rvoTagsArePChars in Options
|
||||||
|
AddNLTag('n',2, -1, Integer(StrNew('m')));
|
||||||
|
// double scripts are only as an example
|
||||||
|
// here. They are too imperfect -
|
||||||
|
// they assume that superscript text is narrower
|
||||||
|
// (or at least not too wider)
|
||||||
|
// than subscript
|
||||||
|
Format;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RVStyle1DrawStyleText(Sender: TRVStyle; const s: TRVRawByteString;
|
||||||
|
Canvas: TCanvas; StyleNo, SpaceBefore, Left, Top, Width, Height: Integer;
|
||||||
|
DrawState: TRVTextDrawStates; var DoDefault: Boolean);
|
||||||
|
var uppertext: PChar;
|
||||||
|
begin
|
||||||
|
// This implementation does not support Unicode text items.
|
||||||
|
// For Unicode text items, s contains "raw Unicode". It must be
|
||||||
|
// converted to ANSI or Unicode string before using.
|
||||||
|
// See the same example for Delphi 2009+ (Demos\DelphiUnicode\)
|
||||||
|
|
||||||
|
case StyleNo of
|
||||||
|
1: // dot
|
||||||
|
begin
|
||||||
|
// displaying small circle in the right top corner of item
|
||||||
|
// and allowing default drawing of item text
|
||||||
|
if (rvtsItemEnd in DrawState) and (Length(s)>0) then begin
|
||||||
|
Canvas.Pen.Color := Sender.TextStyles[1].Color;
|
||||||
|
Canvas.Ellipse(Left+Width-2,Top-2,Left+Width+2,Top+2);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
2: // double scripts
|
||||||
|
begin
|
||||||
|
// displaying tag string as superscript
|
||||||
|
// and allowing default drawing of item text (subscript)
|
||||||
|
if (rvtsItemStart in DrawState) and (Length(s)>0) then begin
|
||||||
|
uppertext := PChar(TCustomRVFormattedData(Sender.RVData).GetItemTag(Sender.ItemNo));
|
||||||
|
if uppertext<>nil then
|
||||||
|
Canvas.TextOut(Left,Top-Height+5, uppertext);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{2BFF002E-B1AF-4D22-8CF9-09CF0293C42D}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">FillInGaps.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program FillInGaps;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/FillInGaps.res
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/FillInGaps.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/Unit1.dfm
Normal file
Binary file not shown.
120
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/Unit1.pas
Normal file
120
12.0.4/Demos/Delphi/Assorted/Fields/FillInGaps/Unit1.pas
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Implementing "fields"
|
||||||
|
The main property settings:
|
||||||
|
- rvoTagsArePChars in RichViewEdit1.Options (so each item can have associated string)
|
||||||
|
- RVStyle1.TextStyles collection has two styles (for static text and for fields)
|
||||||
|
Especially look at Protection properties
|
||||||
|
- RichViewEdit1 is set to "use predefined set of styles" (right click on
|
||||||
|
RichViewEdit1 at design time, then choose "Settings")
|
||||||
|
- AcceptDragDropFormats = []
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------ }
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, RVStyle, RVScroll, RichView, RVEdit, Clipbrd, StdCtrls,
|
||||||
|
CRVData, RVTable;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichViewEdit1: TRichViewEdit;
|
||||||
|
rvs: TRVStyle;
|
||||||
|
Button1: TButton;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure RichViewEdit1Paste(Sender: TCustomRichViewEdit;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
function GetFieldLocation(RootRVData: TCustomRVData; const field: String;
|
||||||
|
var RVData: TCustomRVData; var ItemNo: Integer): Boolean;
|
||||||
|
var i,r,c: Integer;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
for i := 0 to RootRVData.ItemCount-1 do
|
||||||
|
if RootRVData.GetItemStyle(i)=rvsTable then begin
|
||||||
|
table := TRVTableItemInfo(RootRVData.GetItem(i));
|
||||||
|
for r := 0 to table.Rows.Count-1 do
|
||||||
|
for c := 0 to table.Rows[r].Count-1 do
|
||||||
|
if table.Cells[r,c]<>nil then begin
|
||||||
|
Result := GetFieldLocation(table.Cells[r,c].GetRVData,
|
||||||
|
field, RVData, ItemNo);
|
||||||
|
if Result then
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else if PChar(RootRVData.GetItemTag(i)) = field then begin
|
||||||
|
ItemNo := i;
|
||||||
|
RVData := RootRVData.GetSourceRVData;
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetFieldValue(rv: TCustomRichView; const field: String): String;
|
||||||
|
var RVData: TCustomRVData;
|
||||||
|
ItemNo: Integer;
|
||||||
|
begin
|
||||||
|
if GetFieldLocation(rv.RVData, field, RVData, ItemNo) then
|
||||||
|
Result := RVData.GetItemText(ItemNo)
|
||||||
|
else
|
||||||
|
Result := '';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichViewEdit1.Clear;
|
||||||
|
RichViewEdit1.AddNL('2 + 2 =', 1,0);
|
||||||
|
RichViewEdit1.AddNLTag(' ', 0,-1, Integer(StrNew('answer1')));
|
||||||
|
RichViewEdit1.Add('?', 1);
|
||||||
|
RichViewEdit1.AddNL('3 + 3 =', 1,0);
|
||||||
|
RichViewEdit1.AddNLTag(' ', 0,-1, Integer(StrNew('answer2')));
|
||||||
|
RichViewEdit1.Add('?', 1);
|
||||||
|
RichViewEdit1.Format;
|
||||||
|
RichViewEdit1.SetSelectionBounds(1,2,1,2);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichViewEdit1Paste(Sender: TCustomRichViewEdit;
|
||||||
|
var DoDefault: Boolean);
|
||||||
|
var s: String;
|
||||||
|
begin
|
||||||
|
// allowing to paste only one line text
|
||||||
|
s := Clipboard.AsText;
|
||||||
|
if (Pos(#10,s)=0) and (Pos(#13,s)=0) then
|
||||||
|
RichViewEdit1.InsertText(s,False);
|
||||||
|
DoDefault := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
var s: String;
|
||||||
|
begin
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'answer1');
|
||||||
|
if StrToIntDef(Trim(s), 0)<>4 then begin
|
||||||
|
Application.MessageBox('Wrong! Try again','Test', 0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'answer2');
|
||||||
|
if StrToIntDef(Trim(s), 0)<>6 then begin
|
||||||
|
Application.MessageBox('Wrong! Try again','Test', 0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Application.MessageBox('Test is passed','Test', 0);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{970B9004-2D6B-4FBA-BDDF-8A5B525AFAE7}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">LiveLink1.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program LiveLink1;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Simple/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Simple/Unit1.dfm
Normal file
Binary file not shown.
168
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Simple/Unit1.pas
Normal file
168
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Simple/Unit1.pas
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Important settings:
|
||||||
|
rvoTagsArePChars in RichViewEdit1.Options
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, StdCtrls, RVStyle, RVScroll, RichView, RVEdit;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichViewEdit1: TRichViewEdit;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
Label1: TLabel;
|
||||||
|
Edit1: TEdit;
|
||||||
|
Label2: TLabel;
|
||||||
|
Edit2: TEdit;
|
||||||
|
Button3: TButton;
|
||||||
|
Label3: TLabel;
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure Button3Click(Sender: TObject);
|
||||||
|
procedure Edit1Change(Sender: TObject);
|
||||||
|
procedure Edit2Change(Sender: TObject);
|
||||||
|
procedure RichViewEdit1Change(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
LastNameItemNo, // Storing LastItem no is not necessary,
|
||||||
|
LastDateItemNo: Integer; // but increases efficiency
|
||||||
|
Freeze: Boolean;
|
||||||
|
procedure InsertField(const field, value: String; var LastItemNo: Integer);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
procedure GetFieldItemNo(rv: TCustomRichView; const field: String; var ItemNo: Integer);
|
||||||
|
var i: Integer;
|
||||||
|
begin
|
||||||
|
if (ItemNo>=0) and (ItemNo<rv.ItemCount) and
|
||||||
|
(PChar(rv.GetItemTag(ItemNo)) = field) then
|
||||||
|
exit;
|
||||||
|
ItemNo := -1;
|
||||||
|
for i := 0 to rv.ItemCount-1 do
|
||||||
|
if PChar(rv.GetItemTag(i)) = field then begin
|
||||||
|
ItemNo := i;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetFieldValue(rv: TCustomRichView; const field: String;
|
||||||
|
var LastItemNo: Integer): String;
|
||||||
|
begin
|
||||||
|
GetFieldItemNo(rv, field, LastItemNo);
|
||||||
|
if LastItemNo>=0 then
|
||||||
|
Result := rv.GetItemText(LastItemNo)
|
||||||
|
else
|
||||||
|
Result := '';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetFieldValue(rv: TCustomRichViewEdit; const field, value: String;
|
||||||
|
var LastItemNo: Integer);
|
||||||
|
begin
|
||||||
|
GetFieldItemNo(rv, field, LastItemNo);
|
||||||
|
if LastItemNo>=0 then
|
||||||
|
rv.SetItemTextEd(LastItemNo, value);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichViewEdit1.Clear;
|
||||||
|
RichViewEdit1.AddNL('Insert fields here',0,0);
|
||||||
|
RichViewEdit1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.InsertField(const field, value: String; var LastItemNo: Integer);
|
||||||
|
var StyleNo: Integer;
|
||||||
|
begin
|
||||||
|
if GetFieldValue(RichViewEdit1, field, LastItemNo)<>'' then begin
|
||||||
|
Application.MessageBox('Field already exists!','',0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
StyleNo := RichViewEdit1.CurParaStyleNo;
|
||||||
|
RichViewEdit1.CurTextStyleNo := 6;
|
||||||
|
RichViewEdit1.InsertStringTag(value, Integer(StrNew(PChar(field))));
|
||||||
|
RichViewEdit1.CurTextStyleNo := StyleNo;
|
||||||
|
RichViewEdit1.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
|
||||||
|
begin
|
||||||
|
InsertField('name', Edit1.Text, LastNameItemNo);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InsertField('date', Edit2.Text, LastDateItemNo);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichViewEdit1.ApplyTextStyle(0);
|
||||||
|
RichViewEdit1.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Edit1Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
SetFieldValue(RichViewEdit1, 'name', Edit1.Text, LastNameItemNo);
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Edit2Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
SetFieldValue(RichViewEdit1, 'date', Edit2.Text, LastDateItemNo);
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichViewEdit1Change(Sender: TObject);
|
||||||
|
var s: String;
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'name', LastNameItemNo);
|
||||||
|
if s<>'' then
|
||||||
|
Edit1.Text := s;
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'date', LastDateItemNo);
|
||||||
|
if s<>'' then
|
||||||
|
Edit2.Text := s;
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{A36C0AC3-3FE9-4DC6-93F4-6B1327F239B0}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">LiveLink2.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program LiveLink2;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
Unit1 in 'Unit1.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Tables/Unit1.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Tables/Unit1.dfm
Normal file
Binary file not shown.
203
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Tables/Unit1.pas
Normal file
203
12.0.4/Demos/Delphi/Assorted/Fields/LiveLink/Tables/Unit1.pas
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
unit Unit1;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Important settings:
|
||||||
|
rvoTagsArePChars in RichViewEdit1.Options
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, StdCtrls, RVStyle, RVScroll, RichView, RVEdit, RVTable, CRVData, RVERVData;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichViewEdit1: TRichViewEdit;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
Label1: TLabel;
|
||||||
|
Edit1: TEdit;
|
||||||
|
Label2: TLabel;
|
||||||
|
Edit2: TEdit;
|
||||||
|
Button3: TButton;
|
||||||
|
Label3: TLabel;
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure Button3Click(Sender: TObject);
|
||||||
|
procedure Edit1Change(Sender: TObject);
|
||||||
|
procedure Edit2Change(Sender: TObject);
|
||||||
|
procedure RichViewEdit1Change(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
Freeze: Boolean;
|
||||||
|
procedure InsertField(const field, value: String);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function GetFieldLocation(RootRVData: TCustomRVData; const field: String;
|
||||||
|
var RVData: TCustomRVData; var ItemNo: Integer): Boolean;
|
||||||
|
var i,r,c: Integer;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
for i := 0 to RootRVData.ItemCount-1 do
|
||||||
|
if RootRVData.GetItemStyle(i)=rvsTable then begin
|
||||||
|
table := TRVTableItemInfo(RootRVData.GetItem(i));
|
||||||
|
for r := 0 to table.Rows.Count-1 do
|
||||||
|
for c := 0 to table.Rows[r].Count-1 do
|
||||||
|
if table.Cells[r,c]<>nil then begin
|
||||||
|
Result := GetFieldLocation(table.Cells[r,c].GetRVData, field, RVData, ItemNo);
|
||||||
|
if Result then
|
||||||
|
exit;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else if PChar(RootRVData.GetItemTag(i)) = field then begin
|
||||||
|
ItemNo := i;
|
||||||
|
RVData := RootRVData.GetSourceRVData;
|
||||||
|
Result := True;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetFieldValue(rv: TCustomRichView; const field: String): String;
|
||||||
|
var ItemNo: Integer;
|
||||||
|
RVData: TCustomRVData;
|
||||||
|
begin
|
||||||
|
if GetFieldLocation(rv.RVData, field, RVData, ItemNo) then
|
||||||
|
Result := RVData.GetRVData.GetItemText(ItemNo)
|
||||||
|
else
|
||||||
|
Result := '';
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure SetFieldValue(rv: TCustomRichViewEdit; const field, value: String);
|
||||||
|
var ItemNo: Integer;
|
||||||
|
RVData: TCustomRVData;
|
||||||
|
Ctrl: TWinControl;
|
||||||
|
AutoSelect: Boolean;
|
||||||
|
begin
|
||||||
|
if GetFieldLocation(rv.RVData, field, RVData, ItemNo) then begin
|
||||||
|
if RVData.GetRVData is TRVTableCellData then begin
|
||||||
|
ctrl := GetParentForm(rv).ActiveControl;
|
||||||
|
TRVTableCellData(RVData).Edit;
|
||||||
|
AutoSelect := False;
|
||||||
|
if (ctrl<>nil) and (ctrl is TEdit) then begin
|
||||||
|
AutoSelect := TEdit(ctrl).AutoSelect;
|
||||||
|
TEdit(ctrl).AutoSelect := False;
|
||||||
|
end;
|
||||||
|
GetParentForm(rv).ActiveControl := ctrl;
|
||||||
|
if (ctrl<>nil) and (ctrl is TEdit) then
|
||||||
|
TEdit(ctrl).AutoSelect := AutoSelect;
|
||||||
|
end;
|
||||||
|
if RVData.GetRVData is TRVEditRVData then
|
||||||
|
(TRVEditRVData(RVData.GetRVData).RichView as TCustomRichViewEdit).SetItemTextEd(ItemNo, value);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
var table: TRVTableItemInfo;
|
||||||
|
begin
|
||||||
|
RichViewEdit1.Clear;
|
||||||
|
table := TRVTableItemInfo.CreateEx(1,2,RichViewEdit1.RVData);
|
||||||
|
table.Cells[0,0].Clear;
|
||||||
|
table.Cells[0,0].AddNL('Name: ',0,1);
|
||||||
|
table.Cells[0,0].AddNLTag(Edit1.Text,6,-1,Integer(StrNew('name')));
|
||||||
|
table.Cells[0,1].Clear;
|
||||||
|
table.Cells[0,1].AddNL('Date: ',0,1);
|
||||||
|
table.Cells[0,1].AddNLTag(Edit2.Text,6,-1,Integer(StrNew('date')));
|
||||||
|
table.BorderWidth := 1;
|
||||||
|
table.CellBorderWidth := 1;
|
||||||
|
RichViewEdit1.AddItem('',table);
|
||||||
|
RichViewEdit1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.InsertField(const field, value: String);
|
||||||
|
var StyleNo: Integer;
|
||||||
|
begin
|
||||||
|
if GetFieldValue(RichViewEdit1, field)<>'' then begin
|
||||||
|
Application.MessageBox('Field already exists!','', 0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
StyleNo := RichViewEdit1.CurTextStyleNo;
|
||||||
|
RichViewEdit1.CurTextStyleNo := 6;
|
||||||
|
RichViewEdit1.InsertStringTag(value, Integer(StrNew(PChar(field))));
|
||||||
|
RichViewEdit1.CurTextStyleNo := StyleNo;
|
||||||
|
RichViewEdit1.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
|
||||||
|
begin
|
||||||
|
InsertField('name', Edit1.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InsertField('date', Edit2.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button3Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RichViewEdit1.ApplyTextStyle(0);
|
||||||
|
RichViewEdit1.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Edit1Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
SetFieldValue(RichViewEdit1, 'name', Edit1.Text);
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Edit2Change(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
SetFieldValue(RichViewEdit1, 'date', Edit2.Text);
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.RichViewEdit1Change(Sender: TObject);
|
||||||
|
var s: String;
|
||||||
|
begin
|
||||||
|
if Freeze then
|
||||||
|
exit;
|
||||||
|
Freeze := True;
|
||||||
|
try
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'name');
|
||||||
|
if s<>'' then
|
||||||
|
Edit1.Text := s;
|
||||||
|
s := GetFieldValue(RichViewEdit1, 'date');
|
||||||
|
if s<>'' then
|
||||||
|
Edit2.Text := s;
|
||||||
|
finally
|
||||||
|
Freeze := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
18
|
||||||
|
cid0001
|
||||||
|
Roberto Nelson
|
||||||
|
cid0002
|
||||||
|
Bruce Young
|
||||||
|
cid0003
|
||||||
|
Kim Lambert
|
||||||
|
cid0004
|
||||||
|
Leslie Johnson
|
||||||
|
cid0005
|
||||||
|
Phil Forest
|
||||||
|
cid0006
|
||||||
|
K.J. Weston
|
||||||
|
cid0007
|
||||||
|
Lee Terry
|
||||||
|
cid0008
|
||||||
|
Stewart Hall
|
||||||
|
cid0009
|
||||||
|
Katherine Young
|
||||||
|
cid0010
|
||||||
|
Chris Papadopulos
|
||||||
|
cid0011
|
||||||
|
Pete Fisher
|
||||||
|
cid0012
|
||||||
|
Ann Bennet
|
||||||
|
cid0013
|
||||||
|
Roger De Sousa
|
||||||
|
cid0014
|
||||||
|
Janet Boldwin
|
||||||
|
cid0015
|
||||||
|
Roger Reeves
|
||||||
|
cid0016
|
||||||
|
Willie Stansbury
|
||||||
|
cid0017
|
||||||
|
Leslie Phong
|
||||||
|
cid0018
|
||||||
|
Ashok Ramanathan
|
||||||
Binary file not shown.
@ -0,0 +1,174 @@
|
|||||||
|
unit MMMainFrm;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Very simple "mail merging" application (LabelItem Version).
|
||||||
|
It loads a template from TEMPLATE.RVF, and data from CUSTOMERS.TXT.
|
||||||
|
Template can be modified with another application in this directory:
|
||||||
|
TEMPLATEEDITORLI.
|
||||||
|
|
||||||
|
Main settings:
|
||||||
|
- since field names are stored in tags (see the help topic about tags)
|
||||||
|
as strings, rvoTagsArePChars is included in Options of rvTemplate and
|
||||||
|
rvOutput.
|
||||||
|
- fields are represented with LabelItem item type.
|
||||||
|
- rvOutput.Style = rvsOutput, rvTemplate.Style = rvsTemplate.
|
||||||
|
In rvOutput, fields are not highlighted, in rvTemplate they are always
|
||||||
|
highlighted.
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, RVScroll, RichView, StdCtrls, RVStyle, RVTable, CRVData,
|
||||||
|
RVLabelItem, RVSeqItem;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmMainMerge = class(TForm)
|
||||||
|
ListBox1: TListBox;
|
||||||
|
rvOutput: TRichView;
|
||||||
|
rvsOutput: TRVStyle;
|
||||||
|
rvsTemplate: TRVStyle;
|
||||||
|
rvTemplate: TRichView;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure ListBox1Click(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
Codes: TStringList;
|
||||||
|
procedure LoadCustomers;
|
||||||
|
function IsFieldCode(const FieldName: String): Boolean;
|
||||||
|
function GetFieldValueFromDatabase(const FieldName: String): String;
|
||||||
|
procedure FillFields(RVData: TCustomRVData);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmMainMerge: TfrmMainMerge;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ This procedure loads file CUSTOMERS.TXT into:
|
||||||
|
- ListBox1.Items (<- names of customers)
|
||||||
|
- Codes (<- codes of customers)
|
||||||
|
In real applications data can be stored in some database }
|
||||||
|
procedure TfrmMainMerge.LoadCustomers;
|
||||||
|
var F: TextFile;
|
||||||
|
i, Count: Integer;
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
AssignFile(F, ExtractFilePath(Application.ExeName)+'Customers.txt');
|
||||||
|
Reset(F);
|
||||||
|
try
|
||||||
|
Readln(F, Count);
|
||||||
|
for i := 0 to Count-1 do
|
||||||
|
begin
|
||||||
|
Readln(F, s);
|
||||||
|
Codes.Add(s);
|
||||||
|
Readln(F, s);
|
||||||
|
ListBox1.Items.Add(Trim(s))
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
CloseFile(F);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Initialization: loading template into rvOutput, loading customers data. }
|
||||||
|
procedure TfrmMainMerge.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Codes := TStringList.Create;
|
||||||
|
LoadCustomers;
|
||||||
|
rvTemplate.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
rvTemplate.Format;
|
||||||
|
if ListBox1.Items.Count>0 then
|
||||||
|
begin
|
||||||
|
ListBox1.ItemIndex := 0;
|
||||||
|
ListBox1.OnClick(nil);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmMainMerge.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Codes.Free;
|
||||||
|
Codes := nil;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Returns True if FieldName is a valid field code }
|
||||||
|
function TfrmMainMerge.IsFieldCode(const FieldName: String): Boolean;
|
||||||
|
begin
|
||||||
|
Result := (FieldName='name') or (FieldName='code') or
|
||||||
|
(Copy(FieldName, 1, 5)='date:');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ This function returns the current field value by the field name.
|
||||||
|
In this example, we have two data fields: "name" and "code",
|
||||||
|
and "date" field }
|
||||||
|
function TfrmMainMerge.GetFieldValueFromDatabase(const FieldName: String): String;
|
||||||
|
var Index: Integer;
|
||||||
|
begin
|
||||||
|
Index := ListBox1.ItemIndex;
|
||||||
|
if FieldName='name' then
|
||||||
|
Result := ListBox1.Items[Index]
|
||||||
|
else if FieldName='code' then
|
||||||
|
Result := Codes[Index]
|
||||||
|
else if Copy(FieldName, 1, 5)='date:' then begin
|
||||||
|
Result := Copy(FieldName, 6, Length(FieldName));
|
||||||
|
Result := DateToStr(StrToFloat(Result));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result := '{error: illegal field code}';
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ This function iterates through all items in RVData, and if tag of
|
||||||
|
some label item is a data field, it calls GetFieldValueFromDatabase(tag)
|
||||||
|
and replaces the label item's text with the returned value.
|
||||||
|
You can move this function to your application unchanged.
|
||||||
|
Initial call: FillFields(RichView.RVData); }
|
||||||
|
procedure TfrmMainMerge.FillFields(RVData: TCustomRVData);
|
||||||
|
var i,r,c: Integer;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
FieldName: String;
|
||||||
|
begin
|
||||||
|
for i := 0 to RVData.ItemCount-1 do
|
||||||
|
case RVData.GetItemStyle(i) of
|
||||||
|
rvsTable:
|
||||||
|
begin
|
||||||
|
table := TRVTableItemInfo(RVData.GetItem(i));
|
||||||
|
for r := 0 to table.RowCount-1 do
|
||||||
|
for c := 0 to table.ColCount-1 do
|
||||||
|
if table.Cells[r,c]<>nil then
|
||||||
|
FillFields(table.Cells[r,c].GetRVData);
|
||||||
|
end;
|
||||||
|
rvsLabel:
|
||||||
|
begin
|
||||||
|
FieldName := PChar(RVData.GetItemTag(i));
|
||||||
|
if IsFieldCode(FieldName) then
|
||||||
|
TRVLabelItemInfo(RVData.GetItem(i)).Text := GetFieldValueFromDatabase(FieldName);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ On highlighting a new list box item: updating document in rvOutput. }
|
||||||
|
procedure TfrmMainMerge.ListBox1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rvOutput.Clear;
|
||||||
|
if ListBox1.ItemIndex>=0 then
|
||||||
|
begin
|
||||||
|
rvOutput.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
FillFields(rvOutput.RVData);
|
||||||
|
rvOutput.Format;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType">VCLApplication</Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{EFF9BFB8-8627-4A59-A01F-368A676C453E}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">MailMergeLI.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||||
|
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="CodePage"></Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="GenerateHpps">False</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program MailMergeLI;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
MMMainFrm in 'MMMainFrm.pas' {frmMainMerge};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TfrmMainMerge, frmMainMerge);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,53 @@
|
|||||||
|
unit PopupFrm;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, ComCtrls, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmPopup = class(TForm)
|
||||||
|
Panel1: TPanel;
|
||||||
|
Panel2: TPanel;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
cal: TMonthCalendar;
|
||||||
|
procedure FormDeactivate(Sender: TObject);
|
||||||
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
uses TEMainFrm;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmPopup.FormDeactivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmPopup.FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
|
begin
|
||||||
|
Action := caFree;
|
||||||
|
frmTemplateEditor.rve.SmartPopupProperties.SetButtonState(False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmPopup.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmTemplateEditor.ChangeDate(cal.Date);
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmPopup.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
Binary file not shown.
@ -0,0 +1,408 @@
|
|||||||
|
unit TEMainFrm;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
TEMPLATE EDITOR (LABEL ITEM VERSION)
|
||||||
|
This demo creates template and saves it in TEMPLATE.RVF.
|
||||||
|
|
||||||
|
This demo shows how to:
|
||||||
|
- use TRVLabelItemInfo as field;
|
||||||
|
- use TRVSeqItemInfo (only one numbered sequence ("Num") is inserted in
|
||||||
|
this demo, but you can paste RTF files with additional sequences).
|
||||||
|
- use "smart popups" to edit item properties.
|
||||||
|
|
||||||
|
See mail merging application in the same directory - MAILMERGELI.
|
||||||
|
|
||||||
|
Main settings:
|
||||||
|
- since field names are stored in tags (see the help topic about tags)
|
||||||
|
as strings, rvoTagsArePChars is included in Options of rve.
|
||||||
|
- this demo uses free formatting of template (right click richviews,
|
||||||
|
choose "Settings" from the context menu, choose "Allow adding styles
|
||||||
|
dynamically").
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
StdCtrls, ExtCtrls, Menus,
|
||||||
|
Dialogs, RVStyle, RVScroll, RichView, RVEdit,
|
||||||
|
RVLabelItem, RVSeqItem, ImgList;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmTemplateEditor = class(TForm)
|
||||||
|
rve: TRichViewEdit;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
MainMenu1: TMainMenu;
|
||||||
|
mitFile: TMenuItem;
|
||||||
|
mitSave: TMenuItem;
|
||||||
|
N1: TMenuItem;
|
||||||
|
mitExit: TMenuItem;
|
||||||
|
mitInsert: TMenuItem;
|
||||||
|
mitView: TMenuItem;
|
||||||
|
mitShowNever: TMenuItem;
|
||||||
|
mitShowCurrent: TMenuItem;
|
||||||
|
mitShowAlways: TMenuItem;
|
||||||
|
mitName: TMenuItem;
|
||||||
|
mitCode: TMenuItem;
|
||||||
|
N2: TMenuItem;
|
||||||
|
mitNumber: TMenuItem;
|
||||||
|
mitDate: TMenuItem;
|
||||||
|
ImageList1: TImageList;
|
||||||
|
pmField: TPopupMenu;
|
||||||
|
pmSeq: TPopupMenu;
|
||||||
|
mitDecimal: TMenuItem;
|
||||||
|
mitLowerAlpha: TMenuItem;
|
||||||
|
mitUpperAlpha: TMenuItem;
|
||||||
|
mitLowerRoman: TMenuItem;
|
||||||
|
mitUpperRoman: TMenuItem;
|
||||||
|
N3: TMenuItem;
|
||||||
|
mitContinue: TMenuItem;
|
||||||
|
mitResetTo: TMenuItem;
|
||||||
|
mitToName: TMenuItem;
|
||||||
|
mitToCode: TMenuItem;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure mitShowNeverClick(Sender: TObject);
|
||||||
|
procedure mitShowCurrentClick(Sender: TObject);
|
||||||
|
procedure mitShowAlwaysClick(Sender: TObject);
|
||||||
|
procedure mitNameClick(Sender: TObject);
|
||||||
|
procedure mitCodeClick(Sender: TObject);
|
||||||
|
procedure mitSaveClick(Sender: TObject);
|
||||||
|
procedure mitExitClick(Sender: TObject);
|
||||||
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||||
|
procedure mitDateClick(Sender: TObject);
|
||||||
|
procedure mitNumberClick(Sender: TObject);
|
||||||
|
procedure rveCaretMove(Sender: TObject);
|
||||||
|
procedure mitNumberTypeClick(Sender: TObject);
|
||||||
|
procedure pmSeqPopup(Sender: TObject);
|
||||||
|
procedure mitResetToClick(Sender: TObject);
|
||||||
|
procedure mitContinueClick(Sender: TObject);
|
||||||
|
procedure mitToNameClick(Sender: TObject);
|
||||||
|
procedure mitToCodeClick(Sender: TObject);
|
||||||
|
procedure pmFieldPopup(Sender: TObject);
|
||||||
|
procedure rveSmartPopupClick(Sender: TCustomRichView;
|
||||||
|
Button: TCustomControl);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
procedure InsertField(const FieldCode, DisplayString: String);
|
||||||
|
procedure SetNumberTypeToMenu(NumberType: TRVSeqType);
|
||||||
|
procedure ResetCurrentSeqTo(Value: Integer; Reset: Boolean);
|
||||||
|
procedure ChangeFieldTo(const FieldCode, DisplayString: String);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
procedure ChangeDate(Date: TDate);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmTemplateEditor: TfrmTemplateEditor;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses PopupFrm;
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TfrmTemplateEditor.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
rve.Format;
|
||||||
|
end;
|
||||||
|
{============================= Menu "File" =====================================}
|
||||||
|
procedure TfrmTemplateEditor.mitSaveClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.SaveRVF(ExtractFilePath(Application.ExeName)+'template.rvf', False);
|
||||||
|
rve.Modified := False;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitExitClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||||
|
begin
|
||||||
|
if rve.Modified then
|
||||||
|
case Application.MessageBox('Template was modified'#13'Save?', 'Closing',
|
||||||
|
MB_YESNOCANCEL or MB_ICONQUESTION) of
|
||||||
|
ID_YES:
|
||||||
|
mitSaveClick(Sender);
|
||||||
|
ID_CANCEL:
|
||||||
|
CanClose := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{=========================== Menu "Insert" ====================================}
|
||||||
|
{ Inserting field.
|
||||||
|
FieldCode - field code, saved in item's tag. Main application will search
|
||||||
|
field by its code.
|
||||||
|
DisplayString - will be displayed in place of field by default. Any string. }
|
||||||
|
procedure TfrmTemplateEditor.InsertField(const FieldCode, DisplayString: String);
|
||||||
|
var li: TRVLabelItemInfo;
|
||||||
|
begin
|
||||||
|
li := TRVLabelItemInfo.CreateEx(rve.RVData, rve.CurTextStyleNo, DisplayString);
|
||||||
|
li.Tag := Integer(StrNew(PChar(FieldCode)));
|
||||||
|
rve.InsertItem('', li);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitNameClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InsertField('name', '<Name>');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitCodeClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
InsertField('code', '<Code>');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitDateClick(Sender: TObject);
|
||||||
|
var LDate: TDate;
|
||||||
|
begin
|
||||||
|
LDate := Date;
|
||||||
|
InsertField('date:'+FloatToStr(LDate), '<'+DateToStr(LDate)+'>');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitNumberClick(Sender: TObject);
|
||||||
|
var si: TRVSeqItemInfo;
|
||||||
|
begin
|
||||||
|
si := TRVSeqItemInfo.CreateEx(rve.RVData, 'Num', rvseqDecimal,
|
||||||
|
rve.CurTextStyleNo, 1, False);
|
||||||
|
rve.InsertItem('', si);
|
||||||
|
end;
|
||||||
|
{========================== Menu "View" =======================================}
|
||||||
|
procedure TfrmTemplateEditor.mitShowNeverClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RVStyle1.FieldHighlightType := rvfhNever;
|
||||||
|
rve.RefreshAll;
|
||||||
|
mitShowNever.Checked := True;
|
||||||
|
mitShowCurrent.Checked := False;
|
||||||
|
mitShowAlways.Checked := False;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitShowCurrentClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RVStyle1.FieldHighlightType := rvfhCurrent;
|
||||||
|
rve.RefreshAll;
|
||||||
|
mitShowNever.Checked := False;
|
||||||
|
mitShowCurrent.Checked := True;
|
||||||
|
mitShowAlways.Checked := False;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TfrmTemplateEditor.mitShowAlwaysClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
RVStyle1.FieldHighlightType := rvfhAlways;
|
||||||
|
rve.RefreshAll;
|
||||||
|
mitShowNever.Checked := False;
|
||||||
|
mitShowCurrent.Checked := False;
|
||||||
|
mitShowAlways.Checked := True;
|
||||||
|
end;
|
||||||
|
{======================= Smart Popups =========================================}
|
||||||
|
procedure TfrmTemplateEditor.rveCaretMove(Sender: TObject);
|
||||||
|
var tle: TCustomRichViewEdit;
|
||||||
|
FieldCode: String;
|
||||||
|
begin
|
||||||
|
tle := rve.TopLevelEditor;
|
||||||
|
case tle.GetItemStyle(tle.CurItemNo) of
|
||||||
|
rvsLabel:
|
||||||
|
begin
|
||||||
|
FieldCode := PChar(tle.GetItemTag(tle.CurItemNo));
|
||||||
|
if Copy(FieldCode, 1, 5)='date:' then begin
|
||||||
|
rve.SmartPopupProperties.Hint := 'Change Date';
|
||||||
|
rve.SmartPopupProperties.ImageIndex := 1;
|
||||||
|
rve.SmartPopupProperties.Menu := nil;
|
||||||
|
rve.OnSmartPopupClick := rveSmartPopupClick;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
rve.SmartPopupProperties.Hint := 'Change Field Code';
|
||||||
|
rve.SmartPopupProperties.ImageIndex := 0;
|
||||||
|
rve.SmartPopupProperties.Menu := pmField;
|
||||||
|
rve.OnSmartPopupClick := nil;
|
||||||
|
end;
|
||||||
|
rve.SmartPopupVisible := True;
|
||||||
|
end;
|
||||||
|
rvsSequence:
|
||||||
|
begin
|
||||||
|
rve.SmartPopupProperties.Hint := 'Change Numbering';
|
||||||
|
rve.SmartPopupProperties.ImageIndex := 2;
|
||||||
|
rve.SmartPopupProperties.Menu := pmSeq;
|
||||||
|
rve.SmartPopupVisible := True;
|
||||||
|
rve.OnSmartPopupClick := nil;
|
||||||
|
end;
|
||||||
|
else
|
||||||
|
rve.SmartPopupVisible := False;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: checking appropriate numbering type in pmSeq }
|
||||||
|
procedure TfrmTemplateEditor.SetNumberTypeToMenu(NumberType: TRVSeqType);
|
||||||
|
var i: TRVSeqType;
|
||||||
|
begin
|
||||||
|
for i := Low(TRVSeqType) to High(TRVSeqType) do
|
||||||
|
pmSeq.Items[ord(i)].Checked := pmSeq.Items[ord(i)].Tag=ord(NumberType);
|
||||||
|
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: checking pmSeq items before it is displayed }
|
||||||
|
procedure TfrmTemplateEditor.pmSeqPopup(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsSequence then begin
|
||||||
|
Beep;
|
||||||
|
abort;
|
||||||
|
end;
|
||||||
|
SetNumberTypeToMenu(TRVSeqItemInfo(rve.GetCurrentItem).NumberType);
|
||||||
|
mitResetTo.Checked := TRVSeqItemInfo(rve.GetCurrentItem).Reset;
|
||||||
|
mitContinue.Checked := not mitResetTo.Checked;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: changing StartFrom and Reset properties of the current sequence
|
||||||
|
item as an editing operation }
|
||||||
|
procedure TfrmTemplateEditor.ResetCurrentSeqTo(Value: Integer; Reset: Boolean);
|
||||||
|
var oldsi,si: TRVSeqItemInfo;
|
||||||
|
tle: TCustomRichViewEdit;
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsSequence then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// creating a new item with the desired properties and inserting it
|
||||||
|
// instead the old item
|
||||||
|
oldsi := TRVSeqItemInfo(rve.GetCurrentItem);
|
||||||
|
si := TRVSeqItemInfo.Create(rve.RVData);
|
||||||
|
si.Assign(oldsi);
|
||||||
|
if Reset then
|
||||||
|
si.StartFrom := Value;
|
||||||
|
si.Reset := Reset;
|
||||||
|
tle := rve.TopLevelEditor;
|
||||||
|
tle.SetSelectionBounds(tle.CurItemNo, 0, tle.CurItemNo, 1);
|
||||||
|
rve.InsertItem('', si);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: changing NumberType property of the current sequence
|
||||||
|
item as an editing operation }
|
||||||
|
procedure TfrmTemplateEditor.mitNumberTypeClick(Sender: TObject);
|
||||||
|
var oldsi,si: TRVSeqItemInfo;
|
||||||
|
tle: TCustomRichViewEdit;
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsSequence then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// creating a new item with the desired properties and inserting it
|
||||||
|
// instead the old item
|
||||||
|
oldsi := TRVSeqItemInfo(rve.GetCurrentItem);
|
||||||
|
si := TRVSeqItemInfo.Create(rve.RVData);
|
||||||
|
si.Assign(oldsi);
|
||||||
|
si.NumberType := TRVSeqType(TMenuItem(Sender).Tag);
|
||||||
|
tle := rve.TopLevelEditor;
|
||||||
|
tle.SetSelectionBounds(tle.CurItemNo, 0, tle.CurItemNo, 1);
|
||||||
|
rve.InsertItem('', si);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: Reset to... }
|
||||||
|
procedure TfrmTemplateEditor.mitResetToClick(Sender: TObject);
|
||||||
|
var s,s2: String;
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsSequence then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
s := IntToStr(TRVSeqItemInfo(rve.GetCurrentItem).StartFrom);
|
||||||
|
s2 := s;
|
||||||
|
if InputQuery('Reset','Reset &to:', s2) then begin
|
||||||
|
if s=s2 then
|
||||||
|
exit;
|
||||||
|
ResetCurrentSeqTo(StrToIntDef(s2, 1), True);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Sequences: Continue numbering }
|
||||||
|
procedure TfrmTemplateEditor.mitContinueClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ResetCurrentSeqTo(1{<-ignored}, False);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Fields: changing field code and text as an editing operation}
|
||||||
|
procedure TfrmTemplateEditor.ChangeFieldTo(const FieldCode, DisplayString: String);
|
||||||
|
var oldli, li: TRVLabelItemInfo;
|
||||||
|
tle: TCustomRichViewEdit;
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsLabel then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
// creating a new item with the desired properties and inserting it
|
||||||
|
// instead the old item
|
||||||
|
oldli := TRVLabelItemInfo(rve.GetCurrentItem);
|
||||||
|
li := TRVLabelItemInfo.Create(rve.RVData);
|
||||||
|
li.Assign(oldli);
|
||||||
|
li.Text := DisplayString;
|
||||||
|
// assign does not copy tag,
|
||||||
|
// so it's not necessary to call StrDispose(PChar(li.Tag))
|
||||||
|
li.Tag := Integer(StrNew(PChar(FieldCode)));
|
||||||
|
tle := rve.TopLevelEditor;
|
||||||
|
tle.SetSelectionBounds(tle.CurItemNo, 0, tle.CurItemNo, 1);
|
||||||
|
rve.InsertItem('', li);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Fields: changing the current field to "name" }
|
||||||
|
procedure TfrmTemplateEditor.mitToNameClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ChangeFieldTo('name', '<Name>');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Fields: changing the current field to "code" }
|
||||||
|
procedure TfrmTemplateEditor.mitToCodeClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ChangeFieldTo('code', '<Code>');
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Fields: checking items in pmFields before it is displayed }
|
||||||
|
procedure TfrmTemplateEditor.pmFieldPopup(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsLabel then begin
|
||||||
|
Beep;
|
||||||
|
abort;
|
||||||
|
end;
|
||||||
|
mitToName.Checked := PChar(rve.GetCurrentTag)='name';
|
||||||
|
mitToCode.Checked := PChar(rve.GetCurrentTag)='code';
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Date field: displaying calendar popup }
|
||||||
|
procedure TfrmTemplateEditor.rveSmartPopupClick(Sender: TCustomRichView;
|
||||||
|
Button: TCustomControl);
|
||||||
|
var CalendarForm: TfrmPopup;
|
||||||
|
pt: TPoint;
|
||||||
|
FieldCode: String;
|
||||||
|
li: TRVLabelItemInfo;
|
||||||
|
begin
|
||||||
|
if rve.CurItemStyle<>rvsLabel then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
li := TRVLabelItemInfo(rve.GetCurrentItem);
|
||||||
|
FieldCode := PChar(li.Tag);
|
||||||
|
if Copy(FieldCode, 1, 5)<>'date:' then begin
|
||||||
|
Beep;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
CalendarForm := TfrmPopup.Create(Application);
|
||||||
|
CalendarForm.cal.Date := StrToInt(Copy(FieldCode, 6, Length(FieldCode)));
|
||||||
|
pt.X := 0;
|
||||||
|
pt.Y := Button.Height;
|
||||||
|
pt := Button.ClientToScreen(pt);
|
||||||
|
if pt.X+CalendarForm.Width>Screen.Width then
|
||||||
|
pt.X := Screen.Width-CalendarForm.Width;
|
||||||
|
if pt.Y+CalendarForm.Height>Screen.Height then
|
||||||
|
pt.Y := Screen.Height-CalendarForm.Height;
|
||||||
|
CalendarForm.Left := pt.X;
|
||||||
|
CalendarForm.Top := pt.Y;
|
||||||
|
CalendarForm.Show;
|
||||||
|
rve.SmartPopupProperties.SetButtonState(True);
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{ Date field: this method is called by the calendar form }
|
||||||
|
procedure TfrmTemplateEditor.ChangeDate(Date: TDate);
|
||||||
|
begin
|
||||||
|
ChangeFieldTo('date:'+FloatToStr(Date), '<'+DateToStr(Date)+'>');
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType">VCLApplication</Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{B6DA4BDD-10A1-431A-8CCA-ED85877C5064}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">TemplateEditorLI.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
<Compiler Name="UnitInitSeq">True</Compiler>
|
||||||
|
<Compiler Name="LocalPInvoke">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="CodePage"></Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="GenerateHpps">False</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="Debug Symbols Search Path"></Parameters>
|
||||||
|
<Parameters Name="LoadAllSymbols">True</Parameters>
|
||||||
|
<Parameters Name="LoadUnspecifiedSymbols">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="CompanyName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileDescription"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="InternalName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductName"></VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="Comments"></VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
program TemplateEditorLI;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
TEMainFrm in 'TEMainFrm.pas' {frmTemplateEditor},
|
||||||
|
PopupFrm in 'PopupFrm.pas' {frmPopup};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TfrmTemplateEditor, frmTemplateEditor);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
Binary file not shown.
37
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/Customers.txt
Normal file
37
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/Customers.txt
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
18
|
||||||
|
cid0001
|
||||||
|
Roberto Nelson
|
||||||
|
cid0002
|
||||||
|
Bruce Young
|
||||||
|
cid0003
|
||||||
|
Kim Lambert
|
||||||
|
cid0004
|
||||||
|
Leslie Johnson
|
||||||
|
cid0005
|
||||||
|
Phil Forest
|
||||||
|
cid0006
|
||||||
|
K.J. Weston
|
||||||
|
cid0007
|
||||||
|
Lee Terry
|
||||||
|
cid0008
|
||||||
|
Stewart Hall
|
||||||
|
cid0009
|
||||||
|
Katherine Young
|
||||||
|
cid0010
|
||||||
|
Chris Papadopulos
|
||||||
|
cid0011
|
||||||
|
Pete Fisher
|
||||||
|
cid0012
|
||||||
|
Ann Bennet
|
||||||
|
cid0013
|
||||||
|
Roger De Sousa
|
||||||
|
cid0014
|
||||||
|
Janet Boldwin
|
||||||
|
cid0015
|
||||||
|
Roger Reeves
|
||||||
|
cid0016
|
||||||
|
Willie Stansbury
|
||||||
|
cid0017
|
||||||
|
Leslie Phong
|
||||||
|
cid0018
|
||||||
|
Ashok Ramanathan
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MMMainFrm.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MMMainFrm.dfm
Normal file
Binary file not shown.
174
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MMMainFrm.pas
Normal file
174
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MMMainFrm.pas
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
unit MMMainFrm;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Very simple "mail merging" application.
|
||||||
|
It loads a template from TEMPLATE.RVF, and data from CUSTOMERS.TXT.
|
||||||
|
Template can be modified with another application in this directory:
|
||||||
|
TEMPLATEEDITOR.
|
||||||
|
|
||||||
|
Main settings:
|
||||||
|
- since field names are stored in tags (see the help topic about tags)
|
||||||
|
as strings, rvoTagsArePChars is included in Options of rvTemplate and
|
||||||
|
rvOutput.
|
||||||
|
- this demo uses a predefined set of styles (right click richviews,
|
||||||
|
choose "Settings" from the context menu, choose "Use a predefined
|
||||||
|
set of styles"). That means - only two text styles (see below) will be used.
|
||||||
|
- rvOutput.Style = rvsOutput, rvTemplate.Style = rvsTemplate.
|
||||||
|
- rvsTemplate has absolutely the same set of TextStyles as in template editor
|
||||||
|
(0th style - normal text, 1th - field code)
|
||||||
|
- rvsOutput has a similar set of styles, but 1th text style looks like
|
||||||
|
normal text.
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, RVScroll, RichView, StdCtrls, RVStyle, RVTable, CRVData;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
ListBox1: TListBox;
|
||||||
|
rvOutput: TRichView;
|
||||||
|
rvsOutput: TRVStyle;
|
||||||
|
rvsTemplate: TRVStyle;
|
||||||
|
rvTemplate: TRichView;
|
||||||
|
Label1: TLabel;
|
||||||
|
Label2: TLabel;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure ListBox1Click(Sender: TObject);
|
||||||
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
Codes: TStringList;
|
||||||
|
procedure LoadCustomers;
|
||||||
|
function GetFieldValueFromDatabase(const FieldName: String): String;
|
||||||
|
procedure FillFields(RVData: TCustomRVData);
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
This procedure loads file CUSTOMERS.TXT into:
|
||||||
|
- ListBox1.Items (<- names of customers)
|
||||||
|
- Codes (<- codes of customers)
|
||||||
|
|
||||||
|
In real applications data can be stored in some database
|
||||||
|
}
|
||||||
|
procedure TForm1.LoadCustomers;
|
||||||
|
var F: TextFile;
|
||||||
|
i, Count: Integer;
|
||||||
|
s: String;
|
||||||
|
begin
|
||||||
|
AssignFile(F, ExtractFilePath(Application.ExeName)+'Customers.txt');
|
||||||
|
Reset(F);
|
||||||
|
try
|
||||||
|
Readln(F, Count);
|
||||||
|
for i := 0 to Count-1 do
|
||||||
|
begin
|
||||||
|
Readln(F, s);
|
||||||
|
Codes.Add(s);
|
||||||
|
Readln(F, s);
|
||||||
|
ListBox1.Items.Add(Trim(s))
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
CloseFile(F);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Initialization: loading template into rvOutput, loading customers data.
|
||||||
|
}
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Codes := TStringList.Create;
|
||||||
|
LoadCustomers;
|
||||||
|
rvTemplate.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
rvTemplate.Format;
|
||||||
|
if ListBox1.Items.Count>0 then
|
||||||
|
begin
|
||||||
|
ListBox1.ItemIndex := 0;
|
||||||
|
ListBox1.OnClick(nil);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.FormDestroy(Sender: TObject);
|
||||||
|
begin
|
||||||
|
Codes.Free;
|
||||||
|
Codes := nil;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
This function returns a current field value by the field name.
|
||||||
|
In this example, we have two fields: "name" and "code"
|
||||||
|
}
|
||||||
|
function TForm1.GetFieldValueFromDatabase(const FieldName: String): String;
|
||||||
|
var Index: Integer;
|
||||||
|
begin
|
||||||
|
Index := ListBox1.ItemIndex;
|
||||||
|
if FieldName='name' then
|
||||||
|
Result := ListBox1.Items[Index]
|
||||||
|
else if FieldName='code' then
|
||||||
|
Result := Codes[Index]
|
||||||
|
else
|
||||||
|
Result := '{error: illegal field code}';
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
This function iterates through all items in RVData, and if tag of
|
||||||
|
some text contains non-empty text, it calls GetFieldValueFromDatabase(tag) and
|
||||||
|
replace this text with returned value.
|
||||||
|
You can move this function to your application unchanged.
|
||||||
|
Initial call: FillFields(RichView.RVData);
|
||||||
|
}
|
||||||
|
procedure TForm1.FillFields(RVData: TCustomRVData);
|
||||||
|
var i,r,c: Integer;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
FieldName: String;
|
||||||
|
begin
|
||||||
|
for i := 0 to RVData.ItemCount-1 do
|
||||||
|
if RVData.GetItemStyle(i)=rvsTable then
|
||||||
|
begin
|
||||||
|
table := TRVTableItemInfo(RVData.GetItem(i));
|
||||||
|
for r := 0 to table.Rows.Count-1 do
|
||||||
|
for c := 0 to table.Rows[r].Count-1 do
|
||||||
|
if table.Cells[r,c]<>nil then
|
||||||
|
FillFields(table.Cells[r,c].GetRVData);
|
||||||
|
table.Changed;
|
||||||
|
end
|
||||||
|
else if RVData.GetItemStyle(i)>=0 then
|
||||||
|
begin
|
||||||
|
FieldName := PChar(RVData.GetItemTag(i));
|
||||||
|
if FieldName<>'' then
|
||||||
|
RVData.SetItemText(i, GetFieldValueFromDatabase(FieldName));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
On highlighting a new list box item: updating document in rvOutput.
|
||||||
|
}
|
||||||
|
procedure TForm1.ListBox1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rvOutput.Clear;
|
||||||
|
if ListBox1.ItemIndex>=0 then
|
||||||
|
begin
|
||||||
|
rvOutput.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
FillFields(rvOutput.RVData);
|
||||||
|
rvOutput.Format;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
||||||
165
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.bdsproj
Normal file
165
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.bdsproj
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{55775E68-8F9A-4A27-AC3F-61E27B2A3F91}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">MailMerge.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
13
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.dpr
Normal file
13
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.dpr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
program MailMerge;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
MMMainFrm in 'MMMainFrm.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.res
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/MailMerge.res
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TEMainFrm.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TEMainFrm.dfm
Normal file
Binary file not shown.
90
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TEMainFrm.pas
Normal file
90
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TEMainFrm.pas
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
unit TEMainFrm;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Very simple template editor for "mail merging"
|
||||||
|
It loads and saves a template in TEMPLATE.RVF.
|
||||||
|
|
||||||
|
See mail merging application in the same directory - MAILMERGE.
|
||||||
|
|
||||||
|
Main settings:
|
||||||
|
- since field names are stored in tags (see the help topic about tags)
|
||||||
|
as strings, rvoTagsArePChars is included in Options of rve.
|
||||||
|
- this demo uses a predefined set of styles (right click richviews,
|
||||||
|
choose "Settings" from the context menu, choose "Use a predefined
|
||||||
|
set of styles"). That means - only two text styles (see below) will be used.
|
||||||
|
- rve.Style has two styles:
|
||||||
|
0th style - normal text,
|
||||||
|
1st - field code (bold, with background, protected)
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, RVStyle, RVScroll, RichView, RVEdit, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
Panel1: TPanel;
|
||||||
|
Button1: TButton;
|
||||||
|
Button2: TButton;
|
||||||
|
rve: TRichViewEdit;
|
||||||
|
RVStyle1: TRVStyle;
|
||||||
|
Button4: TButton;
|
||||||
|
procedure Button4Click(Sender: TObject);
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure Button2Click(Sender: TObject);
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.LoadRVF(ExtractFilePath(Application.ExeName)+'template.rvf');
|
||||||
|
rve.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.Button4Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.SaveRVF(ExtractFilePath(Application.ExeName)+'template.rvf', False);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Inserting a field "code". Text of this item does not matter, but tag
|
||||||
|
is important and equal to "code".
|
||||||
|
Since rvprDoNotAutoSwitch is in Protection of the 1st text style,
|
||||||
|
a current style will be switched back to previous value after insertion.
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.Button1Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.CurTextStyleNo := 1;
|
||||||
|
rve.InsertStringTag('Code', Integer(StrNew('code')));
|
||||||
|
rve.SetFocus;
|
||||||
|
end;
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
{
|
||||||
|
Inserting a field "name".
|
||||||
|
}
|
||||||
|
{------------------------------------------------------------------------------}
|
||||||
|
procedure TForm1.Button2Click(Sender: TObject);
|
||||||
|
begin
|
||||||
|
rve.CurTextStyleNo := 1;
|
||||||
|
rve.InsertStringTag('Name', Integer(StrNew('name')));
|
||||||
|
rve.SetFocus;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{F5784B82-F022-4CE1-ACD9-E60D441485F1}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">TemplateEditor.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program TemplateEditor;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
TEMainFrm in 'TEMainFrm.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TemplateEditor.res
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge/TemplateEditor.res
Normal file
Binary file not shown.
@ -0,0 +1,9 @@
|
|||||||
|
-8 1 2
|
||||||
|
0 1 0 0 0 0
|
||||||
|
This is
|
||||||
|
1 1 -1 1 0 name
|
||||||
|
Name
|
||||||
|
0 1 0 4 0 0
|
||||||
|
and code is
|
||||||
|
1 1 -1 1 0 code
|
||||||
|
Code
|
||||||
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.MB
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.MB
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.PX
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.PX
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.db
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/Database.db
Normal file
Binary file not shown.
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/MainAppFrm.dfm
Normal file
BIN
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/MainAppFrm.dfm
Normal file
Binary file not shown.
146
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/MainAppFrm.pas
Normal file
146
12.0.4/Demos/Delphi/Assorted/Fields/MailMerge2/MainAppFrm.pas
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
{==============================================================================}
|
||||||
|
{
|
||||||
|
Mail merge application: part 2 - displaying processed template.
|
||||||
|
|
||||||
|
How it works:
|
||||||
|
- RVStyle2 has two predefined styles (the same as in the template editor;
|
||||||
|
1th text style is reserved for fields).
|
||||||
|
- RichView1 and RichView2 are linked to the same RVStyle (RVStyle2)
|
||||||
|
- Template is loaded in RichView1 (styles can be added dynamically in RVStyle2)
|
||||||
|
- RichView1 is scanned for fields. When field is found, it is deleted,
|
||||||
|
and its value is inserted in its place:
|
||||||
|
* field value is loaded in invisible RichView2 (styles can be added in RVStyle2)
|
||||||
|
* contents of RichView2 is inserted in the proper place of RichView1.
|
||||||
|
}
|
||||||
|
{==============================================================================}
|
||||||
|
|
||||||
|
unit MainAppFrm;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
|
||||||
|
Dialogs, RVScroll, RichView, RVStyle, DB, DBTables, CRVData, CRVFData,
|
||||||
|
RVItem, RVTable;
|
||||||
|
|
||||||
|
type
|
||||||
|
TForm1 = class(TForm)
|
||||||
|
RichView1: TRichView;
|
||||||
|
RichView2: TRichView;
|
||||||
|
Table1: TTable;
|
||||||
|
RVStyle2: TRVStyle;
|
||||||
|
procedure FormCreate(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure ReplaceFields(RVData: TCustomRVFormattedData);
|
||||||
|
{ Private declarations }
|
||||||
|
public
|
||||||
|
{ Public declarations }
|
||||||
|
function LoadData(const Code: String): TMemoryStream;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form1: TForm1;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.dfm}
|
||||||
|
|
||||||
|
procedure TForm1.FormCreate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
// Loading template with fields
|
||||||
|
RichView1.LoadRVF(ExtractFilePath(Application.ExeName)+'Template.rvf');
|
||||||
|
// RVData.InsertFromStream (we will call it later) does not support
|
||||||
|
// style merging. So changing mode to style ignoring:
|
||||||
|
RichView1.RVFParaStylesReadMode := rvf_sIgnore;
|
||||||
|
RichView1.RVFTextStylesReadMode := rvf_sIgnore;
|
||||||
|
// Replace styles with values
|
||||||
|
ReplaceFields(RichView1.RVData);
|
||||||
|
RichView1.Format;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.ReplaceFields(RVData: TCustomRVFormattedData);
|
||||||
|
var i,j: Integer;
|
||||||
|
Stream: TMemoryStream;
|
||||||
|
Dummy1: TColor;
|
||||||
|
Dummy2, Dummy3: Pointer;
|
||||||
|
ParaNo: Integer;
|
||||||
|
BR, ContinuePara: Boolean;
|
||||||
|
table: TRVTableItemInfo;
|
||||||
|
r,c: Integer;
|
||||||
|
begin
|
||||||
|
Dummy1 := clNone;
|
||||||
|
Dummy2 := nil;
|
||||||
|
Dummy3 := nil;
|
||||||
|
i := RVData.ItemCount-1;
|
||||||
|
while i>=0 do begin
|
||||||
|
case RVData.GetItemStyle(i) of
|
||||||
|
1: // the first text style is used for fields
|
||||||
|
begin
|
||||||
|
// storing parameters of deleted items
|
||||||
|
ParaNo := RVData.GetItemPara(i);
|
||||||
|
BR := RVData.GetItem(i).BR;
|
||||||
|
ContinuePara := RVData.GetItem(i).SameAsPrev;
|
||||||
|
// loading field value in the stream
|
||||||
|
Stream := LoadData(RVData.GetItemText(i));
|
||||||
|
if Stream<>nil then begin
|
||||||
|
// deleting the field code
|
||||||
|
RVData.DeleteItems(i,1);
|
||||||
|
// inserting the field value
|
||||||
|
RVData.InsertRVFFromStream(Stream, i, Dummy1, Dummy2, Dummy3, False);
|
||||||
|
// applying stored parameters to the inserted items
|
||||||
|
if (i>0) and (RVData.GetItemStyle(i-1)=rvsListMarker) and
|
||||||
|
(RVData.GetItemStyle(i)=rvsListMarker) then
|
||||||
|
RVData.DeleteItems(i, 1);
|
||||||
|
for j := i to RVData.ItemCount-1 do begin
|
||||||
|
if (i=j) then begin
|
||||||
|
if RVData.GetItem(j).GetBoolValue(rvbpFullWidth) then begin
|
||||||
|
if (i>0) and (RVData.GetItemStyle(i-1)=rvsListMarker) then begin
|
||||||
|
dec(i);
|
||||||
|
RVData.DeleteItems(i, 1);
|
||||||
|
end;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
RVData.GetItem(j).SameAsPrev := ContinuePara;
|
||||||
|
if BR then
|
||||||
|
RVData.GetItem(j).BR := True;
|
||||||
|
end;
|
||||||
|
if (j>i) and RVData.IsParaStart(j) then
|
||||||
|
break;
|
||||||
|
RVData.GetItem(j).ParaNo := ParaNo;
|
||||||
|
end;
|
||||||
|
Stream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
rvsTable:
|
||||||
|
begin
|
||||||
|
// recursive call for table cells
|
||||||
|
table := TRVTableItemInfo(RVData.GetItem(i));
|
||||||
|
for r := 0 to table.Rows.Count-1 do
|
||||||
|
for c := 0 to table.Rows[r].Count-1 do
|
||||||
|
if table.Cells[r,c]<>nil then
|
||||||
|
ReplaceFields(table.Cells[r,c]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
dec(i);
|
||||||
|
end;
|
||||||
|
RVData.Normalize;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// Loading field code
|
||||||
|
function TForm1.LoadData(const Code: String): TMemoryStream;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
if not Table1.Locate('Code', Code, []) then
|
||||||
|
exit;
|
||||||
|
Result := TMemoryStream.Create;
|
||||||
|
TBlobField(Table1.FieldByName('Data')).SaveToStream(Result);
|
||||||
|
Result.Position := 0;
|
||||||
|
RichView2.Clear;
|
||||||
|
RichView2.InsertRVFFromStream(Result, 0); // inserting will merge styles;
|
||||||
|
// RichView1 and RichView2 have the same collections of styles
|
||||||
|
Result.Clear;
|
||||||
|
RichView2.SaveRVFToStream(Result, False);
|
||||||
|
Result.Position := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
@ -0,0 +1,165 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<BorlandProject>
|
||||||
|
<PersonalityInfo>
|
||||||
|
<Option>
|
||||||
|
<Option Name="Personality">Delphi.Personality</Option>
|
||||||
|
<Option Name="ProjectType"></Option>
|
||||||
|
<Option Name="Version">1.0</Option>
|
||||||
|
<Option Name="GUID">{64926D16-EF8C-4EA7-9F80-C2B6F9BF6863}</Option>
|
||||||
|
</Option>
|
||||||
|
</PersonalityInfo>
|
||||||
|
<Delphi.Personality>
|
||||||
|
<Source>
|
||||||
|
<Source Name="MainSource">MainApplication.dpr</Source>
|
||||||
|
</Source>
|
||||||
|
<FileVersion>
|
||||||
|
<FileVersion Name="Version">7.0</FileVersion>
|
||||||
|
</FileVersion>
|
||||||
|
<Compiler>
|
||||||
|
<Compiler Name="A">8</Compiler>
|
||||||
|
<Compiler Name="B">0</Compiler>
|
||||||
|
<Compiler Name="C">1</Compiler>
|
||||||
|
<Compiler Name="D">1</Compiler>
|
||||||
|
<Compiler Name="E">0</Compiler>
|
||||||
|
<Compiler Name="F">0</Compiler>
|
||||||
|
<Compiler Name="G">1</Compiler>
|
||||||
|
<Compiler Name="H">1</Compiler>
|
||||||
|
<Compiler Name="I">1</Compiler>
|
||||||
|
<Compiler Name="J">0</Compiler>
|
||||||
|
<Compiler Name="K">0</Compiler>
|
||||||
|
<Compiler Name="L">1</Compiler>
|
||||||
|
<Compiler Name="M">0</Compiler>
|
||||||
|
<Compiler Name="N">1</Compiler>
|
||||||
|
<Compiler Name="O">1</Compiler>
|
||||||
|
<Compiler Name="P">1</Compiler>
|
||||||
|
<Compiler Name="Q">0</Compiler>
|
||||||
|
<Compiler Name="R">0</Compiler>
|
||||||
|
<Compiler Name="S">0</Compiler>
|
||||||
|
<Compiler Name="T">0</Compiler>
|
||||||
|
<Compiler Name="U">0</Compiler>
|
||||||
|
<Compiler Name="V">1</Compiler>
|
||||||
|
<Compiler Name="W">0</Compiler>
|
||||||
|
<Compiler Name="X">1</Compiler>
|
||||||
|
<Compiler Name="Y">1</Compiler>
|
||||||
|
<Compiler Name="Z">1</Compiler>
|
||||||
|
<Compiler Name="ShowHints">True</Compiler>
|
||||||
|
<Compiler Name="ShowWarnings">True</Compiler>
|
||||||
|
<Compiler Name="UnitAliases">WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;</Compiler>
|
||||||
|
<Compiler Name="NamespacePrefix"></Compiler>
|
||||||
|
<Compiler Name="GenerateDocumentation">False</Compiler>
|
||||||
|
<Compiler Name="DefaultNamespace"></Compiler>
|
||||||
|
<Compiler Name="SymbolDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="SymbolLibrary">True</Compiler>
|
||||||
|
<Compiler Name="SymbolPlatform">True</Compiler>
|
||||||
|
<Compiler Name="SymbolExperimental">True</Compiler>
|
||||||
|
<Compiler Name="UnitLibrary">True</Compiler>
|
||||||
|
<Compiler Name="UnitPlatform">True</Compiler>
|
||||||
|
<Compiler Name="UnitDeprecated">True</Compiler>
|
||||||
|
<Compiler Name="UnitExperimental">True</Compiler>
|
||||||
|
<Compiler Name="HResultCompat">True</Compiler>
|
||||||
|
<Compiler Name="HidingMember">True</Compiler>
|
||||||
|
<Compiler Name="HiddenVirtual">True</Compiler>
|
||||||
|
<Compiler Name="Garbage">True</Compiler>
|
||||||
|
<Compiler Name="BoundsError">True</Compiler>
|
||||||
|
<Compiler Name="ZeroNilCompat">True</Compiler>
|
||||||
|
<Compiler Name="StringConstTruncated">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarVarPar">True</Compiler>
|
||||||
|
<Compiler Name="TypedConstVarPar">True</Compiler>
|
||||||
|
<Compiler Name="AsgToTypedConst">True</Compiler>
|
||||||
|
<Compiler Name="CaseLabelRange">True</Compiler>
|
||||||
|
<Compiler Name="ForVariable">True</Compiler>
|
||||||
|
<Compiler Name="ConstructingAbstract">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonFalse">True</Compiler>
|
||||||
|
<Compiler Name="ComparisonTrue">True</Compiler>
|
||||||
|
<Compiler Name="ComparingSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="CombiningSignedUnsigned">True</Compiler>
|
||||||
|
<Compiler Name="UnsupportedConstruct">True</Compiler>
|
||||||
|
<Compiler Name="FileOpen">True</Compiler>
|
||||||
|
<Compiler Name="FileOpenUnitSrc">True</Compiler>
|
||||||
|
<Compiler Name="BadGlobalSymbol">True</Compiler>
|
||||||
|
<Compiler Name="DuplicateConstructorDestructor">True</Compiler>
|
||||||
|
<Compiler Name="InvalidDirective">True</Compiler>
|
||||||
|
<Compiler Name="PackageNoLink">True</Compiler>
|
||||||
|
<Compiler Name="PackageThreadVar">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitImport">True</Compiler>
|
||||||
|
<Compiler Name="HPPEMITIgnored">True</Compiler>
|
||||||
|
<Compiler Name="NoRetVal">True</Compiler>
|
||||||
|
<Compiler Name="UseBeforeDef">True</Compiler>
|
||||||
|
<Compiler Name="ForLoopVarUndef">True</Compiler>
|
||||||
|
<Compiler Name="UnitNameMismatch">True</Compiler>
|
||||||
|
<Compiler Name="NoCFGFileFound">True</Compiler>
|
||||||
|
<Compiler Name="MessageDirective">True</Compiler>
|
||||||
|
<Compiler Name="ImplicitVariants">True</Compiler>
|
||||||
|
<Compiler Name="UnicodeToLocale">True</Compiler>
|
||||||
|
<Compiler Name="LocaleToUnicode">True</Compiler>
|
||||||
|
<Compiler Name="ImagebaseMultiple">True</Compiler>
|
||||||
|
<Compiler Name="SuspiciousTypecast">True</Compiler>
|
||||||
|
<Compiler Name="PrivatePropAccessor">True</Compiler>
|
||||||
|
<Compiler Name="UnsafeType">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCode">False</Compiler>
|
||||||
|
<Compiler Name="UnsafeCast">False</Compiler>
|
||||||
|
<Compiler Name="OptionTruncated">True</Compiler>
|
||||||
|
<Compiler Name="WideCharReduced">True</Compiler>
|
||||||
|
<Compiler Name="DuplicatesIgnored">True</Compiler>
|
||||||
|
</Compiler>
|
||||||
|
<Linker>
|
||||||
|
<Linker Name="MapFile">0</Linker>
|
||||||
|
<Linker Name="OutputObjs">0</Linker>
|
||||||
|
<Linker Name="ConsoleApp">1</Linker>
|
||||||
|
<Linker Name="DebugInfo">False</Linker>
|
||||||
|
<Linker Name="RemoteSymbols">False</Linker>
|
||||||
|
<Linker Name="GenerateDRC">False</Linker>
|
||||||
|
<Linker Name="MinStackSize">16384</Linker>
|
||||||
|
<Linker Name="MaxStackSize">1048576</Linker>
|
||||||
|
<Linker Name="ImageBase">4194304</Linker>
|
||||||
|
<Linker Name="ExeDescription"></Linker>
|
||||||
|
</Linker>
|
||||||
|
<Directories>
|
||||||
|
<Directories Name="OutputDir"></Directories>
|
||||||
|
<Directories Name="UnitOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDLLOutputDir"></Directories>
|
||||||
|
<Directories Name="PackageDCPOutputDir"></Directories>
|
||||||
|
<Directories Name="SearchPath"></Directories>
|
||||||
|
<Directories Name="Packages"></Directories>
|
||||||
|
<Directories Name="Conditionals"></Directories>
|
||||||
|
<Directories Name="DebugSourceDirs"></Directories>
|
||||||
|
<Directories Name="UsePackages">False</Directories>
|
||||||
|
</Directories>
|
||||||
|
<Parameters>
|
||||||
|
<Parameters Name="RunParams"></Parameters>
|
||||||
|
<Parameters Name="HostApplication"></Parameters>
|
||||||
|
<Parameters Name="Launcher"></Parameters>
|
||||||
|
<Parameters Name="UseLauncher">False</Parameters>
|
||||||
|
<Parameters Name="DebugCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteHost"></Parameters>
|
||||||
|
<Parameters Name="RemotePath"></Parameters>
|
||||||
|
<Parameters Name="RemoteLauncher"></Parameters>
|
||||||
|
<Parameters Name="RemoteCWD"></Parameters>
|
||||||
|
<Parameters Name="RemoteDebug">False</Parameters>
|
||||||
|
</Parameters>
|
||||||
|
<Language>
|
||||||
|
<Language Name="ActiveLang"></Language>
|
||||||
|
<Language Name="ProjectLang">$00000000</Language>
|
||||||
|
<Language Name="RootDir"></Language>
|
||||||
|
</Language>
|
||||||
|
<VersionInfo>
|
||||||
|
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||||
|
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||||
|
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||||
|
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Release">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Build">0</VersionInfo>
|
||||||
|
<VersionInfo Name="Debug">False</VersionInfo>
|
||||||
|
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Special">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Private">False</VersionInfo>
|
||||||
|
<VersionInfo Name="DLL">False</VersionInfo>
|
||||||
|
<VersionInfo Name="Locale">1049</VersionInfo>
|
||||||
|
<VersionInfo Name="CodePage">1251</VersionInfo>
|
||||||
|
</VersionInfo>
|
||||||
|
<VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||||
|
</VersionInfoKeys>
|
||||||
|
</Delphi.Personality>
|
||||||
|
</BorlandProject>
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
program MainApplication;
|
||||||
|
|
||||||
|
uses
|
||||||
|
Forms,
|
||||||
|
MainAppFrm in 'MainAppFrm.pas' {Form1};
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TForm1, Form1);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user