diff --git a/Example/TDelphiManager/pExample.exe b/Example/TDelphiManager/pExample.exe index 8898838..51bfb16 100644 Binary files a/Example/TDelphiManager/pExample.exe and b/Example/TDelphiManager/pExample.exe differ diff --git a/Example/TDelphiManager/uMain.pas b/Example/TDelphiManager/uMain.pas index 1b0f548..1ec1fdc 100644 --- a/Example/TDelphiManager/uMain.pas +++ b/Example/TDelphiManager/uMain.pas @@ -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; diff --git a/Example/TDiagram/pExample.dpr b/Example/TDiagram/pExample.dpr new file mode 100644 index 0000000..871d497 --- /dev/null +++ b/Example/TDiagram/pExample.dpr @@ -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. diff --git a/Example/TDiagram/pExample.dproj b/Example/TDiagram/pExample.dproj new file mode 100644 index 0000000..fa1f125 --- /dev/null +++ b/Example/TDiagram/pExample.dproj @@ -0,0 +1,180 @@ + + + {D28E4737-637C-4A11-9D4B-624FB1C78C89} + 15.3 + VCL + pExample.dpr + True + Debug + Win32 + 1 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + $(BDS)\bin\delphi_PROJECTICON.ico + System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace) + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + + + $(BDS)\bin\default_app.manifest + 1033 + 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) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + true + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + + + 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) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + 1033 + true + false + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + + MainSource + + +
fmMain
+ dfm +
+ +
fmValue
+ dfm +
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + Delphi.Personality.12 + + + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1031 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + pExample.dpr + + + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + + + + + True + False + + + 12 + + + +
diff --git a/Example/TDiagram/pExample.dproj.local b/Example/TDiagram/pExample.dproj.local new file mode 100644 index 0000000..a8a455d --- /dev/null +++ b/Example/TDiagram/pExample.dproj.local @@ -0,0 +1,8 @@ + + + + 2017.11.04 00:30:22.940,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TDiagram\Unit1.pas + 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 + 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 + + diff --git a/Example/TDiagram/pExample.exe b/Example/TDiagram/pExample.exe new file mode 100644 index 0000000..0aa28fb Binary files /dev/null and b/Example/TDiagram/pExample.exe differ diff --git a/Example/TDiagram/pExample.identcache b/Example/TDiagram/pExample.identcache new file mode 100644 index 0000000..0577184 Binary files /dev/null and b/Example/TDiagram/pExample.identcache differ diff --git a/Example/TDiagram/pExample.res b/Example/TDiagram/pExample.res new file mode 100644 index 0000000..d6cf632 Binary files /dev/null and b/Example/TDiagram/pExample.res differ diff --git a/Example/TDiagram/uMain.dfm b/Example/TDiagram/uMain.dfm new file mode 100644 index 0000000..d9ac26a --- /dev/null +++ b/Example/TDiagram/uMain.dfm @@ -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 diff --git a/Example/TDiagram/uMain.pas b/Example/TDiagram/uMain.pas new file mode 100644 index 0000000..0903d39 --- /dev/null +++ b/Example/TDiagram/uMain.pas @@ -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. diff --git a/Information/Statistics.txt b/Information/Statistics.txt index e7f8528..c8c7d65 100644 --- a/Information/Statistics.txt +++ b/Information/Statistics.txt @@ -1,4 +1,6 @@ These statistics cover the official repository of Lina Components. -Total lines of code (LoC): 13600+ -Total visual components (VC): 22 \ No newline at end of file +Total lines of code (LoC): 18400+ +Total visual components (VC): 22 + +Sample projects and other 3rd-party code are not included. \ No newline at end of file diff --git a/Package/Delphi_XE5/LINA_D_XE5.dpk b/Package/Delphi_XE5/LINA_D_XE5.dpk index 00b4a7f..7e537cd 100644 --- a/Package/Delphi_XE5/LINA_D_XE5.dpk +++ b/Package/Delphi_XE5/LINA_D_XE5.dpk @@ -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} + uInit in '..\..\Source\uInit.pas', uCalc in '..\..\Source\uCalc.pas'; end. diff --git a/Package/Delphi_XE5/LINA_D_XE5.dproj b/Package/Delphi_XE5/LINA_D_XE5.dproj index d625629..18a1cf6 100644 --- a/Package/Delphi_XE5/LINA_D_XE5.dproj +++ b/Package/Delphi_XE5/LINA_D_XE5.dproj @@ -86,7 +86,7 @@ -LUDesignIDE - ..\..\Source\Compiled\ + ..\..\Source\Compiled\Delphi_XE5 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= 1033 true @@ -204,7 +204,65 @@ LINA_D_XE5.dpk + Embarcadero LiveBindings-Laufzeit-Package + Komponenten für Datenbindungsausdrücke + Embarcadero FireDAC PostgreSQL Driver Components + Embarcadero FireDAC Common Driver Components + Embarcadero FireDAC - Allgemeine Komponenten + Embarcadero FireDAC ASA Driver Components + Embarcadero FireDAC ODBC Driver Components + Embarcadero FireDAC MS Access Driver Components + Embarcadero FireDAC IB Driver Components + Embarcadero FireDAC MySQL Driver Components + Embarcadero FireDAC Sqlite Driver Components + Embarcadero FireDAC ADS Driver Components + Embarcadero FireDAC - VCL-Formularkomponenten + Embarcadero FireDAC-Datenbankkomponenten + Embarcadero Datenbankkomponenten + Embarcadero VCL-DataSnap-Komponenten + (Unbenannt) + Embarcadero Internet/World Wide Web-Datenbankkomponenten + Embarcadero BDE-Datenbankkomponenten + (Unbenannt) + Embarcadero InterBase Client + Embarcadero SimpleDataSet-Komponente (DBX) + Indy 10 Core + Indy 10-System + Indy 10-Protokolle + Embarcadero ADO-Datenbankkomponenten + Embarcadero FireDAC FMX Forms Components + Embarcadero FMX OBJ Import Library + Embarcadero FMX DAE Import Library + Embarcadero FMX ASE Import Library + Embarcadero Beispielkomponenten + Benutzerschnittstellencode für die Subversion-Integration + Subversion-Integration + Embarcadero LiveBindings-Komponenten FireMonkey + Embarcadero LiveBindings-Komponenten VCL + Embarcadero Metropolis-UI Komponentenbibliothek für Live-Kacheln + Embarcadero Touch VCL-Komponenten + Embarcadero InterBase Express VCL-Steuerelemente + Embarcadero InterBase Express-Komponenten + Embarcadero Ribbon-Komponenten + Embarcadero IP Indy Client Implementation + Embarcadero IP Indy Common Implementation + Embarcadero IP Indy Server Implementation + Embarcadero REST Client Components VCL + Embarcadero REST-Client-Komponenten + Data Binding Expression Components DBExpress + Embarcadero Cloud-Komponenten + Embarcadero DataSnap-Verbindungskomponenten + IntraWeb 14.0 Runtime Package for RAD Studio XE3 + Embarcadero Kompatibilitäts-Datenbankkomponenten + Embarcadero InternetExpress Components + (Unbenannt) Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Embarcadero Sqlite-Client + Embarcadero MySQL Client + Win32 Shell Steuerelemente + Embarcadero Treiberkomponenten + Embarcadero Intro-Treiberkomponenten + DBExpress Daten-Explorer-Integration Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server diff --git a/Package/Delphi_XE5/LINA_D_XE5.dproj.local b/Package/Delphi_XE5/LINA_D_XE5.dproj.local index 00e8662..bb18827 100644 --- a/Package/Delphi_XE5/LINA_D_XE5.dproj.local +++ b/Package/Delphi_XE5/LINA_D_XE5.dproj.local @@ -8,7 +8,7 @@ 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 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 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 - 1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc= 1899.12.30 00:00:00.000.325,=dbrtl.dcp 1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc @@ -24,7 +24,7 @@ 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 1899.12.30 00:00:00.000.143,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm 1899.12.30 00:00:00.000.896,C:\Users\Dennis G\Documents\CodeQuality.htm= - 1899.12.30 00:00:00.000.791,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.555,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBase.pas 1899.12.30 00:00:00.000.971,=IndySystem.dcp 1899.12.30 00:00:00.000.584,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uVirtObj.pas @@ -39,9 +39,9 @@ 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 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 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 - 1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas - 1899.12.30 00:00:00.000.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 1899.12.30 00:00:00.000.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas + 1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas 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 1899.12.30 00:00:00.000.857,=PascalScript_Core_D19.dcp 1899.12.30 00:00:00.000.045,=IndyProtocols.dcp diff --git a/Package/Delphi_XE5/LINA_D_XE5.identcache b/Package/Delphi_XE5/LINA_D_XE5.identcache index c409281..3e56f58 100644 Binary files a/Package/Delphi_XE5/LINA_D_XE5.identcache and b/Package/Delphi_XE5/LINA_D_XE5.identcache differ diff --git a/Package/Delphi_XE5/LINA_D_XE5.res b/Package/Delphi_XE5/LINA_D_XE5.res index 8a27321..27efe49 100644 Binary files a/Package/Delphi_XE5/LINA_D_XE5.res and b/Package/Delphi_XE5/LINA_D_XE5.res differ diff --git a/Source/Compiled/uAdvCtrls.dcu b/Source/Compiled/uAdvCtrls.dcu deleted file mode 100644 index 294a65c..0000000 Binary files a/Source/Compiled/uAdvCtrls.dcu and /dev/null differ diff --git a/Source/Compiled/uBase.dcu b/Source/Compiled/uBase.dcu deleted file mode 100644 index ee1a122..0000000 Binary files a/Source/Compiled/uBase.dcu and /dev/null differ diff --git a/Source/Compiled/uCalc.dcu b/Source/Compiled/uCalc.dcu deleted file mode 100644 index 28d0d07..0000000 Binary files a/Source/Compiled/uCalc.dcu and /dev/null differ diff --git a/Source/Compiled/uFileCtrls.dcu b/Source/Compiled/uFileCtrls.dcu deleted file mode 100644 index 07f7f69..0000000 Binary files a/Source/Compiled/uFileCtrls.dcu and /dev/null differ diff --git a/Source/Compiled/uFileTools.dcu b/Source/Compiled/uFileTools.dcu deleted file mode 100644 index 98b3a9b..0000000 Binary files a/Source/Compiled/uFileTools.dcu and /dev/null differ diff --git a/Source/Compiled/uFrmCtrls.dcu b/Source/Compiled/uFrmCtrls.dcu deleted file mode 100644 index c1d308d..0000000 Binary files a/Source/Compiled/uFrmCtrls.dcu and /dev/null differ diff --git a/Source/Compiled/uInit.dcu b/Source/Compiled/uInit.dcu deleted file mode 100644 index 5e9ecd6..0000000 Binary files a/Source/Compiled/uInit.dcu and /dev/null differ diff --git a/Source/Compiled/uLocalMgr.dcu b/Source/Compiled/uLocalMgr.dcu deleted file mode 100644 index 5ff1803..0000000 Binary files a/Source/Compiled/uLocalMgr.dcu and /dev/null differ diff --git a/Source/Compiled/uScriptMgr.dcu b/Source/Compiled/uScriptMgr.dcu deleted file mode 100644 index 845b3f0..0000000 Binary files a/Source/Compiled/uScriptMgr.dcu and /dev/null differ diff --git a/Source/Compiled/uSysCtrls.dcu b/Source/Compiled/uSysCtrls.dcu deleted file mode 100644 index 971ab85..0000000 Binary files a/Source/Compiled/uSysCtrls.dcu and /dev/null differ diff --git a/Source/Compiled/uSysTools.dcu b/Source/Compiled/uSysTools.dcu deleted file mode 100644 index 1569ea3..0000000 Binary files a/Source/Compiled/uSysTools.dcu and /dev/null differ diff --git a/Source/Compiled/uVirtObj.dcu b/Source/Compiled/uVirtObj.dcu deleted file mode 100644 index c21464e..0000000 Binary files a/Source/Compiled/uVirtObj.dcu and /dev/null differ diff --git a/Source/Compiled/uWebCtrls.dcu b/Source/Compiled/uWebCtrls.dcu deleted file mode 100644 index e32629e..0000000 Binary files a/Source/Compiled/uWebCtrls.dcu and /dev/null differ diff --git a/Source/uBase.pas b/Source/uBase.pas index 89c7ed6..7ae5234 100644 --- a/Source/uBase.pas +++ b/Source/uBase.pas @@ -81,8 +81,8 @@ begin {$ELSE} { TaskMessageDlg, falls der Compiler Vista-Dialoge unterstützt } TaskMessageDlg( - {$ENDIF} About_Title, + {$ENDIF} { ---------------------------------- } Name + ' v' + Version + sLineBreak diff --git a/Source/uFrmCtrls.pas b/Source/uFrmCtrls.pas index 784117d..bcb09bb 100644 --- a/Source/uFrmCtrls.pas +++ b/Source/uFrmCtrls.pas @@ -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); - Reset(DataFile); + 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; diff --git a/Source/uSysCtrls.pas b/Source/uSysCtrls.pas index d6f6d3e..fd2f161 100644 --- a/Source/uSysCtrls.pas +++ b/Source/uSysCtrls.pas @@ -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; diff --git a/Source/uSysTools.pas b/Source/uSysTools.pas index 84cb69b..2c28c07 100644 --- a/Source/uSysTools.pas +++ b/Source/uSysTools.pas @@ -35,6 +35,8 @@ type TVerticalAlignment = (taAlignTop, taAlignBottom, taVerticalCenter); {$ENDIF} + TBit = 0..1; + {$IFNDEF NO_GENERIC} TVariantList = TList; TIntegerList = TList; @@ -42,6 +44,7 @@ type TFloatList = TList; TPointList = TList; {$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; diff --git a/Source/uWebCtrls.pas b/Source/uWebCtrls.pas index 6d8374d..8b2afd9 100644 --- a/Source/uWebCtrls.pas +++ b/Source/uWebCtrls.pas @@ -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.