1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2025-02-12 10:25:59 +02:00

Version 1.0 DEV 1.12

Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Dennis07 2014-12-08 11:46:01 +01:00
parent 12ce1d9006
commit 8f16f703bf
40 changed files with 1278 additions and 310 deletions

View File

@ -1,5 +1,11 @@
unit uMain;
//////////////////////////////////////
/// Lina Context Menu Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}

View File

@ -1,5 +1,11 @@
unit uMain;
//////////////////////////////////////
/// Lina ListBox Manager Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}

View File

@ -0,0 +1,6 @@
; German language example
HelloWorld = Hallo Welt!
LanguageSelect = Sprache
* Buttons
Close = Schliessen
Hello = Hallo!

View File

@ -0,0 +1,8 @@
* Section 1
; Line comment
1 = One
2 = Two ; Inline comment
3 = Three
* Section 2
4 = Four
5 = Five

View File

@ -0,0 +1,14 @@
program pExample;
uses
Vcl.Forms,
uMain in 'uMain.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,170 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{9DB40183-F725-45D7-8687-DACCFE22F72D}</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)'!=''">
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<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)'!=''">
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_UsePackage>JvBDE;JvGlobus;O408br;JvMM;JvManagedThreads;FireDACSqliteDriver;ZComponent;DBXSqliteDriver;AbbreviaVCL;FireDACPgDriver;VampyreImagingPackage.D2009;fmx;JvDlgs;IndySystem;JvCrypt;TeeDB;frx19;vclib;inetdbbde;DBXInterBaseDriver;GR32_DSGN_RSXE5;DataSnapCommon;pkCindyDERDXE5;JvNet;JvDotNetCtrls;DbxCommonDriver;tdbf;vclimg;dbxcds;PieLib;vclshlctrls;MetropolisUILiveTile;JvXPCtrls;pkCindyPackDXE5;vcldb;vcldsnap;pkCindyIEDXE5;WindowsMediaPlayer;fmxFireDAC;pkCindyDBXDXE5;CustomIPTransport;JvCore;SynEdit_RXE5;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;DCEF_XE5;IndyIPCommon;CloudService;CodeSiteExpressPkg;FmxTeeUI;FireDACIBDriver;FMXfrxDB19;JvAppFrm;JvDB;JvRuntimeDesign;inetdbxpress;frxe19;JclDeveloperTools;JvDocking;adortl;JvWizards;frxDB19;FireDACASADriver;JvHMI;bindcompfmx;JvBands;vcldbx;FireDACODBCDriver;ZDbc;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ZPlain;JvPluginSystem;Tee;JclContainers;JvCmp;vclFireDAC;JvSystem;xmlrtl;svnui;ibxpress;JvTimeFramework;JvControls;SVATimer_DXE5;IndyProtocols;DBXMySQLDriver;djsonrt;FireDACCommonDriver;O408_r;soaprtl;bindengine;vclactnband;bindcompdbx;TeeUI;FMXTee;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;JvJans;JvPageComps;JvPrintPreview;pkCindyDBCtrlsPackDXE5;FireDACADSDriver;vcltouch;ZCore;LINA_D_XE5;G114_R140;VclSmp;FireDAC;VCLRESTComponents;Intraweb;GR32_RSXE5;dsnapcon;inet;fmxobj;JclVcl;JvPascalInterpreter;FireDACMySQLDriver;FMXfrx19;vclx;ZParseSql;svn;fmxdae;RESTComponents;Delphi_XE5;bdertl;VirtualTreesR;FireDACMSAccDriver;dbexpress;IndyIPClient;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>O408br;FireDACSqliteDriver;ZComponent;DBXSqliteDriver;AbbreviaVCL;FireDACPgDriver;fmx;IndySystem;vclib;DBXInterBaseDriver;DataSnapCommon;DbxCommonDriver;tdbf;vclimg;dbxcds;vclshlctrls;MetropolisUILiveTile;vcldb;vcldsnap;fmxFireDAC;CustomIPTransport;SynEdit_RXE5;vclribbon;dsnap;IndyIPServer;fmxase;vcl;IndyCore;IndyIPCommon;CloudService;FireDACIBDriver;inetdbxpress;adortl;FireDACASADriver;bindcompfmx;FireDACODBCDriver;ZDbc;rtl;dbrtl;DbxClientDriver;FireDACCommon;bindcomp;ZPlain;vclFireDAC;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;FireDACCommonDriver;O408_r;soaprtl;bindengine;vclactnband;bindcompdbx;bindcompvcl;vclie;FireDACADSDriver;vcltouch;ZCore;LINA_D_XE5;VclSmp;FireDAC;VCLRESTComponents;Intraweb;dsnapcon;inet;fmxobj;FireDACMySQLDriver;vclx;ZParseSql;fmxdae;RESTComponents;VirtualTreesR;FireDACMSAccDriver;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)'!=''">
<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>Form1</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>
</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,47 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899.12.30 00:00:00.000.634,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.689,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.832,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.177,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.489,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.256,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.782,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.562,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.963,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.541,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.579,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.957,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.669,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.129,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.646,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.352,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.438,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.356,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.036,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.911,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.215,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.086,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.283,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.505,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.333,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.029,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.050,C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.dfm=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TLocalizationManager\uMain.dfm</Transaction>
<Transaction>1899.12.30 00:00:00.000.716,C:\Users\Dennis G\Documents\RAD Studio\Projekte\Project1.dproj=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TLocalizationManager\pExample.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.779,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.629,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.376,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.028,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.044,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.050,C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Example\TLocalizationManager\uMain.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.726,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.012,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.165,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.169,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.120,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.042,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.416,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.660,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\Unit1.pas</Transaction>
</Transactions>
</BorlandProject>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,85 @@
object Form1: TForm1
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Form1'
ClientHeight = 180
ClientWidth = 273
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object pnButtons: TPanel
Left = 0
Top = 139
Width = 273
Height = 41
Align = alBottom
TabOrder = 0
object btClose: TButton
Left = 8
Top = 8
Width = 75
Height = 25
Caption = 'Close'
TabOrder = 0
OnClick = btCloseClick
end
object btHello: TButton
Left = 190
Top = 8
Width = 75
Height = 25
Caption = 'Hello!'
TabOrder = 1
OnClick = btHelloClick
end
end
object gbLaguage: TGroupBox
Left = 8
Top = 8
Width = 257
Height = 115
Caption = 'Language'
TabOrder = 1
object lbLanguage: TListBox
Left = 16
Top = 24
Width = 225
Height = 81
ItemHeight = 13
TabOrder = 0
OnClick = lbLanguageClick
end
end
object LocalizationManager: TLocalizationManager
Localizations = <>
References = <
item
Indent = 'HelloWorld'
end
item
Section = 'Buttons'
Indent = 'Close'
Control = btClose
end
item
Section = 'Buttons'
Indent = 'Hello'
Control = btHello
end
item
Indent = 'LanguageSelect'
Control = gbLaguage
end>
Left = 208
Top = 8
end
end

View File

@ -0,0 +1,77 @@
unit uMain;
//////////////////////////////////////
/// Lina Local. Manager 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
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, uBase, uLocalMgr, Vcl.StdCtrls,
Vcl.ExtCtrls, uFileTools;
type
TForm1 = class(TForm)
LocalizationManager: TLocalizationManager;
pnButtons: TPanel;
btClose: TButton;
btHello: TButton;
gbLaguage: TGroupBox;
lbLanguage: TListBox;
procedure FormCreate(Sender: TObject);
procedure lbLanguageClick(Sender: TObject);
procedure btHelloClick(Sender: TObject);
procedure btCloseClick(Sender: TObject);
private
{ Private-Deklarationen }
HelloWorld: String;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.btCloseClick(Sender: TObject);
begin
Close;
end;
procedure TForm1.btHelloClick(Sender: TObject);
begin
ShowMessage(HelloWorld);
end;
procedure TForm1.FormCreate(Sender: TObject);
var
Index: Integer;
LanguageFiles: TStrings;
begin
HelloWorld := 'Hello, World!';
(LocalizationManager.References.Items[0] as TLocalizationReference).Reference := @HelloWorld;
LanguageFiles := TStringList.Create;
ListFiles(ExtractFileDir(Application.ExeName),LanguageFiles,['*.loc']);
lbLanguage.Items.Assign(LanguageFiles);
for Index := 0 to LanguageFiles.Count - 1 do
begin
(LocalizationManager.Localizations.Add as TLocalization).Lines.LoadFromFile(ExtractFilePath(Application.ExeName) + ChangeFileExt(LanguageFiles.Strings[Index],'.loc'));
end;
end;
procedure TForm1.lbLanguageClick(Sender: TObject);
begin
LocalizationManager.Current := lbLanguage.ItemIndex;
end;
end.

View File

@ -1,5 +1,11 @@
unit uMain;
//////////////////////////////////////
/// Lina Param Definer Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}

Binary file not shown.

View File

@ -6,6 +6,10 @@ unit uMain;
/// (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
@ -124,7 +128,7 @@ end;
procedure TfmMain.miRunCompileExecuteClick(Sender: TObject);
begin
ListBox.Items.Clear;
ScriptManager.CodeAssign(SynEdit.Lines);
ScriptManager.Code.Assign(SynEdit.Lines);
if miRunLibrary.Checked = False then
begin
ScriptManager.VarSelf := nil;

View File

@ -1,5 +1,11 @@
unit uMain;
//////////////////////////////////////
/// Lina Splash Screen Example ///
/// **************************** ///
/// (c) 2014 Dennis Göhlert a.o. ///
//////////////////////////////////////
{$IF CompilerVersion <> 26.0}
{$MESSAGE ERROR 'This example was written to compile under Delphi XE5'}
{$ENDIF}

View File

@ -6,6 +6,10 @@ unit uMain;
/// (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

View File

@ -0,0 +1,5 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
IDList=
URL=http://www.rancboomer.com/

View File

@ -1,4 +1,4 @@
These statistics cover the official repository of Lina Components.
Total lines of code (LoC): 7300+
Total lines of code (LoC): 7500+
Total visual components (VC): 15

View File

@ -62,3 +62,5 @@ contains
uInit in '..\..\Source\uInit.pas';
end.

View File

@ -1,49 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<BorlandProject>
<Transactions>
<Transaction>1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.173,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uInit.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.325,=dbrtl.dcp</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.508,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBase.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.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.837,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.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.681,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc=</Transaction>
<Transaction>1899.12.30 00:00:00.000.809,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Resource\Lina.rc</Transaction>
<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.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</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.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas=</Transaction>
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=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.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.518,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas</Transaction>
<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.537,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Untitled1.htm=C:\Users\Dennis G\Documents\CodeQuality.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.318,=vcl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.633,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\LINA_D_XE5.dproj=C:\Users\Dennis\Documents\RAD Studio\Projekte\Package1.dproj</Transaction>
<Transaction>1899.12.30 00:00:00.000.577,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uBattery.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas</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.971,=IndySystem.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.pas=</Transaction>
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.556,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uLocalMgr.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.196,=rtl.dcp</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.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.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>
<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.118,=IndyCore.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.535,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.633,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLocalMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.672,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uFrmCtrls.pas</Transaction>
<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.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.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.412,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.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.791,=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.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.857,=PascalScript_Core_D19.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.045,=IndyProtocols.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.799,=PascalScript_Core_D19.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.566,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uScriptMgr.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.546,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFrmCtrls.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\..\LinaComponents"/>

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

@ -69,8 +69,8 @@ begin
About_Title,
{ ---------------------------------- }
Component + ' v'
+ FloatToStr(Version) + #10#13
+ Copyright + ' ' + Author + #10#13
+ FloatToStr(Version) + sLineBreak
+ Copyright + ' ' + Author + sLineBreak
+ Homepage,
{ ---------------------------------- }
mtInformation,

View File

@ -68,45 +68,47 @@ begin
end;
initialization
{$IF CompilerVersion < 15.0}
{ Frühere Delphi-Versionen als Delphi 7 werden nicht (offiziell)
unterstützt. }
{$MESSAGE ERROR 'Lina Components requires Delphi 7 or higher'}
{$IFEND}
{$IF CompilerVersion < 18.5}
{ Unter früheren Delphi-Versionen als 2007 gab es (offiziell) noch keine
Unterstützung für Windows-Vista-spezifische funktionen wie die TaskDialog-
Komponente oder einige Funktionen.
Damit dies nicht zu Problemen führt, geht der Compiler darauf mithilfe
dieser Direktive ein. }
{$DEFINE NO_VISTA}
{$IFEND}
{$IF CompilerVersion < 21.0}
{ Unter früheren Delphi-Versionen als 2010 gab es ein Problem mit dem
"crHandPoint" cursor, sodass dieser nicht korrekt unter Windows Vista oder
höher dargestellt wurde, sondern stattdessen im alten Windows-Look.
Bei älteren Delphi-Versionen als 2010 steht deswegen eine Pseudo-
Komponente zur Behebung dieses Problems zur Verfügung. }
{$DEFINE NO_HANDPOINT}
{$IFEND}
{$IF CompilerVersion < 20.0}
{ Unter früheren Delphi-Versionen als 2009 war die Nutzung generischer
Datentypen (Generics) nicht möglich. Da es ohne diese nahezu unmöglich
scheint, typisierte Objekte, wie zum Beispiel typisierte TObjectList's
zu deklarieren, fallen diese Deklarationen unter früheren Delphi-Versionen
weg. Dies kann eventuell zu kompatibilitätsproblemen zwischen
unterschiedlichen Nutzern dieser Komponenten führen, lässt sich aber nicht
vermeiden. }
{$DEFINE NO_GENERIC}
{$IFEND}
{$IF CompilerVersion < 20.0}
{ Unter früheren Delphi-Versionen als 2009 entsprach der String-Typenalias
dem AnsiString-Typen. Da es gegebenfalls bei manchen externen (zB. OS-
Spezifischen) Klassen zu Kompatibilitätsproblemen kommmen könnte, wird
hier eine Überprüfung der Unicode-Unterstützung durchgeführt.
Zu beachten ist jedoch, dass Delphi 2009 und höher AnsiStrings implizit
in UnicodeStrings umwandelt und umgekehrt (sofern möglich). }
{$DEFINE NO_UNICODE}
{$IF Defined(CompilerVersion) = True}
{$IF CompilerVersion < 15.0}
{ Frühere Delphi-Versionen als Delphi 7 werden nicht (offiziell)
unterstützt. }
{$MESSAGE ERROR 'Lina Components requires Delphi 7 or higher'}
{$IFEND}
{$IF CompilerVersion < 18.5}
{ Unter früheren Delphi-Versionen als 2007 gab es (offiziell) noch keine
Unterstützung für Windows-Vista-spezifische funktionen wie die TaskDialog-
Komponente oder einige Funktionen.
Damit dies nicht zu Problemen führt, geht der Compiler darauf mithilfe
dieser Direktive ein. }
{$DEFINE NO_VISTA}
{$IFEND}
{$IF CompilerVersion < 21.0}
{ Unter früheren Delphi-Versionen als 2010 gab es ein Problem mit dem
"crHandPoint" cursor, sodass dieser nicht korrekt unter Windows Vista oder
höher dargestellt wurde, sondern stattdessen im alten Windows-Look.
Bei älteren Delphi-Versionen als 2010 steht deswegen eine Pseudo-
Komponente zur Behebung dieses Problems zur Verfügung. }
{$DEFINE NO_HANDPOINT}
{$IFEND}
{$IF CompilerVersion < 20.0}
{ Unter früheren Delphi-Versionen als 2009 war die Nutzung generischer
Datentypen (Generics) nicht möglich. Da es ohne diese nahezu unmöglich
scheint, typisierte Objekte, wie zum Beispiel typisierte TObjectList's
zu deklarieren, fallen diese Deklarationen unter früheren Delphi-Versionen
weg. Dies kann eventuell zu kompatibilitätsproblemen zwischen
unterschiedlichen Nutzern dieser Komponenten führen, lässt sich aber nicht
vermeiden. }
{$DEFINE NO_GENERIC}
{$IFEND}
{$IF CompilerVersion < 20.0}
{ Unter früheren Delphi-Versionen als 2009 entsprach der String-Typenalias
dem AnsiString-Typen. Da es gegebenfalls bei manchen externen (zB. OS-
Spezifischen) Klassen zu Kompatibilitätsproblemen kommmen könnte, wird
hier eine Überprüfung der Unicode-Unterstützung durchgeführt.
Zu beachten ist jedoch, dass Delphi 2009 und höher AnsiStrings implizit
in UnicodeStrings umwandelt und umgekehrt (sofern möglich). }
{$DEFINE NO_UNICODE}
{$IFEND}
{$IFEND}
{ Globale Einstellungen }
{$DEFINE ADD_SPLASHENTRY}

View File

@ -16,7 +16,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes, Windows,
SysUtils, Classes, Controls, Forms, StdCtrls, ExtCtrls,
{ Andere Package-Units }
uBase, uSysTools;
@ -29,7 +29,6 @@ type
type
{ Hilfsklassen }
TLanguageTag = String[3];
TComponentDetectMode = (cdTag,cdName);
TCommentAllow = type TLinePosition;
type
@ -42,11 +41,13 @@ type
FSeparator: ShortString;
FHeader: ShortString;
FIndent: ShortString;
FAddress: ShortString;
{ Methoden }
procedure SetComment(Value: ShortString);
procedure SetSeparator(Value: ShortString);
procedure SetHeader(Value: ShortString);
procedure SetIndent(Value: ShortString);
procedure SetAddress(Value: ShortString);
public
{ Public-Deklarationen }
constructor Create;
@ -58,6 +59,7 @@ type
property Separator: ShortString read FSeparator write SetSeparator; //nicht leer
property Header: ShortString read FHeader write SetHeader;
property Indent: ShortString read FIndent write SetIndent;
property Address: ShortString read FAddress write SetAddress;
end;
TLocalization = class(TCollectionItem)
@ -75,14 +77,13 @@ type
procedure SetFormat(Value: TLocalizationFormat);
protected
{ Protected-Deklarationen }
procedure RaiseParseError(Msg: String; LineIndex, CharIndex: Integer);
procedure RaiseParseError(Expected: String; Found: String; LineIndex: Integer;
CharIndex: PChar; ExprLength: Integer = 0);
public
{ Public-Deklarationen }
constructor Create(Collection: TCollection); overload; override;
constructor Create(Collection: TCollection; const AFileName: TFileName); overload;
destructor Destroy; override;
//function Check: Boolean; overload;
//function Check(const Line: Integer): Boolean; overload;
procedure Apply;
published
{ Published-Deklarationen }
@ -98,16 +99,73 @@ type
private
{ Private-Deklarationen }
FManager: TLocalizationManager;
{ Methoden }
function GetManager: TLocalizationManager;
procedure SetManager(Value: TLocalizationManager);
public
{ Public-Deklarationen }
constructor Create(ItemClass: TCollectionItemClass; AManager: TLocalizationManager);
destructor Destroy; override;
function IndexOfTag(const Tag: TLanguageTag): Integer;
{ Eigenschaften }
property Manager: TLocalizationManager read FManager write FManager;
end;
TLocalizationData = class
private
{ Private-Deklarationen }
Sections: TStringRefDataArrayReferenceDataArray;
Indents: array of TStringReferenceDataArray;
Values: TStringArray;
FManager: TLocalizationManager;
{ Methoden }
procedure WriteString(const Section,Indent: String; Value: String);
protected
{ Protected-Deklarationen }
procedure AddSection(Section: String);
procedure AddIndent(const Section: String; Indent: String);
public
{ Public-Deklarationen }
constructor Create(AManager: TLocalizationManager);
destructor Destroy; override;
function IndexOfSection(const Section: String): Integer;
function IndexOfIndent(const Section,Indent: String): Integer;
function SectionExists(const Section: String): Boolean;
function IndentExists(const Section,Indent: String): Boolean;
procedure ReadSections(var ASections: TStrings);
procedure ReadIndents(const Section: String; var AIndents: TStrings);
procedure ReadValues(const Section: String; var AValues: TStrings);
function ReadString(const Section,Indent: String; Default: String): String;
function ReadInteger(const Section,Indent: String; Default: Integer): Integer;
function ReadFloat(const Section,Indent: String; Default: Extended): Extended;
end;
TLocalizationReferences = class(TCollection)
private
{ Private-Deklarationen }
FManager: TLocalizationManager;
public
{ Public-Deklarationen }
constructor Create(ItemClass: TCollectionItemClass; AManager: TLocalizationManager);
destructor Destroy; override;
procedure Apply;
end;
TLocalizationReference = class(TCollectionItem)
private
{ Private-Deklarationen }
FSection: String;
FIndent: String;
FReference: PString;
FControl: TControl;
{ Methoden }
procedure SetIndent(Value: String);
public
{ Public-Deklarationen }
destructor Destroy; override;
property Reference: PString read FReference write FReference;
{ Methoden }
procedure Apply;
published
{ Published-Deklarationen }
property Section: String read FSection write FSection;
property Indent: String read FIndent write SetIndent;
property Control: TControl read FControl write FControl;
end;
TLocalizationManager = class(TComponent)
@ -115,9 +173,9 @@ type
{ Private-Deklarationen }
FAbout: TComponentAbout;
FLocalizations: TLocalizations;
FData: TLocalizationData;
FReferences: TLocalizationReferences;
FCurrent: Integer;
FDefault: Integer;
FDetect: TComponentDetectMode;
{ Methoden }
procedure SetCurrent(Value: Integer);
protected
@ -126,13 +184,13 @@ type
{ Public-Deklarationen }
constructor Create(AOwnder: TComponent); override;
destructor Destroy; override;
property Data: TLocalizationData read FData write FData;
published
{ Published-Deklarationen }
property About: TComponentAbout read FAbout;
property Localizations: TLocalizations read FLocalizations write FLocalizations;
property References: TLocalizationReferences read FReferences write FReferences;
property Current: Integer read FCurrent write SetCurrent default -1;
property Default: Integer read FDefault write FDefault default -1;
property Detect: TComponentDetectMode read FDetect write FDetect default cdName;
end;
procedure Register;
@ -162,6 +220,7 @@ begin
FComment := ';';
FSeparator := '=';
FHeader := '*';
FAddress := '@';
end;
destructor TLocalizationFormat.Destroy;
@ -174,7 +233,7 @@ procedure TLocalizationFormat.SetComment(Value: ShortString);
var
Index: Integer;
begin
if (ArrayPos(Value,[FSeparator,FHeader,FIndent]) <> -1) or (Length(Value) = 0) then
if (ArrayPos(Value,[FSeparator,FHeader,FIndent,FAddress]) <> -1) or (Length(Value) = 0) then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Comment"');
end;
@ -192,7 +251,7 @@ procedure TLocalizationFormat.SetSeparator(Value: ShortString);
var
Index: Integer;
begin
if (ArrayPos(Value,[FComment,FHeader,FIndent]) <> -1) or (Length(Value) = 0) then
if (ArrayPos(Value,[FComment,FHeader,FIndent,FAddress]) <> -1) or (Length(Value) = 0) then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Separator"');
end;
@ -210,7 +269,7 @@ procedure TLocalizationFormat.SetHeader(Value: ShortString);
var
Index: Integer;
begin
if ArrayPos(Value,[FComment,FSeparator,FIndent]) <> -1 then
if ArrayPos(Value,[FComment,FSeparator,FIndent,FAddress]) <> -1 then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Header"');
end;
@ -228,20 +287,38 @@ procedure TLocalizationFormat.SetIndent(Value: ShortString);
var
Index: Integer;
begin
if ArrayPos(Value,[FComment,FSeparator,FHeader]) <> -1 then
if ArrayPos(Value,[FComment,FSeparator,FHeader,FAddress]) <> -1 then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Header"');
raise EInvalidFormat.Create('Invalid param format for property: "Indent"');
end;
for Index := 1 to Length(Value) do
begin
if Value[Index] in Spaces then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Header"');
raise EInvalidFormat.Create('Invalid param format for property: "Indent"');
end;
end;
FIndent := Value;
end;
procedure TLocalizationFormat.SetAddress(Value: ShortString);
var
Index: Integer;
begin
if ArrayPos(Value,[FComment,FSeparator,FHeader,FIndent]) <> -1 then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Address"');
end;
for Index := 1 to Length(Value) do
begin
if Value[Index] in Spaces then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Address"');
end;
end;
FAddress := Value;
end;
{ ----------------------------------------------------------------------------
TLocalization
---------------------------------------------------------------------------- }
@ -298,89 +375,168 @@ begin
FFormat := Value;
end;
procedure TLocalization.RaiseParseError(Msg: String; LineIndex, CharIndex: Integer);
procedure TLocalization.RaiseParseError(Expected: String; Found: String; LineIndex: Integer;
CharIndex: PChar; ExprLength: Integer = 0);
begin
raise ELocalizationParse.Create('[' + IntToStr(LineIndex) + '.' + IntToStr(CharIndex) + ']' + ' ' + Msg);
raise ELocalizationParse.Create('[' + IntToStr(LineIndex + 1) + '.' + IntToStr(Pos(String(CharIndex),Lines.Strings[LineIndex]) - ExprLength) + ']' + ' ' + Expected + ' expected, but ' + Found + ' found');
end;
{function TLocalization.Apply(const Line: Integer): Boolean;
var
Index: Integer;
LineStr: String;
InPart: array [3] of Byte; //0 = Header; 1 = Separator; 2 = Indent
begin
Result := True;
LineStr := Lines.Strings[Index];
{ Standardwerte }
{ InPart[0] := 0;
InPart[1] := 0;
InPart[2] := 0;
{ Parse }
{ for Index := 1 to Length(LineStr) do
begin
procedure TLocalization.Apply;
{ Compiliert den Inhalt eines TStrings-Objects zeilenweise zu einem Konstrukt
aus Record-Arrays und Records mit je einem String-Wert und einem Pointer zur
Referenzierung (siehe hierzu: uSysTools.TStringReferenceData etc.).
Hierrauf wird im Anschluss durch Methoden der Klasse TLocalizationData
zugegriffen.
Die Datenstruktur entspricht dem folgenden Schema:
if LineStr[Index] in Spaces then
[SECTIONS] [INDENTS] [VALUES]
|- 0 ------------ 0 ------------ 0
| \ | \
| Titel | Titel
| |
| |- 1 ------------ 1
| \
| Titel
|
|- 1 ------------ 2 ------------ 2
\ \
Titel Titel
Die Syntax entspricht den in der TLocalizationFormat-Klasse festgelegten
Bausteinen und Einstellungen, die zur Laufzeit für jede Sprache Individuell
festgelegt werden kann. }
var
Position: (posPrefix,posIndent,posSeparator,posValue);
Line: Integer;
Complete: Boolean;
Header: Boolean;
Current: PChar;
InComment: PChar;
Block: String;
Section: String;
Indent: String;
label
EoL;
begin
Section := '';
Indent := '';
for Line := 0 to Lines.Count - 1 do
begin
//Leere Zeile
if Length(Lines.Strings[Line]) = 0 then
begin
Inc(Current);
Continue;
end;
end;
end; }
procedure TLocalization.Apply;
var
LineIndex: Integer;
CharIndex: Integer;
Line: String;
Identifier: ShortString;
Value: String;
Expr: String;
Header: Boolean;
Position: (posPrefix,posIndent,posSeparator,posValue);
begin
for LineIndex := 0 to Lines.Count - 1 do
begin
Line := Lines.Strings[LineIndex];
for CharIndex := 1 to Length(Line) do
//Zeilenanfang
Position := posPrefix;
Header := False;
Complete := False;
Current := @Lines.Strings[Line][1];
InComment := @Format.Comment[1];
//Parsen
while Complete = False do
begin
if Expr = Format.Comment then
if (not (Current^ in Spaces)) or (((Position = posValue) or (Header = True)) and (Length(Block) <> 0)) then
begin
end;
if Line[CharIndex] in Spaces then
begin
case Position of
//[>PRE<] Indent SEP Value
posPrefix:
//PRE [>Indent<] SEP Value
// posIndent: if Length(Expr then
//PRE Indent [>SEP<] Value
// posSeparator: if Expr = Format.Separator then
begin
Position := posValue;
Continue;
end;
//PRE Indent SEP [>Value<]
posValue: Expr := Expr + Line[CharIndex];
//Zeichen zu Block hinzufügen
Block := Block + Current^;
if Current = @Lines.Strings[Line][Length(Lines.Strings[Line])] then
begin
goto EoL;
end else
begin
//Kommentare in Value (bei Indents) bzw. Indent (bei Headern)
if Format.AllowComment = lpAnyPosition then
begin
if InComment^ = Current^ then
begin
Inc(InComment);
end else
begin
if (InComment^ = #0) and (Current^ in Spaces) then
begin
SetLength(Block,Length(Block) - Length(Format.Comment) - 1);
goto EoL;
end else
begin
InComment := @Format.Comment[1];
end;
end;
end;
end;
end;
end;
{ Auf vollständigkeit prüfen... }
case Position of
posPrefix: RaiseParseError('Prefix expected, but end of line found',LineIndex,CharIndex);
posIndent: if Header = True then
end else
begin
//Alternativ auch bei Zeilenende
EoL:
if (Length(Block) <> 0) or (Position = posValue) then
begin
if //Kommentaranfang
((Block = Format.Comment) and ((Format.AllowComment = lpAnyPosition) or ((Format.AllowComment = lpBeginning) and (Current = @Lines.Strings[Line][1]))) or (Current = @Lines.Strings[Line][Length(Lines.Strings[Line])]) or (InComment^ = #0)) or
//Zeilenende
((Current = @Lines.Strings[Line][Length(Lines.Strings[Line])]) and (not (Current^ in Spaces))) then
begin
//Block fertig
if ((Position = posSeparator) and (Block = Format.Separator)) or ((Block = Format.Comment) and (Position = posPrefix)) or ((Header = True) and (Position = posIndent) and (Length(Block) <> 0)) or (Position = PosValue) then
begin
if Position = posSeparator then
begin
RaiseParseError('Header expected, but end of line found',LineIndex,CharIndex);
Block := '';
end;
Complete := True;
if Header = True then
begin
//Ende von Header
Section := Block;
end else
begin
RaiseParseError('Indent expected, but end of line found',LineIndex,CharIndex);
//Ende von Value
(Collection as TLocalizations).FManager.Data.WriteString(Section,Indent,Block);
end;
posSeparator: RaiseParseError('Definition expected, but end of line found',LineIndex,CharIndex);
end else
begin
RaiseParseError('Prefix, indent or separator','end of line',Line,Current);
end;
end else
begin
case Position of
posPrefix: begin
if (Block <> Format.Header) and (Block <> Format.Indent) then
begin
if (Length(Format.Header) = 0) or (Length(Format.Indent) = 0) then
begin
Header := (Length(Format.Header) = 0);
Position := posIndent;
Continue;
end else
begin
RaiseParseError('Prefix','"' + Block + '"',Line,Current,Length(Block));
end;
end;
Header := (Block = Format.Header);
Inc(Position);
end;
posIndent: begin
Indent := Block;
Inc(Position);
end;
posSeparator: begin
if Block <> Format.Separator then
begin
RaiseParseError('Separator','"' + Block + '"',Line,Current,Length(Block));
end;
Inc(Position);
end;
end;
end;
Block := '';
end;
end;
Inc(Current);
end;
Indent := '';
end;
//--------------------------------
(Collection as TLocalizations).Manager.FCurrent := Index;
(Collection as TLocalizations).FManager.References.Apply;
end;
{ ----------------------------------------------------------------------------
@ -399,16 +555,6 @@ begin
inherited;
end;
function TLocalizations.GetManager: TLocalizationManager;
begin
Result := FManager;
end;
procedure TLocalizations.SetManager(Value: TLocalizationManager);
begin
FManager := Value;
end;
function TLocalizations.IndexOfTag(const Tag: TLanguageTag): Integer;
var
Index: Integer;
@ -424,6 +570,261 @@ begin
end;
end;
{ ----------------------------------------------------------------------------
TLocalizationData
---------------------------------------------------------------------------- }
constructor TLocalizationData.Create(AManager: TLocalizationManager);
begin
inherited Create;
FManager := AManager;
end;
destructor TLocalizationData.Destroy;
begin
FManager := nil;
inherited;
end;
procedure TLocalizationData.AddSection(Section: String);
begin
SetLength(Sections,Length(Sections) + 1);
SetLength(Indents,Length(Indents) + 1);
Sections[High(Sections)].Reference := @Indents[High(Indents)];
Sections[High(Sections)].Value := Section;
end;
procedure TLocalizationData.AddIndent(const Section: String; Indent: String);
begin
SetLength(Sections[ArrayPos(Section,Sections)].Reference^,Length(Sections[ArrayPos(Section,Sections)].Reference^) + 1);
SetLength(Values,Length(Values) + 1);
Sections[ArrayPos(Section,Sections)].Reference^[High(Sections[ArrayPos(Section,Sections)].Reference^)].Reference := @Values[High(Values)];
Sections[ArrayPos(Section,Sections)].Reference^[High(Sections[ArrayPos(Section,Sections)].Reference^)].Value := Indent;
end;
procedure TLocalizationData.WriteString(const Section,Indent: String; Value: String);
begin
if SectionExists(Section) = False then
begin
AddSection(Section);
end;
if IndentExists(Section,Indent) = False then
begin
AddIndent(Section,Indent);
end;
if ReadString(Section,Indent,'') <> Value then
begin
Sections[ArrayPos(Section,Sections)].Reference^[ArrayPos(Indent,Sections[ArrayPos(Section,Sections)].Reference^)].Reference^ := Value;
end;
end;
function TLocalizationData.IndexOfSection(const Section: String): Integer;
begin
Result := ArrayPos(Section,Sections);
end;
function TLocalizationData.IndexOfIndent(const Section,Indent: String): Integer;
begin
Result := ArrayPos(Indent,Sections[ArrayPos(Section,Sections)].Reference^);
end;
function TLocalizationData.SectionExists(const Section: String): Boolean;
begin
Result := (IndexOfSection(Section) >= 0);
end;
function TLocalizationData.IndentExists(const Section,Indent: String): Boolean;
begin
Result := (IndexOfIndent(Section,Indent) >= 0);
end;
procedure TLocalizationData.ReadSections(var ASections: TStrings);
var
Index: Integer;
begin
ASections.Clear;
for Index := Low(Sections) to High(Sections) do
begin
ASections.Add(Sections[Index].Value);
end;
end;
procedure TLocalizationData.ReadIndents(const Section: String; var AIndents: TStrings);
var
Index: Integer;
begin
AIndents.Clear;
for Index := Low(Sections[ArrayPos(Section,Sections)].Reference^) to High(Sections[ArrayPos(Section,Sections)].Reference^) do
begin
AIndents.Add(Sections[ArrayPos(Section,Sections)].Reference^[Index].Value);
end;
end;
procedure TLocalizationData.ReadValues(const Section: String; var AValues: TStrings);
var
Index: Integer;
begin
AValues.Clear;
for Index := Low(Sections[ArrayPos(Section,Sections)].Reference^) to High(Sections[ArrayPos(Section,Sections)].Reference^) do
begin
AValues.Add(Sections[ArrayPos(Section,Sections)].Reference^[Index].Reference^);
end;
end;
function TLocalizationData.ReadString(const Section,Indent: String; Default: String): String;
begin
if (SectionExists(Section) = True) and (IndentExists(Section,Indent) = True) then
begin
Result := Sections[ArrayPos(Section,Sections)].Reference^[ArrayPos(Indent,Sections[ArrayPos(Section,Sections)].Reference^)].Reference^;
end else
begin
Result := Default;
end;
end;
function TLocalizationData.ReadInteger(const Section,Indent: String; Default: Integer): Integer;
begin
Result := StrToInt(ReadString(Section,Indent,IntToStr(Default)));
end;
function TLocalizationData.ReadFloat(const Section,Indent: String; Default: Extended): Extended;
begin
Result := StrToFloat(ReadString(Section,Indent,FloatToStr(Default)));
end;
{ ----------------------------------------------------------------------------
TLocalizationReferences
---------------------------------------------------------------------------- }
constructor TLocalizationReferences.Create(ItemClass: TCollectionItemClass; AManager: TLocalizationManager);
begin
inherited Create(ItemClass);
FManager := AManager;
end;
destructor TLocalizationReferences.Destroy;
begin
FManager := nil;
inherited;
end;
procedure TLocalizationReferences.Apply;
var
Index: Integer;
begin
for Index := 0 to Count - 1 do
begin
(Items[Index] as TLocalizationReference).Apply;
end;
end;
{ ----------------------------------------------------------------------------
TLocalizationReference
---------------------------------------------------------------------------- }
destructor TLocalizationReference.Destroy;
begin
Control := nil;
Reference := nil;
inherited;
end;
procedure TLocalizationReference.SetIndent(Value: String);
var
Index: Integer;
begin
if Length(Value) = 0 then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Indent"');
end;
for Index := 1 to Length(Value) do
begin
if Value[Index] in Spaces then
begin
raise EInvalidFormat.Create('Invalid param format for property: "Indent"');
end;
end;
FIndent := Value;
end;
procedure TLocalizationReference.Apply;
{ Alle (relevanten) Controls aus der Unit "StdCtrls", sowie TPanel, TRadioGroup
und TForm werden unterstützt. }
begin
if Reference <> nil then
begin
Reference^ := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,Reference^);
end;
if Assigned(Control) = True then
begin
//TForm
if Control is TForm then
begin
(Control as TForm).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TForm).Caption);
end;
//TButton
if Control is TButton then
begin
(Control as TButton).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TButton).Caption);
end;
//TEdit
if Control is TEdit then
begin
(Control as TEdit).Text := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TEdit).Text);
end;
//TCheckBox
if Control is TCheckBox then
begin
(Control as TCheckBox).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TCheckBox).Caption);
end;
//TComboBox
if Control is TComboBox then
begin
(Control as TComboBox).Text := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TComboBox).Text);
end;
//TMemo
if Control is TMemo then
begin
(Control as TMemo).Text := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TMemo).Text);
end;
//TListBox
if Control is TListBox then
begin
(Control as TListBox).Items.Text := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TListBox).Items.Text);
end;
//TLabel
if Control is TLabel then
begin
(Control as TLabel).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TLabel).Caption);
end;
//TStaticText
if Control is TStaticText then
begin
(Control as TStaticText).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TStaticText).Caption);
end;
//TGroupBox
if Control is TGroupBox then
begin
(Control as TGroupBox).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TGroupBox).Caption);
end;
//TRadioButton
if Control is TRadioButton then
begin
(Control as TRadioButton).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TRadioButton).Caption);
end;
//TPanel
if Control is TPanel then
begin
(Control as TPanel).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TPanel).Caption);
end;
//TRadioGroup
if Control is TRadioGroup then
begin
(Control as TRadioGroup).Caption := (Collection as TLocalizationReferences).FManager.Data.ReadString(Section,Indent,(Control as TRadioGroup).Caption);
end;
end;
end;
{ ----------------------------------------------------------------------------
TLocalizationManager
---------------------------------------------------------------------------- }
@ -433,16 +834,17 @@ begin
inherited;
FAbout := TComponentAbout.Create(LocalizationManagerComponent_Name,LocalizationManagerComponent_Version,LocalizationManagerComponent_Copyright,LocalizationManagerComponent_Author);
FLocalizations := TLocalizations.Create(TLocalization,Self);
FDetect := cdName;
FDefault := -1;
//Aktuelle Loc = Standard-Loc
Current := Default;
FData := TLocalizationData.Create(Self);
FReferences := TLocalizationReferences.Create(TLocalizationReference,Self);
FCurrent := -1;
end;
destructor TLocalizationManager.Destroy;
begin
FAbout.Free;
FLocalizations.Free;
FData.Free;
FReferences.Free;
inherited;
end;

View File

@ -52,9 +52,6 @@ type
TScriptCompileEvent = procedure(Sender: TObject) of object;
TScriptExecuteEvent = procedure(Sender: TObject) of object;
TScriptAfterExecuteEvent = procedure(Sender: TObject) of object;
TScriptLineEvent = procedure(Sender: TObject) of object;
TScriptCodeAssignEvent = procedure(Sender: TObject) of object;
TScriptCodeLoadEvent = procedure(Sender: TObject) of object;
type
{ Hauptklassen }
@ -86,7 +83,6 @@ type
{ Private-Deklarationen }
ScriptEngine: TPSScript;
Log: TStrings;
Code: TStrings;
CustomPlugins: TPSPlugIns;
FAbout: TComponentAbout;
FReturnMode: TScriptReturnMode;
@ -105,15 +101,9 @@ type
FCompileEvent: TScriptCompileEvent;
FExecuteEvent: TScriptExecuteEvent;
FAfterExecuteEvent: TScriptAfterExecuteEvent;
FLineEvent: TScriptLineEvent;
FCodeAssignEvent: TScriptCodeAssignEvent;
FCodeLoadEvent: TScriptCodeLoadEvent;
{ Methoden }
function GetCompilerOptions: TPSCompOptions;
procedure SetCompilerOptions(Value: TPSCompOptions);
function GetCodeLines(Index: Integer): String; //Int. Dekl. für: CodeLines[Index]
procedure SetCodeLines(Index: Integer; Value: String); //Int. Dekl. für: CodeLines[Index]
function GetCodeCount: Integer;
function GetRunning: Boolean;
procedure SetLibraries(Value: TScriptLibraries);
function GetUsePreProcessor: Boolean;
@ -122,6 +112,8 @@ type
procedure SetMainFileName(Value: AnsiString);
function GetDefines: TStrings;
procedure SetDefines(Value: TStrings);
function GetCode: TStrings;
procedure SetCode(Value: TStrings);
function GetPlugins: TScriptManagerPlugins;
procedure SetPlugins(Value: TScriptManagerPlugins);
published
@ -134,22 +126,19 @@ type
property OnCompile: TScriptCompileEvent read FCompileEvent write FCompileEvent;
property OnExecute: TScriptExecuteEvent read FExecuteEvent write FExecuteEvent;
property OnAfterExecute: TScriptAfterExecuteEvent read FAfterExecuteEvent write FAfterExecuteEvent;
property OnLine: TScriptLineEvent read FLineEvent write FLineEvent;
property OnCodeAssign: TScriptCodeAssignEvent read FCodeAssignEvent write FCodeAssignEvent;
property OnCodeLoad: TScriptCodeLoadEvent read FCodeLoadEvent write FCodeLoadEvent;
{ Eigenschaften }
property About: TComponentAbout read FAbout;
property CompilerOptions: TPSCompOptions read GetCompilerOptions write SetCompilerOptions default [];
property ReturnMode: TScriptReturnMode read FReturnMode write FReturnMode default srNone; //Wann soll eine Rückmeldung erfolgen?
property ReturnStyle: TScriptReturnStyle read FReturnStyle write FReturnStyle default srSimple; //Wie soll diese Rückmeldung aussehen?
property ReturnTarget: TStrings read FReturnTarget write FReturnTarget; //Wohin soll die Rückmeldung geschrieben werden?
property SecureMode: Boolean read FSecureMode write FSecureMode default True; //Darf der Script auf den ScriptMgr zugreifen?
property VarApplication: TApplication read FVarApplication write FVarApplication; //Variable "Application"
property VarSelf: TForm read FVarSelf write FVarSelf; //Variable "Self"
property Libraries: TScriptLibraries read FLibraries write SetLibraries default [slClasses,slControls,slStdCtrls,slForms,slDateUtils,slCustom];
property Libraries: TScriptLibraries read FLibraries write SetLibraries default [slClasses,slControls,slStdCtrls,slForms,slDateUtils,slComObj,slCustom];
property UsePreProcessor: Boolean read GetUsePreProcessor write SetUsePreProcessor; //Sind "Include"-Anweisungen erlaubt?
property MainFileName: AnsiString read GetMainFileName write SetMainFileName; //Dateiname für "Include"-Anweisungen
property Defines: TStrings read GetDefines write SetDefines;
property Code: TStrings read GetCode write SetCode;
protected
{ Protected-Deklarationen }
procedure AddLog(Entry: String);
@ -174,15 +163,7 @@ type
destructor Destroy; override;
property Running: Boolean read GetRunning;
procedure Stop; virtual;
property CodeLines[Index: Integer]: String read GetCodeLines write SetCodeLines;
property CodeCount: Integer read GetCodeCount;
function CodeAddLine(const S: String): Integer;
procedure CodeAddLines(Strings: TStrings);
procedure CodeDeleteLine(Index: Integer);
procedure CodeLoadFromFile(FileName: String);
procedure CodeLoadFromStream(Stream: TStream);
procedure CodeAssign(Source: TPersistent);
procedure CodeClear;
property ReturnTarget: TStrings read FReturnTarget write FReturnTarget; //Wohin soll die Rückmeldung geschrieben werden?
function CompileAndExecute: Boolean;
property Plugins: TScriptManagerPlugins read GetPlugins write SetPlugins;
end;
@ -199,7 +180,6 @@ const
ScriptManagerComponent_Copyright = 'Copyright © 2014';
ScriptManagerComponent_Author = 'Dennis Göhlert a.o.';
{ Fehlermeldungen }
Error_InvalidCodeLine = 'Invalid cole-line number';
Error_MissingReturnTarget = 'Missing log-return target';
Error_MissingComponentName = 'Missing component name';
@ -319,7 +299,6 @@ begin
end;
Plugins := TScriptManagerPlugins.Create(Self);
Log := TStringList.Create;
Code := TStringList.Create;
CustomPlugins := TPSPlugins.Create(ScriptEngine);
ScriptEngine := TPSScript.Create(Self);
ScriptEngine.OnNeedFile := ScriptEngineNeedFile;
@ -356,7 +335,6 @@ begin
Plugins.Free;
//ReturnSL.Free; Pointer auf ext. Komponente, nicht freigeben
Log.Free;
Code.Free;
//ScriptEngine.Free; Wird automatisch mit dem Owner vom TScriptManager freigegeben
About.Free;
{PS_Import_DB.Free;
@ -382,37 +360,6 @@ begin
ScriptEngine.Stop
end;
function TScriptManager.GetCodeLines(Index: Integer): String;
begin
if (Index >= 0) and (Index <= Code.Count - 1) then
begin
Result := Code.Strings[Index];
end else
begin
raise EInvalidCodeLine.Create(Error_InvalidCodeLine);
end;
end;
procedure TScriptManager.SetCodeLines(Index: Integer; Value: String);
begin
if (Index >= 0) and (Index <= Code.Count - 1) then
begin
Code.Strings[Index] := Value;
if ReturnMode = srAll then
begin
AddLog('Code line ' + IntToStr(Index + 1) + ' modified');
end;
end else
begin
raise EInvalidCodeLine.Create(Error_InvalidCodeLine);
end;
end;
function TScriptManager.GetCodeCount;
begin
Result := Code.Count;
end;
function TScriptManager.GetRunning: Boolean;
begin
Result := ScriptEngine.Running;
@ -501,6 +448,16 @@ begin
ScriptEngine.Defines := Value;
end;
function TScriptManager.GetCode: TStrings;
begin
Result := ScriptEngine.Script;
end;
procedure TScriptManager.SetCode(Value: TStrings);
begin
ScriptEngine.Script := Value;
end;
function TScriptManager.GetPlugins: TScriptManagerPlugins;
begin
Result := FPlugins;
@ -559,7 +516,6 @@ end;
function TScriptManager.CompileAndExecute: Boolean;
begin
Result := False;
ScriptEngine.Script.Assign(Code);
if ReturnMode = srAll then
begin
AddLog('Compiling script...');
@ -597,69 +553,6 @@ begin
end;
end;
function TScriptManager.CodeAddLine(const S: String): Integer;
begin
Result := Code.Add(S);
end;
procedure TScriptManager.CodeAddLines(Strings: TStrings);
begin
Code.AddStrings(Strings);
end;
procedure TScriptManager.CodeDeleteLine(Index: Integer);
begin
Code.Delete(Index);
end;
procedure TScriptManager.CodeLoadFromFile(FileName: String);
begin
Code.LoadFromFile(FileName);
if ReturnMode = srAll then
begin
AddLog('Script code loaded successfully');
end;
if Assigned(OnCodeLoad) then
begin
OnCodeLoad(Self);
end;
end;
procedure TScriptManager.CodeLoadFromStream(Stream: TStream);
begin
Code.LoadFromStream(Stream);
if ReturnMode = srAll then
begin
AddLog('Script code loaded successfully');
end;
if Assigned(OnCodeLoad) then
begin
OnCodeLoad(Self);
end;
end;
procedure TScriptManager.CodeAssign(Source: TPersistent);
begin
Code.Assign(Source);
if ReturnMode = srAll then
begin
AddLog('Script code assigned successfully');
end;
if Assigned(OnCodeAssign) then
begin
OnCodeAssign(Self);
end;
end;
procedure TScriptManager.CodeClear;
begin
Code.Clear;
if ReturnMode = srAll then
begin
AddLog('Script code cleared successfully');
end;
end;
function TScriptManager.ScriptEngineNeedFile(Sender:TObject; const OriginFileName: AnsiString; var FileName, Output: AnsiString): Boolean;
begin
Result := ScriptEngine.OnNeedFile(Sender,OriginFileName,FileName,Output);
@ -699,13 +592,6 @@ begin
AddMethod(Self,@TScriptManager.PS_About,'procedure About');
if SecureMode = False then
begin
AddMethod(Self,@TScriptManager.CodeAddLine,'function CodeAddLine(const S: String): Integer)');
AddMethod(Self,@TScriptManager.CodeAddLines,'procedure CodeAddLines(Strings: TStrings)');
AddMethod(Self,@TScriptManager.CodeDeleteLine,'procedure CodeDeleteLine(Index: Integer)');
AddMethod(Self,@TScriptManager.CodeLoadFromFile,'procedure CodeLoadFromFile(FileName: String)');
AddMethod(Self,@TScriptManager.CodeLoadFromStream,'procedure CodeLoadFromStream(Stream: TStream)');
AddMethod(Self,@TScriptManager.CodeAssign,'procedure CodeAssign(Source: TPersistent)');
AddMethod(Self,@TScriptManager.CodeClear,'procedure CodeClear');
AddMethod(Self,@TScriptManager.CompileAndExecute,'function CompileAndExecute: Boolean');
end;
end;
@ -752,10 +638,6 @@ begin
begin
//... Nur definieren falls verwendet/benötigt!
end;
if Assigned(OnLine) then
begin
OnLine(Self);
end;
end;
function TScriptManager.PS_Random(LimitPlusOne: Integer): Integer;
@ -796,10 +678,10 @@ end;
procedure TScriptManager.PS_About;
begin
MessageDlg(ScriptManagerComponent_Name + ' Component v'
+ FloatToStr(ScriptManagerComponent_Version) + #10
+ 'For: Borland Delphi' + #10
+ FloatToStr(ScriptManagerComponent_Version) + sLineBreak
+ 'For: Borland Delphi' + sLineBreak
+ ScriptManagerComponent_Copyright + ' by '
+ ScriptManagerComponent_Author + #10
+ ScriptManagerComponent_Author + sLineBreak
+ 'Requires and uses: RemObjects PascalScript component library',
mtInformation,[mbOK],0);
end;

View File

@ -42,6 +42,9 @@ type
TPointList = TList<TPoint>;
{$ENDIF}
{ Typisierte Arrays }
TPointerArray = array of Pointer;
TPCharArray = array of PChar;
TVariantArray = array of Variant;
TStringArray = array of String;
@ -68,6 +71,78 @@ type
TPointArray = array of TPoint;
TReferenceData = record
Value: Pointer;
Reference: PPointer;
end;
TReferenceDataArray = array of TReferenceData;
PReferenceData = ^TReferenceData;
PReferenceDataArray = ^TReferenceDataArray;
TRefDataReferenceData = record
Value: Pointer;
Reference: PReferenceData;
end;
TRefDataReferenceDataArray = array of TRefDataReferenceData;
TRefDataArrayReferenceData = record
Value: Pointer;
Reference: PReferenceDataArray;
end;
TRefDataArrayReferenceDataArray = array of TRefDataArrayReferenceData;
TStringReferenceData = record
Value: String;
Reference: PString;
end;
TStringReferenceDataArray = array of TStringReferenceData;
PStringReferenceData = ^TStringReferenceData;
PStringReferenceDataArray = ^TStringReferenceDataArray;
TStringRefDataReferenceData = record
Value: String;
Reference: PStringReferenceData;
end;
TStringRefDataReferenceDataArray = array of TStringRefDataReferenceData;
TStringRefDataArrayReferenceData = record
Value: String;
Reference: PStringReferenceDataArray;
end;
TStringRefDataArrayReferenceDataArray = array of TStringRefDataArrayReferenceData;
TIntegerReferenceData = record
Value: Integer;
Reference: PInteger;
end;
TIntegerReferenceDataArray = array of TIntegerReferenceData;
PIntegerReferenceData = ^TIntegerReferenceData;
PIntegerReferenceDataArray = ^TIntegerReferenceDataArray;
TIntegerRefDataReferenceData = record
Value: Integer;
Reference: PIntegerReferenceData;
end;
TIntegerRefDataReferenceDataArray = array of TIntegerRefDataReferenceData;
TIntegerRefDataArrayReferenceData = record
Value: Integer;
Reference: PIntegerReferenceDataArray;
end;
TIntegerRefDataArrayReferenceDataArray = array of TIntegerRefDataArrayReferenceData;
TFloatReferenceData = record
Value: Extended;
Reference: PExtended;
end;
TFloatReferenceDataArray = array of TFloatReferenceData;
PFloatReferenceData = ^TFloatReferenceData;
PFloatReferenceDataArray = ^TFloatReferenceDataArray;
TFloatRefDataReferenceData = record
Value: Extended;
Reference: PFloatReferenceData;
end;
TFloatRefDataReferenceDataArray = array of TFloatRefDataReferenceData;
TFloatRefDataArrayReferenceData = record
Value: Extended;
Reference: PFloatReferenceDataArray;
end;
TFloatRefDataArrayReferenceDataArray = array of TFloatRefDataArrayReferenceData;
TCycle = record
private
{ Private-Deklarationen }
@ -137,6 +212,14 @@ type
function ArrayPos(const AValue: Double; const AArray: array of Double): Integer; overload;
function ArrayPos(const AValue: Real; const AArray: array of Real): Integer; overload;
function ArrayPos(const AValue: Extended; const AArray: array of Extended): Integer; overload;
function ArrayPos(const AValue: Pointer; const AArray: array of TReferenceData): Integer; overload;
function ArrayPos(const AValue: String; const AArray: array of TStringReferenceData): Integer; overload;
function ArrayPos(const AValue: Integer; const AArray: array of TIntegerReferenceData): Integer; overload;
function ArrayPos(const AValue: Extended; const AArray: array of TFloatReferenceData): Integer; overload;
function ArrayPos(const AValue: Pointer; const AArray: array of TRefDataArrayReferenceData): Integer; overload;
function ArrayPos(const AValue: String; const AArray: array of TStringRefDataArrayReferenceData): Integer; overload;
function ArrayPos(const AValue: Integer; const AArray: array of TIntegerRefDataArrayReferenceData): Integer; overload;
function ArrayPos(const AValue: Extended; const AArray: array of TFloatRefDataArrayReferenceData): Integer; overload;
{ TComponent Laden/Speichern }
procedure ComponentSaveToFile(const FileName: String; Component: TComponent);
procedure ComponentLoadFromFile(const FileName: String; Component: TComponent);
@ -161,6 +244,7 @@ type
function PQFormula(P,Q: Extended): TExtendedArray; overload;
{ Sonstige }
function SecToTime(const Sec: Cardinal): TTime;
function GetExecTime(Command: Pointer; Amount: Cardinal; Attempts: Cardinal = 1): Cardinal;
function SystemLanguage: String;
function ExtractUserName(const Owner: String): String;
function ExtractUserDomain(const Owner: String): String;
@ -173,6 +257,9 @@ type
const
Spaces = [#9,#10,#13,#32,#160];
Numbers = ['0'..'9'];
Letters = ['A'..'Z','a'..'z'];
Operators = ['+','-','*','/'];
SE_DEBUG_NAME = 'SeDebugPrivilege';
implementation
@ -350,7 +437,7 @@ asm
JMP @Fin
@Low:
ADD [EAX],360
JMP @Cmp_High
JMP @Cmp_Low
@High:
SUB [EAX],360
JMP @Cmp_High
@ -496,17 +583,46 @@ end;
function SecToTime(const Sec: Cardinal): TTime;
var
Hours, Minutes, Seconds: Word;
Hrs, Mins: Word;
begin
if Sec <= 0 then
begin
Result := StrToTime('00:00:00');
Exit;
end;
Hours := Sec div 3600;
Minutes := Sec div 60 - Hours * 60;
Seconds := Sec - (Hours * 3600 + Minutes * 60) ;
Result := StrToTime(IntToStr(Hours) + ':' + IntToStr(Minutes) + ':' + IntToStr(Seconds));
Hrs := Sec div 3600;
Mins := Sec div 60 - Hrs * 60;
Result := StrToTime(IntToStr(Hrs) + ':' + IntToStr(Mins) + ':' + IntToStr(Sec - (Hrs * 3600 + Mins * 60)));
end;
function GetExecTime(Command: Pointer; Amount: Cardinal; Attempts: Cardinal = 1): Cardinal;
var
Index_Amount: Cardinal;
Index_Attempts: Cardinal;
Tick_Start: Cardinal;
Tick_Finish: Cardinal;
begin
if (Assigned(Command) = False) or (Amount = 0) or (Attempts = 0) then
begin
Exit;
end;
Result := 0;
try
for Index_Attempts := 1 to Attempts do
begin
for Index_Amount := 1 to Amount do
begin
Tick_Start := GetTickCount;
asm
CALL [Command]
end;
Tick_Finish := GetTickCount;
Inc(Result,Tick_Finish - Tick_Start);
end;
end;
finally
Result := Result div Index_Attempts;
end;
end;
function SystemLanguage: String;
@ -742,6 +858,126 @@ begin
end;
end;
function ArrayPos(const AValue: Pointer; const AArray: array of TReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: String; const AArray: array of TStringReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: Integer; const AArray: array of TIntegerReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: Extended; const AArray: array of TFloatReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: Pointer; const AArray: array of TRefDataArrayReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: String; const AArray: array of TStringRefDataArrayReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: Integer; const AArray: array of TIntegerRefDataArrayReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ArrayPos(const AValue: Extended; const AArray: array of TFloatRefDataArrayReferenceData): Integer; overload;
var
Index: Integer;
begin
Result := Low(AArray) - 1;
for Index := Low(AArray) to High(AArray) do
begin
if AArray[Index].Value = AValue then
begin
Result := Index;
Exit;
end;
end;
end;
function ExtractUserName(const Owner: String): String;
var
Index: Integer;