1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2024-11-24 08:02:12 +02:00

Version 1.0 DEV 1.17a

Signed-off-by: dennis07 <den.goehlert@t-online.de>
This commit is contained in:
dennis07 2017-11-04 20:43:43 +01:00
parent 3add381cd9
commit 531d96e914
34 changed files with 1300 additions and 43 deletions

Binary file not shown.

View File

@ -86,7 +86,7 @@ end;
procedure TfmMain.FormCreate(Sender: TObject);
begin
StatusBar.SimpleText := 'Built with ' + DelphiManager.Info.VersionFullName + ' "' + DelphiManager.Info.VersionCodeName + '" and Lina Components v' + FloatToStr(DelphiManager.Info.LinaVersion) + ' for ' + DelphiManager.Info.LocalPlatformFullName;
StatusBar.SimpleText := 'Built with ' + DelphiManager.Info.VersionFullName + ' "' + DelphiManager.Info.VersionCodeName + '" and Lina Components v' + FloatToStr(DelphiManager.Info.LinaVersion) + ' for ' + DelphiManager.Info.PlatformFullName;
btRefresh.Click;
end;

View File

@ -0,0 +1,17 @@
program pExample;
uses
Vcl.Forms,
uMain in 'uMain.pas' {fmMain},
uValue in 'uValue.pas' {fmValue};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.Title := 'Example';
Application.CreateForm(TfmMain, fmMain);
Application.CreateForm(TfmValue, fmValue);
Application.Run;
end.

View File

@ -0,0 +1,180 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D28E4737-637C-4A11-9D4B-624FB1C78C89}</ProjectGuid>
<ProjectVersion>15.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>pExample.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>frxDB19;FireDACASADriver;FireDACSqliteDriver;bindcompfmx;DBXSqliteDriver;AbbreviaVCL;vcldbx;FireDACPgDriver;FireDACODBCDriver;VampyreImagingPackage.D2009;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;FireDACCommon;bindcomp;frx19;TeeDB;vclib;inetdbbde;DBXInterBaseDriver;GR32_DSGN_RSXE5;DataSnapCommon;MiscrosoftScriptControls;pkCindyDERDXE5;Tee;vclFireDAC;xmlrtl;svnui;ibxpress;DbxCommonDriver;SVATimer_DXE5;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;PieLib;FireDACCommonDriver;MetropolisUILiveTile;djsonrt;bindengine;vclactnband;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;pkCindyPackDXE5;TeeUI;FMXTee;vclie;pkCindyIEDXE5;vclshlctrls;fmxFireDAC;FireDACADSDriver;vcltouch;pkCindyDBCtrlsPackDXE5;pkCindyDBXDXE5;LINA_D_XE5;CustomIPTransport;SynEdit_RXE5;vclribbon;VclSmp;FireDAC;dsnap;IndyIPServer;Intraweb;fmxase;vcl;IndyCore;VCLRESTComponents;GR32_RSXE5;IndyIPCommon;CloudService;CodeSiteExpressPkg;dsnapcon;FireDACIBDriver;DebenuPDFLibraryLite;inet;FmxTeeUI;fmxobj;DCEF_XE5;FireDACMySQLDriver;vclx;inetdbxpress;webdsnap;svn;fmxdae;frxe19;RESTComponents;bdertl;FireDACMSAccDriver;adortl;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>FireDACASADriver;FireDACSqliteDriver;bindcompfmx;DBXSqliteDriver;AbbreviaVCL;FireDACPgDriver;FireDACODBCDriver;fmx;rtl;dbrtl;DbxClientDriver;IndySystem;FireDACCommon;bindcomp;vclib;DBXInterBaseDriver;DataSnapCommon;vclFireDAC;xmlrtl;ibxpress;DbxCommonDriver;vclimg;IndyProtocols;dbxcds;DBXMySQLDriver;FireDACCommonDriver;MetropolisUILiveTile;bindengine;vclactnband;vcldb;soaprtl;bindcompdbx;vcldsnap;bindcompvcl;vclie;vclshlctrls;fmxFireDAC;FireDACADSDriver;vcltouch;LINA_D_XE5;CustomIPTransport;SynEdit_RXE5;vclribbon;VclSmp;FireDAC;dsnap;IndyIPServer;Intraweb;fmxase;vcl;IndyCore;VCLRESTComponents;IndyIPCommon;CloudService;dsnapcon;FireDACIBDriver;inet;fmxobj;FireDACMySQLDriver;vclx;inetdbxpress;webdsnap;fmxdae;RESTComponents;FireDACMSAccDriver;adortl;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="uMain.pas">
<Form>fmMain</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="uValue.pas">
<Form>fmValue</Form>
<FormType>dfm</FormType>
</DCCReference>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<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">1031</VersionInfo>
<VersionInfo Name="CodePage">1252</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 Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
<VersionInfoKeys Name="package"/>
<VersionInfoKeys Name="label"/>
<VersionInfoKeys Name="versionCode"/>
<VersionInfoKeys Name="versionName"/>
<VersionInfoKeys Name="persistent"/>
<VersionInfoKeys Name="restoreAnyVersion"/>
<VersionInfoKeys Name="installLocation"/>
<VersionInfoKeys Name="largeHeap"/>
<VersionInfoKeys Name="theme"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">pExample.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k190.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp190.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment/>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>2017.11.04 00:30:22.940,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\Unit1.pas</Transaction>
<Transaction>2017.11.04 00:39:46.505,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\uValue.dfm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\Unit1.dfm</Transaction>
<Transaction>2017.11.04 00:39:46.505,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\uValue.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\Unit1.pas</Transaction>
</Transactions>
</BorlandProject>

Binary file not shown.

Binary file not shown.

Binary file not shown.

172
Example/TDiagram/uMain.dfm Normal file
View File

@ -0,0 +1,172 @@
object fmMain: TfmMain
Left = 0
Top = 0
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle
Caption = 'LinaComponents "TDiagram" Example'
ClientHeight = 371
ClientWidth = 594
Color = clBtnFace
Constraints.MinHeight = 400
Constraints.MinWidth = 600
DoubleBuffered = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
Padding.Left = 8
Padding.Top = 8
Padding.Right = 8
Padding.Bottom = 8
Menu = MainMenu
OldCreateOrder = False
Position = poScreenCenter
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Diagram: TDiagram
Left = 8
Top = 8
Width = 578
Height = 355
Align = alClient
Caption.Font.Charset = DEFAULT_CHARSET
Caption.Font.Color = clSilver
Caption.Font.Height = -16
Caption.Font.Name = 'Tahoma'
Caption.Font.Style = []
Values = <>
Padding.Top = 20
Padding.Bottom = 20
Padding.Left = 10
Padding.Right = 10
Scale.Values.Font.Charset = DEFAULT_CHARSET
Scale.Values.Font.Color = clNone
Scale.Values.Font.Height = -11
Scale.Values.Font.Name = 'Tahoma'
Scale.Values.Font.Style = []
TrendLine.Width = 0
ExplicitLeft = -248
ExplicitTop = 32
end
object MainMenu: TMainMenu
Left = 552
Top = 8
object miFile: TMenuItem
Caption = 'File'
OnClick = miFileClick
object miFileNew: TMenuItem
Caption = 'New'
ShortCut = 16462
OnClick = miFileNewClick
end
object miFileOpen: TMenuItem
Caption = 'Open...'
ShortCut = 16463
OnClick = miFileOpenClick
end
object miFileSave: TMenuItem
Caption = 'Save'
ShortCut = 16467
OnClick = miFileSaveClick
end
object miFileSaveAs: TMenuItem
Caption = 'Save as...'
OnClick = miFileSaveAsClick
end
object miFileClose: TMenuItem
Caption = 'Close'
ShortCut = 16472
OnClick = miFileCloseClick
end
end
object miValues: TMenuItem
Caption = 'Values'
OnClick = miValuesClick
object miValuesValues: TMenuItem
Caption = 'Values'
SubMenuImages = ImageList
end
object miValuesAdd: TMenuItem
Caption = 'Add...'
ShortCut = 16449
OnClick = miValuesAddClick
end
object miValuesImport: TMenuItem
Caption = 'Import...'
ShortCut = 16457
OnClick = miValuesImportClick
end
object miValuesExport: TMenuItem
Caption = 'Export...'
ShortCut = 16453
OnClick = miValuesExportClick
end
end
object miView: TMenuItem
Caption = 'View'
OnClick = miViewClick
object miColor: TMenuItem
Caption = 'Background color...'
ShortCut = 16450
OnClick = miColorClick
end
object miViewGrid: TMenuItem
Caption = 'Grid lines'
OnClick = miViewGridClick
end
object miViewBars: TMenuItem
Caption = 'Bars'
OnClick = miViewBarsClick
end
object miViewArtLines: TMenuItem
Caption = 'Artificial lines'
OnClick = miViewArtLinesClick
end
object miViewValues: TMenuItem
Caption = 'Value numbers'
OnClick = miViewValuesClick
end
end
object miTools: TMenuItem
Caption = 'Tools'
OnClick = miToolsClick
object miToolsCaption: TMenuItem
Caption = 'Caption...'
OnClick = miToolsCaptionClick
end
object miToolsTrendLine: TMenuItem
Caption = 'Trend line'
ShortCut = 16468
OnClick = miToolsTrendLineClick
end
end
object miInfo: TMenuItem
Caption = 'Info'
object miInfoAbout: TMenuItem
Caption = 'About...'
ShortCut = 112
OnClick = miInfoAboutClick
end
end
end
object OpenDialog: TOpenDialog
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
Left = 496
Top = 8
end
object SaveDialog: TSaveDialog
Left = 432
Top = 8
end
object ColorDialog: TColorDialog
Left = 368
Top = 8
end
object ImageList: TImageList
Masked = False
Left = 312
Top = 8
end
end

327
Example/TDiagram/uMain.pas Normal file
View File

@ -0,0 +1,327 @@
unit uMain;
//////////////////////////////////////
/// Lina File Tools Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}
interface
{ Dies ist ein Beispielprojekt, um den Umgang und die mögliche Verwendeng der
TDiagram-Komponente zu veranschaulichen.
Es darf als Grundlage für eingene Projekte ohne vorherige Einwilligung
verwendet werden, solange mindestens eine LinaComponents-Unit im Projekt
verarbeitet wird.
WICHTIG: Im Gegensatz zur Entwicklung der LinaComponents selbst wurde bei
diesem Beispielprojekt keinerlei Rücksicht auf Abwärtskompatibilität
genommen. Dieses Beispielprogramm wurde in Embarcadero Delphi XE5
erstellt, entwickelt und kompiliert und könnte bei älteren Delphi-
Versionen zu Kompilierungsfehlern führen. }
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uBase, Vcl.StdCtrls, uAdvCtrls,
Vcl.ExtCtrls, Vcl.Menus, uSysTools, uFrmCtrls, uValue, Vcl.ImgList;
type
TfmMain = class(TForm)
Diagram: TDiagram;
MainMenu: TMainMenu;
miFile: TMenuItem;
miValues: TMenuItem;
miView: TMenuItem;
miInfo: TMenuItem;
miFileNew: TMenuItem;
miFileOpen: TMenuItem;
miFileSave: TMenuItem;
miFileClose: TMenuItem;
miValuesValues: TMenuItem;
miValuesAdd: TMenuItem;
miValuesImport: TMenuItem;
miInfoAbout: TMenuItem;
miViewGrid: TMenuItem;
miViewBars: TMenuItem;
miViewArtLines: TMenuItem;
miViewValues: TMenuItem;
miTools: TMenuItem;
miToolsTrendLine: TMenuItem;
miFileSaveAs: TMenuItem;
miToolsCaption: TMenuItem;
miColor: TMenuItem;
OpenDialog: TOpenDialog;
SaveDialog: TSaveDialog;
miValuesExport: TMenuItem;
ColorDialog: TColorDialog;
ImageList: TImageList;
procedure miValuesValuesValueClick(Sender: TObject);
procedure miInfoAboutClick(Sender: TObject);
procedure miFileClick(Sender: TObject);
procedure miFileSaveClick(Sender: TObject);
procedure miFileSaveAsClick(Sender: TObject);
procedure miFileNewClick(Sender: TObject);
procedure miFileOpenClick(Sender: TObject);
procedure miToolsCaptionClick(Sender: TObject);
procedure miToolsTrendLineClick(Sender: TObject);
procedure miViewGridClick(Sender: TObject);
procedure miViewBarsClick(Sender: TObject);
procedure miColorClick(Sender: TObject);
procedure miViewArtLinesClick(Sender: TObject);
procedure miViewValuesClick(Sender: TObject);
procedure miValuesImportClick(Sender: TObject);
procedure miValuesExportClick(Sender: TObject);
procedure miFileCloseClick(Sender: TObject);
procedure miValuesClick(Sender: TObject);
procedure miValuesAddClick(Sender: TObject);
procedure miViewClick(Sender: TObject);
procedure miToolsClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private-Deklarationen }
Modified: Boolean;
FileName: String;
public
{ Public-Deklarationen }
procedure Load;
procedure Save;
end;
var
fmMain: TfmMain;
implementation
{$R *.dfm}
procedure TfmMain.FormShow(Sender: TObject);
begin
miFileNew.Click;
end;
procedure TfmMain.Load;
var
NewDiagram: TDiagram;
begin
if Length(FileName) = 0 then
begin
NewDiagram := TDiagram.Create(Self);
NewDiagram := TDiagram.Create(Self);
NewDiagram.Parent := Diagram.Parent;
NewDiagram.Align := Diagram.Align;
NewDiagram.Padding.Assign(Diagram.Padding);
Diagram.Free;
Diagram := NewDiagram;
end else
begin
ComponentLoadFromFile(FileName, Diagram);
end;
end;
procedure TfmMain.Save;
begin
ComponentSaveToFile(FileName, Diagram);
end;
procedure TfmMain.miColorClick(Sender: TObject);
begin
ColorDialog.Color := Diagram.Color;
if ColorDialog.Execute then
begin
Diagram.Color := ColorDialog.Color;
end;
end;
procedure TfmMain.miFileClick(Sender: TObject);
begin
if (not Modified) or (MessageDlg('There exist unsaved changes, are you sure you want to close?',mtWarning,mbYesNo,0) = mrYes) then
begin
Close;
end;
end;
procedure TfmMain.miFileCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfmMain.miFileNewClick(Sender: TObject);
begin
SetLength(FileName,0);
Load;
end;
procedure TfmMain.miFileOpenClick(Sender: TObject);
begin
OpenDialog.FileName := '';
OpenDialog.Title := 'Open diagram';
OpenDialog.DefaultExt := '.dgm';
OpenDialog.Filter := 'Diagram files (*.dgm)|*.dgm';
if OpenDialog.Execute then
begin
FileName := OpenDialog.FileName;
Load;
end;
end;
procedure TfmMain.miFileSaveAsClick(Sender: TObject);
begin
SaveDialog.FileName := '';
SaveDialog.Title := 'Save diagram';
SaveDialog.DefaultExt := '.dgm';
SaveDialog.Filter := 'Diagram files (*.dgm)|*.dgm';
if SaveDialog.Execute then
begin
FileName := SaveDialog.FileName;
miFileSave.Click;
end;
end;
procedure TfmMain.miFileSaveClick(Sender: TObject);
begin
if Length(FileName) = 0 then
begin
miFileSaveAs.Click;
end else
begin
Save;
end;
end;
procedure TfmMain.miValuesValuesValueClick(Sender: TObject);
var
BMP: TBitmap;
begin
fmValue.Data := (Diagram.Values.Items[miValuesValues.IndexOf(Sender as TMenuItem)] as TDiagramValue).Data;
if fmValue.ShowModal = mrOk then
begin
(Diagram.Values.Items[miValuesValues.IndexOf(Sender as TMenuItem)] as TDiagramValue).Data := fmValue.Data;
ImageList.Delete(miValuesValues.IndexOf(Sender as TMenuItem));
BMP := TBitmap.Create;
try
BMP.SetSize(ImageList.Width, ImageList.Height);
BMP.Canvas.Brush.Color := fmValue.Data.Color;
BMP.Canvas.FillRect(BmpRect(BMP));
ImageList.Insert(miValuesValues.IndexOf(Sender as TMenuItem), BMP, nil);
finally
BMP.Free;
end;
end;
end;
procedure TfmMain.miInfoAboutClick(Sender: TObject);
begin
Diagram.About.AboutDlg;
end;
procedure TfmMain.miToolsCaptionClick(Sender: TObject);
var
DiagramCaption: String;
begin
DiagramCaption := Diagram.Caption.Text;
if InputQuery('Diagram caption', 'Caption for this diagram:', DiagramCaption) then
begin
Diagram.Caption.Text := DiagramCaption;
end;
end;
procedure TfmMain.miToolsClick(Sender: TObject);
begin
miToolsTrendLine.Checked := Diagram.TrendLine.Visible;
end;
procedure TfmMain.miToolsTrendLineClick(Sender: TObject);
begin
Diagram.TrendLine.Visible := not Diagram.TrendLine.Visible;
end;
procedure TfmMain.miValuesAddClick(Sender: TObject);
var
BMP: TBitmap;
begin
fmValue.Data := Default(TDiagramValueData);
if fmValue.ShowModal = mrOk then
begin
(Diagram.Values.Add as TDiagramValue).Data := fmValue.Data; BMP := TBitmap.Create;
try
BMP.SetSize(ImageList.Width, ImageList.Height);
BMP.Canvas.Brush.Color := fmValue.Data.Color;
BMP.Canvas.FillRect(BmpRect(BMP));
ImageList.Add(BMP, nil);
finally
BMP.Free;
end;
end;
end;
procedure TfmMain.miValuesClick(Sender: TObject);
var
Index: Integer;
begin
miValuesValues.Clear;
for Index := 0 to Diagram.Values.Count - 1 do
begin
miValuesValues.Add(TMenuItem.Create(miValuesValues));
miValuesValues.Items[Index].Caption := (Diagram.Values.Items[Index] as TDiagramValue).Name + '...';
miValuesValues.Items[Index].OnClick := miValuesValuesValueClick;
miValuesValues.Items[Index].ImageIndex := Index;
end;
miValuesValues.Enabled := miValuesValues.Count <> 0;
end;
procedure TfmMain.miValuesExportClick(Sender: TObject);
begin
SaveDialog.FileName := '';
SaveDialog.Title := 'Export values';
SaveDialog.DefaultExt := '.dvd';
SaveDialog.Filter := 'Diagram value data files (*.dvd)|*.dvd';
if SaveDialog.Execute then
begin
Diagram.Values.SaveToFile(SaveDialog.FileName);
end;
end;
procedure TfmMain.miValuesImportClick(Sender: TObject);
begin
OpenDialog.FileName := '';
SaveDialog.Title := 'Import values';
OpenDialog.DefaultExt := '.dvd';
OpenDialog.Filter := 'Diagram value data files (*.dvd)|*.dvd';
if OpenDialog.Execute then
begin
Diagram.Values.ImportFromFile(OpenDialog.FileName);
end;
end;
procedure TfmMain.miViewArtLinesClick(Sender: TObject);
begin
Diagram.Scale.ArtLines.Cursor.Visible := not Diagram.Scale.ArtLines.Cursor.Visible;
end;
procedure TfmMain.miViewBarsClick(Sender: TObject);
begin
Diagram.Scale.Bar.Visible := not Diagram.Scale.Bar.Visible;
end;
procedure TfmMain.miViewClick(Sender: TObject);
begin
miViewGrid.Checked := Diagram.Scale.Grid.Visible;
miViewBars.Checked := Diagram.Scale.Bar.Visible;
miViewArtLines.Checked := Diagram.Scale.ArtLines.Cursor.Visible;
end;
procedure TfmMain.miViewGridClick(Sender: TObject);
begin
Diagram.Scale.Grid.Visible := not Diagram.Scale.Grid.Visible;
end;
procedure TfmMain.miViewValuesClick(Sender: TObject);
begin
Diagram.Scale.Values.Visible := not Diagram.Scale.Values.Visible;
end;
end.

View File

@ -1,4 +1,6 @@
These statistics cover the official repository of Lina Components.
Total lines of code (LoC): 13600+
Total lines of code (LoC): 18400+
Total visual components (VC): 22
Sample projects and other 3rd-party code are not included.

View File

@ -59,9 +59,7 @@ contains
uAdvCtrls in '..\..\Source\uAdvCtrls.pas',
uWebCtrls in '..\..\Source\uWebCtrls.pas',
uFileCtrls in '..\..\Source\uFileCtrls.pas',
{$IFDEF WIN32}
uInit in '..\..\Source\uInit.pas',
{$ENDIF}
uCalc in '..\..\Source\uCalc.pas';
end.

View File

@ -86,7 +86,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_AdditionalSwitches>-LUDesignIDE</DCC_AdditionalSwitches>
<DCC_DcuOutput>..\..\Source\Compiled\</DCC_DcuOutput>
<DCC_DcuOutput>..\..\Source\Compiled\Delphi_XE5</DCC_DcuOutput>
<VerInfo_Keys>CompanyName=Dennis Göhlert a.o.;FileDescription=Lina Components;FileVersion=1.0.0.0;InternalName=;LegalCopyright=2014;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
@ -204,7 +204,65 @@
<Source Name="MainSource">LINA_D_XE5.dpk</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bindengine190.bpl">Embarcadero LiveBindings-Laufzeit-Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bindcomp190.bpl">Komponenten für Datenbindungsausdrücke</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACPgDriver190.bpl">Embarcadero FireDAC PostgreSQL Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACCommonDriver190.bpl">Embarcadero FireDAC Common Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACCommon190.bpl">Embarcadero FireDAC - Allgemeine Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACASADriver190.bpl">Embarcadero FireDAC ASA Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACODBCDriver190.bpl">Embarcadero FireDAC ODBC Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACMSAccDriver190.bpl">Embarcadero FireDAC MS Access Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACIBDriver190.bpl">Embarcadero FireDAC IB Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACMySQLDriver190.bpl">Embarcadero FireDAC MySQL Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACSqliteDriver190.bpl">Embarcadero FireDAC Sqlite Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDACADSDriver190.bpl">Embarcadero FireDAC ADS Driver Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vclFireDAC190.bpl">Embarcadero FireDAC - VCL-Formularkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\FireDAC190.bpl">Embarcadero FireDAC-Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vcldb190.bpl">Embarcadero Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vcldsnap190.bpl">Embarcadero VCL-DataSnap-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\inetdbbde190.bpl">(Unbenannt)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\inetdb190.bpl">Embarcadero Internet/World Wide Web-Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bdertl190.bpl">Embarcadero BDE-Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\inetdbxpress190.bpl">(Unbenannt)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\DBXInterBaseDriver190.bpl">Embarcadero InterBase Client</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dbxcds190.bpl">Embarcadero SimpleDataSet-Komponente (DBX)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndyCore190.bpl">Indy 10 Core</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndySystem190.bpl">Indy 10-System</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndyProtocols190.bpl">Indy 10-Protokolle</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\adortl190.bpl">Embarcadero ADO-Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\fmxFireDAC190.bpl">Embarcadero FireDAC FMX Forms Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\fmxobj190.bpl">Embarcadero FMX OBJ Import Library</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\fmxdae190.bpl">Embarcadero FMX DAE Import Library</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\fmxase190.bpl">Embarcadero FMX ASE Import Library</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\VclSmp190.bpl">Embarcadero Beispielkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\svnui190.bpl">Benutzerschnittstellencode für die Subversion-Integration</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\svn190.bpl">Subversion-Integration</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bindcompfmx190.bpl">Embarcadero LiveBindings-Komponenten FireMonkey</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bindcompvcl190.bpl">Embarcadero LiveBindings-Komponenten VCL</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\MetropolisUILiveTile190.bpl">Embarcadero Metropolis-UI Komponentenbibliothek für Live-Kacheln</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vcltouch190.bpl">Embarcadero Touch VCL-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vclib190.bpl">Embarcadero InterBase Express VCL-Steuerelemente</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\ibxpress190.bpl">Embarcadero InterBase Express-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vclribbon190.bpl">Embarcadero Ribbon-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndyIPClient190.bpl">Embarcadero IP Indy Client Implementation</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndyIPCommon190.bpl">Embarcadero IP Indy Common Implementation</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\IndyIPServer190.bpl">Embarcadero IP Indy Server Implementation</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\VCLRESTComponents190.bpl">Embarcadero REST Client Components VCL</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\RESTComponents190.bpl">Embarcadero REST-Client-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bindcompdbx190.bpl">Data Binding Expression Components DBExpress</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\CloudService190.bpl">Embarcadero Cloud-Komponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dsnapcon190.bpl">Embarcadero DataSnap-Verbindungskomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\Intraweb_140_190.bpl">IntraWeb 14.0 Runtime Package for RAD Studio XE3</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vcldbx190.bpl">Embarcadero Kompatibilitäts-Datenbankkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\webdsnap190.bpl">Embarcadero InternetExpress Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\office2K190.bpl">(Unbenannt)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k190.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\DBXSqliteDriver190.bpl">Embarcadero Sqlite-Client</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\DBXMySQLDriver190.bpl">Embarcadero MySQL Client</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\vclshlctrls190.bpl">Win32 Shell Steuerelemente</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDBXDrivers190.bpl">Embarcadero Treiberkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclDBXDriversInt190.bpl">Embarcadero Intro-Treiberkomponenten</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\DataExplorerDBXPlugin190.bpl">DBExpress Daten-Explorer-Integration</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp190.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>

View File

@ -8,7 +8,7 @@
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc=</Transaction>
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc</Transaction>
@ -24,7 +24,7 @@
<Transaction>1899.12.30 00:00:00.000.537,C:\Users\Dennis G\Documents\CodeQuality.htm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.143,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm</Transaction>
<Transaction>1899.12.30 00:00:00.000.896,C:\Users\Dennis G\Documents\CodeQuality.htm=</Transaction>
<Transaction>1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.971,=IndySystem.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas</Transaction>
@ -39,9 +39,9 @@
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.173,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uInit.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.045,=IndyProtocols.dcp</Transaction>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -81,8 +81,8 @@ begin
{$ELSE}
{ TaskMessageDlg, falls der Compiler Vista-Dialoge unterstützt }
TaskMessageDlg(
{$ENDIF}
About_Title,
{$ENDIF}
{ ---------------------------------- }
Name + ' v'
+ Version + sLineBreak

View File

@ -482,7 +482,7 @@ type
property Axis: Integer read FAxis write SetAxis default 0;
end;
TDiagramValueData = record
TDiagramValueData = packed record
Name: ShortString;
Color: TColor;
Value: Integer;
@ -549,6 +549,7 @@ type
constructor Create(ADiagram: TDiagram);
destructor Destroy; override;
function AddData(Data: TDiagramValueData): TDiagramValue;
function FindItem(const Name: String): TDiagramValue;
procedure ImportFromFile(const FileName: String);
procedure ExportToFile(const FileName: String);
procedure LoadFromFile(const FileName: String);
@ -823,7 +824,6 @@ type
FPadding: TDiagramPadding;
FScale: TDiagramScale;
FAutoColors: TDiagramAutoColors;
FAlignment: TAlignment;
FTrendLine: TDiagramTrendLine;
{ Ereignisse }
FDrawValueEvent: TDiagramDrawValueEvent;
@ -926,7 +926,7 @@ type
function StringFromParams(Idents,Values: TStrings; Format: TParamFormat): String;
{ Sonstige }
procedure SetTaskBarVisibe(const Value: Boolean);
procedure ListParams(var OutList: TStrings);
procedure ListParams(out List: TStrings);
{$IFDEF ADD_COMPONENTREG}
procedure Register;
@ -971,7 +971,7 @@ begin
raise EInvalidParamChar.Create('Invalid character at position: ' + IntToStr(Index));
end;
end;
if RequireQuotes = True then
if RequireQuotes then
begin
Result := '"' + TmpStr + '"';
end else
@ -984,7 +984,7 @@ function StringFromParamRef(ParamRef: TParamReference; UseDefVal: Boolean = True
var
Value: String;
begin
if UseDefVal = True then
if UseDefVal then
begin
Value := ParamRef.DefaultValue;
end else
@ -1013,7 +1013,7 @@ end;
procedure SetTaskBarVisibe(const Value: Boolean);
begin
if Value = True then
if Value then
begin
ShowWindow(Application.Handle,SW_HIDE);
SetWindowLong(Application.Handle,GWL_EXSTYLE,GetWindowLong(Application.Handle,GWL_EXSTYLE) and not WS_EX_TOOLWINDOW or WS_EX_APPWINDOW);
@ -1026,14 +1026,20 @@ begin
end;
end;
procedure ListParams(var OutList: TStrings);
procedure ListParams(out List: TStrings);
var
Index: Integer;
begin
OutList.Clear;
for Index := 0 to ParamCount do
if Assigned(List) then
begin
OutList.Add(ParamStr(Index));
List.Clear;
end else
begin
List := TStringList.Create;
end;
for Index := 1 to ParamCount do
begin
List.Add(ParamStr(Index));
end;
end;
@ -2605,6 +2611,21 @@ begin
(Add as TDiagramValue).Data := Data;
end;
function TDiagramValues.FindItem(const Name: String): TDiagramValue;
var
Index: Integer;
begin
for Index := 0 to Count - 1 do
begin
if (Items[Index] as TDiagramValue).Name = Name then
begin
Result := Items[Index] as TDiagramValue;
Exit;
end;
end;
Result := nil;
end;
procedure TDiagramValues.ImportFromFile(const FileName: String);
var
DataFile: file of TDiagramValueData;
@ -2627,7 +2648,13 @@ var
Data: TDiagramValueData;
begin
AssignFile(DataFile,FileName);
if FileExists(FileName) then
begin
Reset(DataFile);
end else
begin
Rewrite(DataFile);
end;
for Index := 0 to Count - 1 do
begin
Data := (Items[Index] as TDiagramValue).Data;

View File

@ -31,7 +31,7 @@ type
TDelphiCompilerOptions = set of (dcmDebug,dcmConsole,dcmTypeInfo,dcmUnicode,dcmExtSyntax,dcmAssembler,dcmCondExpr);
TDelphiTargetPlatform = (dpWin32,dpWin64,dpOSX32,dpAndroid32,dpIOSDev,dpIOSSim,dpIOSDev32,dpIOSDev64);
TDelphiTargetPlatforms = set of TDelphiTargetPlatform;
TDelphiLocalPlatform = dpWin32..dpWin64;
TDelphiLocalPlatform = dpWin32..dpWin64; //Unterstützte Zielplattformen von TDelphiManager
TDelphiEdition = (dePersonal,deProfessional,deEnterprise,deUltimate,deArchitect);
TCryptMode = (cmCustom,cmXor,cmCaesar,cmVigenere);
@ -188,9 +188,9 @@ type
function GetProductVersion: Integer;
function GetPackageVersion: Integer;
function GetCompilerOptions: TDelphiCompilerOptions;
function GetLocalPlatform: TDelphiLocalPlatform;
function GetLocalPlatformName: String;
function GetLocalPlatformFullName: String;
function GetPlatform: TDelphiLocalPlatform;
function GetPlatformName: String;
function GetPlatformFullName: String;
public
{ Public-Deklarationen }
constructor Create(ADelphiManager: TDelphiManager);
@ -206,15 +206,53 @@ type
property ProductVersion: Integer read GetProductVersion;
property PackageVersion: Integer read GetPackageVersion;
property CompilerOptions: TDelphiCompilerOptions read GetCompilerOptions;
property LocalPlatform: TDelphiLocalPlatform read GetLocalPlatform;
property LocalPlatformName: String read GetLocalPlatformName;
property LocalPlatformFullName: String read GetLocalPlatformFullName;
property Platform: TDelphiLocalPlatform read GetPlatform;
property PlatformName: String read GetPlatformName;
property PlatformFullName: String read GetPlatformFullName;
end;
TDelphiManagerVersionPath = class(TCollectionItem)
private
{ Private-Deklarationen }
FName: String;
FPath: String;
protected
{ Protected-Deklarationen }
function GetDisplayName: String; override;
public
{ Public-Deklarationen }
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
property Name: String read FName write FName;
property Path: String read FName write FName;
end;
TDelphiManagerVersionPaths = TCollection;
TDelphiManagerVersionPackage = class(TCollectionItem)
private
{ Private-Deklarationen }
FFileName: String;
FDescription: String;
protected
{ Protected-Deklarationen }
function GetDisplayName: String; override;
public
{ Public-Deklarationen }
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
property FileName: String read FFileName write FFileName;
property Description: String read FDescription write FDescription;
end;
TDelphiManagerVersionPackages = TCollection;
TDelphiManagerVersion = class
private
{ Private-Deklarationen }
FVersion: TDelphiVersion;
FPackages: TDelphiManagerVersionPackages;
FIdePackages: TDelphiManagerVersionPackages;
{ Methoden }
function GetInstalled: Boolean;
function GetEdition: TDelphiEdition;
@ -246,6 +284,8 @@ type
property TargetPlatforms: TDelphiTargetPlatforms read GetTargetPlatforms;
property BrowsingPaths[TargetPlatform: TDelphiTargetPlatform]: TStrings read GetBrowsingPaths write SetBrowsingPaths;
property SearchPaths[TargetPlatform: TDelphiTargetPlatform]: TStrings read GetSearchPaths write SetBrowsingPaths;
property Packages: TDelphiManagerVersionPackages read FPackages;
property IdePackages: TDelphiManagerVersionPackages read FIdePackages;
property EnvironmentVariables: TStrings read GetEnvironmentVariables;
property EnvironmentVariable[Variable: String]: String read GetEnvironmentVariable;
procedure Launch;
@ -345,6 +385,7 @@ type
function PackageVersionToProductVersion(const PackageVersion: Integer): Integer;
function TargetPlatformToName(const TargetPlatform: TDelphiTargetPlatform): String;
function TargetPlatformToFullName(const TargetPlatform: TDelphiTargetPlatform): String;
function DelphiVersionReleaseDate(const DelphiVersion: TDelphiVersion): TDate;
function ValidKey(Mode: TCryptMode; const Key: String): Boolean;
function GenerateKey(Mode: TCryptMode): String;
@ -493,6 +534,30 @@ begin
Result := TargetPlatformNames[TargetPlatform];
end;
function DelphiVersionReleaseDate(const DelphiVersion: TDelphiVersion): TDate;
const
ReleaseDates: array [TDelphiVersion] of TDate = (37477, //09.08.2002 (Delphi 7)
38272, //12.10.2004 (Delphi 2005)
38679, //23.11.2005 (Delphi 2006)
39157, //16.03.2007 (Delphi 2007)
39685, //25.08.2008 (Delphi 2009)
40040, //15.08.2009 (Delphi 2010)
40420, //30.08.2010 (Delphi XE)
40788, //02.09.2011 (Delphi XE2)
41155, //03.09.2012 (Delphi XE3)
41386, //22.04.2013 (Delphi XE4)
41528, //11.09.2013 (Delphi XE5)
41744, //15.04.2014 (Delphi XE6)
41884, //02.09.2014 (Delphi XE7)
42101, //07.04.2015 (Delphi XE8)
42247, //31.08.2015 (Delphi 10)
42480, //20.04.2016 (Delphi 10.1)
42816 //22.03.2017 (Delphi 10.2)
);
begin
Result := ReleaseDates[DelphiVersion];
end;
function ValidKey(Mode: TCryptMode; const Key: String): Boolean;
begin
if Length(Key) <> 0 then
@ -1253,7 +1318,7 @@ begin
;
end;
function TDelphiManagerInfo.GetLocalPlatform: TDelphiLocalPlatform;
function TDelphiManagerInfo.GetPlatform: TDelphiLocalPlatform;
begin
{$IFDEF WIN32}
Result := dpWin32;
@ -1263,14 +1328,58 @@ begin
{$ENDIF}
end;
function TDelphiManagerInfo.GetLocalPlatformName: String;
function TDelphiManagerInfo.GetPlatformName: String;
begin
Result := TargetPlatformToName(LocalPlatform);
Result := TargetPlatformToName(Platform);
end;
function TDelphiManagerInfo.GetLocalPlatformFullName: String;
function TDelphiManagerInfo.GetPlatformFullName: String;
begin
Result := TargetPlatformToFullName(LocalPlatform);
Result := TargetPlatformToFullName(Platform);
end;
{ ----------------------------------------------------------------------------
TDelphiManagerVersionPath
---------------------------------------------------------------------------- }
constructor TDelphiManagerVersionPath.Create(Collection: TCollection);
begin
inherited;
//...
end;
destructor TDelphiManagerVersionPath.Destroy;
begin
//...
inherited;
end;
function TDelphiManagerVersionPath.GetDisplayName: String;
begin
inherited;
Result := Name;
end;
{ ----------------------------------------------------------------------------
TDelphiManagerVersionPackage
---------------------------------------------------------------------------- }
constructor TDelphiManagerVersionPackage.Create(Collection: TCollection);
begin
inherited;
//...
end;
destructor TDelphiManagerVersionPackage.Destroy;
begin
//...
inherited;
end;
function TDelphiManagerVersionPackage.GetDisplayName: String;
begin
inherited;
Result := ExtractFileName(FileName);
end;
{ ----------------------------------------------------------------------------
@ -1281,11 +1390,14 @@ constructor TDelphiManagerVersion.Create(AVersion: TDelphiVersion);
begin
inherited Create;
FVersion := AVersion;
FPackages := TDelphiManagerVersionPackages.Create(TDelphiManagerVersionPackage);
FIdePackages := TDelphiManagerVersionPackages.Create(TDelphiManagerVersionPackage);
end;
destructor TDelphiManagerVersion.Destroy;
begin
//...
FPackages.Free;
FIdePackages.Free;
inherited;
end;

View File

@ -35,6 +35,8 @@ type
TVerticalAlignment = (taAlignTop, taAlignBottom, taVerticalCenter);
{$ENDIF}
TBit = 0..1;
{$IFNDEF NO_GENERIC}
TVariantList = TList<Variant>;
TIntegerList = TList<Integer>;
@ -42,6 +44,7 @@ type
TFloatList = TList<Extended>;
TPointList = TList<TPoint>;
{$ENDIF}
{ Typisierte Arrays }
TPointerArray = array of Pointer;
TPCharArray = array of PChar;
@ -88,6 +91,8 @@ type
TPointArray = array of TPoint;
TByte = array [0..7] of TBit;
TReferenceData = record
Value: Pointer;
Reference: PPointer;
@ -184,6 +189,11 @@ type
TRGBTripleArray = array [Word] of TRGBTriple;
PRGBTripleArray = ^TRGBTripleArray;
TLonelyPointer = array [0..0] of Pointer;
TLonelyVariant = array [0..0] of Variant;
TLonelyChar = array [0..0] of Char;
TLonelyString = array [0..0] of String;
TLonelyShortString = array [0..0] of ShortString;
TLonelyByte = array [0..0] of Byte;
TLonelyWord = array [0..0] of Word;
TLonelyCardinal = array [0..0] of Cardinal;
@ -196,6 +206,23 @@ type
TLonelyDouble = array [0..0] of Double;
TLonelyExtended = array [0..0] of Extended;
TPointerPair = array [0..1] of Pointer;
TVariantPair = array [0..1] of Variant;
TCharPair = array [0..1] of Char;
TStringPair = array [0..1] of String;
TShortStringPair = array [0..1] of ShortString;
TBytePair = array [0..1] of Byte;
TWordPair = array [0..1] of Word;
TCardinalPair = array [0..1] of Cardinal;
TUInt64Pair = array [0..1] of UInt64;
TShortIntPair = array [0..1] of ShortInt;
TSmallIntPair = array [0..1] of SmallInt;
TIntegerPair = array [0..1] of Integer;
TInt64Pair = array [0..1] of Int64;
TSinglePair = array [0..1] of Extended;
TDoublePair = array [0..1] of Double;
TExtendedPair = array [0..1] of Extended;
TLine = class
private
{ Private-Deklarationen }
@ -507,6 +534,8 @@ type
function SetToArray(Elements: TCharSet): TCharArray; overload;
function ArrayToSet(Elements: array of Byte): TByteSet; overload;
function ArrayToSet(Elements: array of Char): TCharSet; overload;
function SetToBools(Elements: TByteSet): TBooleanArray; overload;
function SetToBools(Elements: TCharSet): TBooleanArray; overload;
{ Primzahlen-Bestimmung }
function Prime(X: ShortInt): Boolean; overload;
function Prime(X: Byte): Boolean; overload;
@ -541,6 +570,7 @@ type
function ComponentByTag(Owner: TComponent; const Tag: Integer): TComponent;
function ControlIndex(Control: TControl): Integer;
function IntToStrMinLength(Value: Integer; MinLength: SmallInt): String;
function BmpRect(Bitmap: TBitmap): TRect;
function MultiPos(const SubStr, Str: ShortString; Offset: Integer = 1): TIntegerArray; overload;
function MultiPos(const SubStr, Str: String; Offset: Integer = 1): TIntegerArray; overload;
function CharLine(Current: PAnsiChar; Text: AnsiString): Integer; {$IFNDEF NO_UNICODE} overload;
@ -566,7 +596,7 @@ const
Numbers = ['0'..'9'];
UpperCaseLetters = ['A'..'Z'];
LowerCaseLetters = ['a'..'z'];
Letters = UpperCaseLetters + LowerCaseLetters;
Letters = UpperCaseLetters + LowerCaseLetters + ['_'];
Operators = ['+','-','*','/'];
{ WinAPI-Privilegien }
SE_ASSIGNPRIMARYTOKEN_NAME = 'SeAssignPrimaryTokenPrivilege';
@ -1929,6 +1959,28 @@ begin
end;
end;
function SetToBools(Elements: TByteSet): TBooleanArray;
var
Index: Integer;
begin
SetLength(Result,SizeOf(TByteSet) * 8);
for Index := Low(Result) to High(Result) do
begin
Result[Index] := Index in Elements;
end;
end;
function SetToBools(Elements: TCharSet): TBooleanArray;
var
Index: Integer;
begin
SetLength(Result,SizeOf(TCharSet) * 8);
for Index := Low(Result) to High(Result) do
begin
Result[Index] := Chr(Index) in Elements;
end;
end;
function Prime(X: ShortInt): Boolean;
begin
Result := Prime(Byte(Abs(X)));
@ -1986,7 +2038,7 @@ end;
function Distance(A,B: TPoint): Cardinal;
begin
Result := Round(Hypot(B.X - A.X,B.Y - A.Y));
end;
function Congruent(A,B,Divisor: Integer): Boolean;
@ -3075,6 +3127,11 @@ begin
end;
end;
function BmpRect(Bitmap: TBitmap): TRect;
begin
Result := Rect(0,0,Bitmap.Width,Bitmap.Height);
end;
function MultiPos(const SubStr, Str: ShortString; Offset: Integer = 1): TIntegerArray;
begin
@ -3679,7 +3736,7 @@ end;
constructor TCicle.Create(ACenter,ABorder: TPoint);
begin
//Create(ACenter,);
Create(ACenter,Distance(ACenter,ABorder));
end;
destructor TCicle.Destroy;
@ -3710,12 +3767,12 @@ end;
function TCicle.Contains(Point: TPoint): Boolean;
begin
Result := Distance(Center,Point) <= Radius;
end;
function TCicle.Contains(Cicle: TCicle): Boolean;
begin
Result := Radius >= Distance(Center,Cicle.Center) + Cicle.Radius;
end;
function TCicle.Intersection(Line: TLine): TPoint;
@ -3735,7 +3792,7 @@ end;
function TCicle.Intersects(Cicle: TCicle): Boolean;
begin
Result := Distance(Center,Cicle.Center) <= Radius + Cicle.Radius;
end;
function TCicle.Equals(Cicle: TCicle): Boolean;

View File

@ -12,7 +12,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes,
SysUtils, Classes, UITypes,
{ Indy-Units }
idHTTP, idSSLOpenSSL, idComponent,
{ Andere Package-Units }
@ -23,6 +23,10 @@ type
EInvalidWebAddress = class(Exception);
EInvalidTagChar = class(Exception);
EHtmlParse = class(Exception);
ECssParse = class(Exception);
{ Hilfsklassen }
TCssDocumentRuleKind = (cssNone,cssTag,cssClass,cssID);
{ Ereignisse }
TDownloadWorkEvent = procedure(Sender: TObject; AWorkMode: TWorkMode) of object;
@ -115,6 +119,7 @@ type
constructor Create(const AName: String; ADocument: THtmlDocument; AParent: THtmlDocumentTag; ALines: TStrings); overload;
destructor Destroy; override;
function FindTag(const Id: Integer): THtmlDocumentTag;
function ParamValue(const Name: String): String;
function IsParent(Tag: THtmlDocumentTag): Boolean;
function GetPath(const Separator: Char = '.'): String;
{ Eigenschaften }
@ -170,9 +175,73 @@ type
property Text: String read FText;
end;
TCssDocumentRuleProperty = record
Name: String;
Value: String;
end;
TCssDocument = class;
TCssDocumentRule = class
private
{ Private-Deklarationen }
FName: String;
FIndex: Integer;
FDocument: TCssDocument;
FLines: TStrings;
FProperties: array of TCssDocumentRuleProperty;
FKind: TCssDocumentRuleKind;
{ Methoden }
function GetProperties(Index: Integer): TCssDocumentRuleProperty;
function GetPropertyCount: Integer;
procedure LinesChange(Sender: TObject);
public
{ Public-Deklarationen }
constructor Create(const AName: String; ADocument: TCssDocument); overload;
constructor Create(const AName: String; ADocument: TCssDocument; ALines: TStrings); overload;
destructor Destroy; override;
function PropertyValue(const Name: String): String;
{ Eigenschaften }
property Name: String read FName;
property Index: Integer read FIndex;
property Document: TCssDocument read FDocument;
property Lines: TStrings read FLines;
property Properties[Index: Integer]: TCssDocumentRuleProperty read GetProperties;
property PropertyCount: Integer read GetPropertyCount;
property Kind: TCssDocumentRuleKind read FKind default cssNone;
end;
TCssDocument = class(TPersistent)
private
{ Private-Deklarationen }
FLines: TStrings;
FRules: array of TCssDocumentRule;
{ Methoden }
procedure SetLines(Value: TStrings);
function GetRules(Index: Integer): TCssDocumentRule;
function GetRuleCount: Integer;
procedure LinesChange(Sender: TObject);
public
{ Public-Deklarationen }
constructor Create; overload;
constructor Create(ALines: TStrings); overload;
destructor Destroy; override;
function FindRule(const Name: String): TCssDocumentRule;
{ Eigenschaften }
property Lines: TStrings read FLines write SetLines;
property Rules[Index: Integer]: TCssDocumentRule read GetRules;
property RuleCount: Integer read GetRuleCount;
end;
function ValidProtocol(const Protocol: String; const Protocols: array of String): Boolean;
function StrIsURL(const S: String): Boolean;
function GetTagParamValue(const S,Tag,Param: String): String;
function PxToPercent(const Px, Width: Integer): Integer;
function PercentToPx(const Percent, Width: Integer): Integer;
function ColorToHtml(const Color: TColor; ColorNames: Boolean): String;
function HtmlToColor(const Html: String): TColor;
function HtmlColorName(const Value: String): String;
function HtmlColorValue(const Name: String): String;
{$IFDEF ADD_COMPONENTREG}
procedure Register;
@ -188,6 +257,55 @@ const
WebProtocols: array [0..4] of String = (WP_HTTP,WP_HTTPS,WP_FTP,WP_CALL,WP_MAIL);
WebProtocolsSimple: array [0..1] of String = (WP_MAIL,WP_CALL);
WebProtocolsSpecial: array [0..2] of String = (WP_HTTP,WP_HTTPS,WP_FTP);
HtmlColorNames: array [0..139] of TStringPair = (
('#F0F8FF','aliceblue' ),('#FAEBD7','antiquewhite' ),('#00FFFF','aqua' ),
('#7FFFD4','aquamarine' ),('#F0FFFF','azure' ),('#F5F5DC','beige' ),
('#FFE4C4','bisque' ),('#000000','black' ),('#FFFFCD','blanchedalmond' ),
('#0000FF','blue' ),('#8A2BE2','blueviolet' ),('#A52A2A','brown' ),
('#DEB887','burlywood' ),('#5F9EA0','cadetblue' ),('#7FFF00','chartreuse' ),
('#D2691E','chocolate' ),('#FF7F50','coral' ),('#6495ED','cornflowerblue' ),
('#FFF8DC','cornsilk' ),('#DC143C','crimson' ),('#00FFFF','cyan' ),
('#00008B','darkblue' ),('#008B8B','darkcyan' ),('#B8860B','darkgoldenrod' ),
('#A9A9A9','darkgray' ),('#006400','darkgreen' ),('#BDB76B','darkkhaki' ),
('#8B008B','darkmagenta' ),('#556B2F','darkolivegreen' ),('#FF8C00','darkorange' ),
('#9932CC','darkorchid' ),('#8B0000','darkred' ),('#E9967A','darksalmon' ),
('#8FBC8F','darkseagreen' ),('#483D8B','darkslateblue' ),('#2F4F4F','darkslategray' ),
('#00CED1','darkturquoise' ),('#9400D3','darkviolet' ),('#FF1493','deeppink' ),
('#00BFFF','deepskyblue' ),('#696969','dimgray' ),('#1E90FF','dodgerblue' ),
('#B22222','firebrick' ),('#FFFAF0','floralwhite' ),('#228B22','forestgreen' ),
('#FF00FF','fuchsia' ),('#DCDCDC','gainsboro' ),('#F8F8FF','ghostwhite' ),
('#FFD700','gold' ),('#DAA520','goldenrod' ),('#808080','gray' ),
('#008000','green' ),('#ADFF2F','greenyellow' ),('#F0FFF0','honeydew' ),
('#FF69B4','hotpink' ),('#CD5C5C','indianred' ),('#4B0082','indigo' ),
('#FFF0F0','ivory' ),('#F0E68C','khaki' ),('#E6E6FA','lavender' ),
('#FFF0F5','lavenderblush' ),('#7CFC00','lawngreen' ),('#FFFACD','lemonchiffon' ),
('#ADD8E6','lightblue' ),('#F08080','lightcoral' ),('#E0FFFF','lightcyan' ),
('#FAFAD2','lightgoldenrodyellow'),('#90EE90','lightgreen' ),('#D3D3D3','lightgrey' ),
('#FFB6C1','lightpink' ),('#FFA07A','lightsalmon' ),('#20B2AA','lightseagreen' ),
('#87CEFA','lightskyblue' ),('#778899','lightslategray' ),('#B0C4DE','lightsteelblue' ),
('#FFFFE0','lightyellow' ),('#00FF00','lime' ),('#32CD32','limegreen' ),
('#FAF0E6','linen' ),('#FF00FF','magenta' ),('#800000','maroon' ),
('#66CDAA','mediumaquamarine' ),('#0000CD','mediumblue' ),('#BA55D3','mediumorchid' ),
('#9370DB','mediumpurple' ),('#3CB371','mediumseagreen' ),('#7B68EE','mediumslateblue'),
('#00FA9A','mediumspringgreen' ),('#48D1CC','mediumturquoise'),('#C71585','mediumvioletred'),
('#191970','midnightblue' ),('#F5FFFA','mintcream' ),('#FFE4E1','mistyrose' ),
('#FFE4B5','moccasin' ),('#FFDEAD','navajowhite' ),('#000080','navy' ),
('#FDF5E6','oldlace' ),('#808000','olive' ),('#6B8E23','olivedrab' ),
('#FFA500','orange' ),('#FF4500','orangered' ),('#DA70D6','orchid' ),
('#EEE8AA','palegoldenrod' ),('#98FB98','palegreen' ),('#AFEEEE','paleturquoise' ),
('#DB7093','palevioletred' ),('#FFEFD5','papayawhip' ),('#FFDBBD','peachpuff' ),
('#CD853F','peru' ),('#FFC0CB','pink' ),('#DDA0DD','plum' ),
('#B0E0E6','powderblue' ),('#800080','purple' ),('#FF0000','red' ),
('#BC8F8F','rosybrown' ),('#4169E1','royalblue' ),('#8B4513','saddlebrown' ),
('#FA8072','salmon' ),('#F4A460','sandybrown' ),('#2E8B57','seagreen' ),
('#FFF5EE','seashell' ),('#A0522D','sienna' ),('#C0C0C0','silver' ),
('#87CEEB','skyblue' ),('#6A5ACD','slateblue' ),('#708090','slategray' ),
('#FFFAFA','snow' ),('#00FF7F','springgreen' ),('#4682B4','steelblue' ),
('#D2B48C','tan' ),('#008080','teal' ),('#D8BFD8','thistle' ),
('#FD6347','tomato' ),('#40E0D0','turquoise' ),('#EE82EE','violet' ),
('#F5DEB3','wheat' ),('#FFFFFF','white' ),('#F5F5F5','whitesmoke' ),
('#FFFF00','yellow' ),('#9ACD32','yellowgreen' )
);
implementation
@ -412,6 +530,55 @@ begin
end;
end;
function PxToPercent(const Px, Width: Integer): Integer;
begin
Result := 100 * Px div Width; //Identisch mit 100 / (Width / Px), aber schneller
end;
function PercentToPx(const Percent, Width: Integer): Integer;
begin
Result := Percent div 100 * Width;
end;
function ColorToHtml(const Color: TColor; ColorNames: Boolean): String;
begin
//...
if ColorNames then
begin
Result := HtmlColorName(Result);
end;
end;
function HtmlToColor(const Html: String): TColor;
var
ColorValue: String;
begin
ColorValue := HtmlColorValue(Html);
end;
function HtmlColorName(const Value: String): String;
var
Index: Integer;
begin
for Index := Low(HtmlColorNames) to High(HtmlColorNames) do
begin
//...
end;
Result := Value;
end;
function HtmlColorValue(const Name: String): String;
var
Index: Integer;
begin
for Index := Low(HtmlColorNames) to High(HtmlColorNames) do
begin
//...
end;
Result := Name;
end;
{ ----------------------------------------------------------------------------
TDownload
---------------------------------------------------------------------------- }
@ -594,6 +761,21 @@ begin
Result := nil;
end;
function THtmlDocumentTag.ParamValue(const Name: String): String;
var
Index: Integer;
begin
for Index := 0 to ParamCount - 1 do
begin
if Params[Index].Name = Name then
begin
//Result := Params[Index];
Exit;
end;
end;
Result := '';
end;
function THtmlDocumentTag.IsParent(Tag: THtmlDocumentTag): Boolean;
var
Current: THtmlDocumentTag;
@ -1127,4 +1309,121 @@ begin
end;
end;
{ ----------------------------------------------------------------------------
TCssDocumentRule
---------------------------------------------------------------------------- }
constructor TCssDocumentRule.Create(const AName: String; ADocument: TCssDocument);
begin
inherited Create;
FName := AName;
FIndex := ADocument.RuleCount - 1;
FDocument := ADocument;
FLines := TStringList.Create;
(FLines as TStringList).OnChange := LinesChange;
FKind := cssNone;
end;
constructor TCssDocumentRule.Create(const AName: String; ADocument: TCssDocument; ALines: TStrings);
begin
Create(AName,ADocument);
FLines.Assign(ALines);
end;
destructor TCssDocumentRule.Destroy;
begin
FLines.Free;
inherited;
end;
function TCssDocumentRule.PropertyValue(const Name: String): String;
var
Index: Integer;
begin
for Index := 0 to PropertyCount - 1 do
begin
if Properties[Index].Name = Name then
begin
//Result := Properties[Index];
Exit;
end;
end;
Result := '';
end;
function TCssDocumentRule.GetProperties(Index: Integer): TCssDocumentRuleProperty;
begin
Result := FProperties[Index];
end;
function TCssDocumentRule.GetPropertyCount: Integer;
begin
Result := Length(FProperties);
end;
procedure TCssDocumentRule.LinesChange(Sender: TObject);
begin
end;
{ ----------------------------------------------------------------------------
TCssDocument
---------------------------------------------------------------------------- }
constructor TCssDocument.Create;
begin
inherited;
FLines := TStringList.Create;
(FLines as TStringList).OnChange := LinesChange;
end;
constructor TCssDocument.Create(ALines: TStrings);
begin
Create;
Lines := ALines;
end;
destructor TCssDocument.Destroy;
begin
FLines.Free;
inherited;
end;
function TCssDocument.FindRule(const Name: String): TCssDocumentRule;
var
Index: Integer;
begin
for Index := 0 to RuleCount - 1 do
begin
if Rules[Index].Name = Name then
begin
Result := Rules[Index];
Exit;
end;
end;
Result := nil;
end;
procedure TCssDocument.SetLines(Value: TStrings);
begin
FLines.Assign(Value);
end;
function TCssDocument.GetRules(Index: Integer): TCssDocumentRule;
begin
Result := FRules[Index];
end;
function TCssDocument.GetRuleCount: Integer;
begin
Result := Length(FRules);
end;
procedure TCssDocument.LinesChange(Sender: TObject);
var
Current: PChar;
begin
Current := PChar(Lines.Text);
end;
end.