1
0
mirror of https://bitbucket.org/Dennis07/lina-components.git synced 2025-08-24 21:49:04 +02:00

Version 1.0 DEV 1.10

Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Dennis07
2014-09-28 04:48:34 +02:00
parent 6de12fccc1
commit 9e90ffe3c3
20 changed files with 243 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
These statistics cover the official repository of Lina Components.
Total lines of code (LoC): 5300+
Total visual components (VC): 13
Total lines of code (LoC): 5500+
Total visual components (VC): 14

Binary file not shown.

View File

@@ -19,6 +19,9 @@ TLOCALIZATIONMANAGER32 BITMAP "Bitmap\Large\TLocalizationManager.bmp"
TPAINTMEMO BITMAP "Bitmap\TPaintMemo.bmp"
TPAINTMEMO16 BITMAP "Bitmap\Small\TPaintMemo.bmp"
TPAINTMEMO32 BITMAP "Bitmap\Large\TPaintMemo.bmp"
TPARAMDEFINER BITMAP "Bitmap\TParamDefiner.bmp"
TPARAMDEFINER16 BITMAP "Bitmap\Small\TParamDefiner.bmp"
TPARAMDEFINER32 BITMAP "Bitmap\Large\TParamDefiner.bmp"
TPROCESSMANAGER BITMAP "Bitmap\TProcessManager.bmp"
TPROCESSMANAGER16 BITMAP "Bitmap\Small\TProcessManager.bmp"
TPROCESSMANAGER32 BITMAP "Bitmap\Large\TProcessManager.bmp"

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

@@ -10,7 +10,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes, StdCtrls, Windows, Messages, Graphics, Controls,
SysUtils, Classes, StdCtrls, Windows, Messages, Graphics, Controls, Printers,
{ Andere Package-Units }
uBase;

View File

@@ -15,6 +15,11 @@ uses
{ Andere Package-Units }
uBase, uSysTools, uSysCtrls, uWebCtrls;
type
{ Fehlermeldungen }
EParamNotFound = class(Exception);
EInvalidParamIdentifier = class(Exception);
type
{ Hilfsklassen }
TSplashScreenMode = (ssmDefault,ssmModal);
@@ -31,6 +36,7 @@ type
TSplashChangeEvent = procedure(Sender: TObject) of object;
TSplashTimerEvent = procedure(Sender: TObject) of object;
TComponentManagerUpdateEvent = procedure(Sender: TObject) of object;
TParamDefinerUpdateEvent = procedure(Sender: TObject) of object;
type
{ Hauptklassen }
@@ -371,15 +377,19 @@ type
property Seperator: String read FSeperator write FSeperator;
end;
TParamReference = class(TPersistent)
TParamReference = class(TCollectionItem)
private
{ Private-Deklarationen }
FDefaultValue: String;
FIdentifier: String;
FConnector: PString;
FFormat: TParamFormat;
{ Methoden }
procedure SetIdentifier(Value: String);
procedure SetFormat(Value: TParamFormat);
public
{ Public-Deklarationen }
constructor Create(AConnector: PString);
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Update;
{ Eigenschaften }
@@ -387,21 +397,33 @@ type
published
{ Published-Deklarationen }
property DefaultValue: String read FDefaultValue write FDefaultValue;
property Format: TParamFormat read FFormat write FFormat;
property Identifier: String read FIdentifier write SetIdentifier;
property Format: TParamFormat read FFormat write SetFormat;
end;
TParamReferences = class(TCollection);
TParamDefiner = class(TComponent)
private
{ Private-Deklarationen }
FAbout: TComponentAbout;
FReferences: TParamReferences;
{ Ereignisse }
FUpdateEvent: TParamDefinerUpdateEvent;
{ Methoden }
procedure SetReferences(Value: TParamReferences);
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Update;
published
{ Published-Deklarationen }
{ Ereignisse }
property OnUpdate: TParamDefinerUpdateEvent read FUpdateEvent write FUpdateEvent;
{ Eigenschaften }
property About: TComponentAbout read FAbout;
property References: TParamReferences read FReferences write SetReferences;
end;
procedure Register;
@@ -432,7 +454,7 @@ implementation
procedure Register;
begin
RegisterComponents(ComponentsPage,[TSplashScreen,TProgressBarManager,TListBoxManager]);
RegisterComponents(ComponentsPage,[TSplashScreen,TProgressBarManager,TListBoxManager,TParamDefiner]);
end;
{ ----------------------------------------------------------------------------
@@ -1422,7 +1444,10 @@ end;
constructor TParamFormat.Create;
begin
//...
inherited;
FPrefix := '[';
FSuffix := ']';
FSeperator := ':';
end;
destructor TParamFormat.Destroy;
@@ -1435,10 +1460,11 @@ end;
TParamReference
---------------------------------------------------------------------------- }
constructor TParamReference.Create;
constructor TParamReference.Create(Collection: TCollection);
begin
inherited;
FFormat := TParamFormat.Create;
Connector := AConnector;
FIdentifier := ClassName + IntToStr(ID);
end;
destructor TParamReference.Destroy;
@@ -1448,9 +1474,132 @@ begin
inherited;
end;
procedure TParamReference.Update;
procedure TParamReference.SetFormat(Value: TParamFormat);
begin
//...
FFormat := Value;
end;
procedure TParamReference.SetIdentifier(Value: String);
var
Index: Integer;
begin
if Length(Value) > 0 then
begin
for Index := 1 to Length(Value) do
begin
if Value[Index] in Spaces then
begin
raise EInvalidParamIdentifier.Create('"' + Value + '" is not a valid identifier value');
end;
end;
end else
begin
raise EInvalidParamIdentifier.Create('"' + Value + '" is not a valid identifier value');
end;
end;
procedure TParamReference.Update;
var
Value: String;
ParamIndex: Integer;
ParamItem: String;
CharIndex: Integer;
InPrefix: Boolean;
InSep: Boolean;
InDef: Boolean;
InSuffix: Boolean;
begin
Connector^ := DefaultValue;
Value := '';
for ParamIndex := 1 to ParamCount do
begin
InPrefix := True;
InSuffix := False;
InSep := False;
InDef := False;
ParamItem := ParamStr(ParamIndex);
for CharIndex := 1 to Length(ParamItem) do
begin
//[X----]
if InPrefix = True then
begin
if ParamItem[CharIndex] = Format.Prefix[CharIndex] then
begin
if CharIndex = Length(Format.Prefix) then
begin
InPrefix := False;
end;
end else
begin
Break;
end;
end else
begin
//[----X]
if InSuffix = True then
begin
if ParamItem[CharIndex] = Format.Suffix[CharIndex - Length(Format.Prefix + Identifier + Format.Seperator + Value)] then
begin
if CharIndex = Length(ParamItem) then
begin
//--> EXIT <--
Connector^ := Value;
Exit;
end;
end else
begin
Break;
end;
end else
//Identifier [ InIdent := not (InPrefix or InSuffix) ]
begin
//[--X--]
if InSep = True then
begin
if ParamItem[CharIndex] = Format.Seperator[CharIndex - Length(Format.Prefix + Identifier)] then
begin
if CharIndex = Length(Format.Prefix + Identifier + Format.Seperator) then
begin
InSep := False;
InDef := True;
end;
end else
begin
Break;
end;
end else
begin
//[---X-]
if InDef = True then
begin
Value := Value + ParamItem[CharIndex];
if CharIndex = Length(ParamItem) - Length(Format.Suffix) then
begin
InDef := False;
InSuffix := True;
end;
end else
begin
//[-X---]
if ParamItem[CharIndex] = Identifier[CharIndex - Length(Format.Prefix)] then
begin
if CharIndex = Length(Identifier + Format.Prefix) then
begin
InSep := True;
end;
end else
begin
Break;
end;
end;
end;
end;
end;
//For (CharIndex)
end;
//For (ParamIndex)
end;
raise EParamNotFound.Create('Parameter "' + Identifier + '" not found');
end;
{ ----------------------------------------------------------------------------
@@ -1461,14 +1610,39 @@ constructor TParamDefiner.Create;
begin
inherited;
FAbout := TComponentAbout.Create(ParamDefinerComponent_Name,ParamDefinerComponent_Version,ParamDefinerComponent_Copyright,ParamDefinerComponent_Author);
//FReferences := TParamReferences.Create;
FReferences := TParamReferences.Create(TParamReference);
end;
destructor TParamDefiner.Destroy;
begin
FAbout.Free;
// FReferences.Free;
FReferences.Free;
inherited;
end;
procedure TParamDefiner.SetReferences(Value: TParamReferences);
begin
FReferences := Value;
end;
procedure TParamDefiner.Update;
var
Index: Integer;
begin
if References.Count > 0 then
begin
try
for Index := 0 to References.Count - 1 do
begin
(References.Items[Index] as TParamReference).Update;
end;
finally
if Assigned(OnUpdate) = True then
begin
OnUpdate(Self);
end;
end;
end;
end;
end.

View File

@@ -217,6 +217,7 @@ begin
end else
begin
Index := Index + 1;
PluginFound := (Index >= PluginList.Count - 1);
end;
until (PluginFound = True);
end;

View File

@@ -10,7 +10,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes, Math, Windows,
SysUtils, Classes, Math, Windows, Graphics, Printers,
{$IFNDEF NO_GENERIC}
Generics.Collections,
{$ENDIF}
@@ -88,16 +88,18 @@ type
procedure LoadComponentFromFile(const FileName: String; Component: TComponent);
procedure SaveComponentToStream(var Stream: TStream; Component: TComponent);
procedure LoadComponentFromStream(Stream: TStream; Component: TComponent);
{ Char-Case-Umwandelungen }
function CharLowerCase(Character: Char): Char;
function CharUpperCase(Character: Char): Char;
{ Sonstige }
function SecToTime(const Sec: Cardinal): TTime;
function SystemLanguage: String;
function ExtractUserName(const Owner: String): String;
function ExtractUserDomain(const Owner: String): String;
function RoundPos(Number: Extended; Pos: Byte): Extended;
function CharLowerCase(Character: Char): Char;
function CharUpperCase(Character: Char): Char;
function FontSizeToHeight(Size: Integer; PpI: Integer): Integer;
function FontHeightToSize(Height: Integer; PpI: Integer): Integer;
procedure PrintText(Strings: TStrings; Font: TFont);
procedure EnableDebugPrivilege;
const
@@ -182,6 +184,30 @@ begin
Stream.ReadComponentRes(Component);
end;
function CharLowerCase(Character: Char): Char;
{ Basierend auf der Technik von SysUtils.LowerCase, nur simpler/schneller }
begin
if Character in ['A'..'Z'] then
begin
Result := Char(Word(Character) or $0020);
end else
begin
Result := Character;
end;
end;
function CharUpperCase(Character: Char): Char;
{ Basierend auf der Technik von SysUtils.UpperCase, nur simpler/schneller }
begin
if Character in ['a'..'z'] then
begin
Result := Char(Word(Character) xor $0020);
end else
begin
Result := Character;
end;
end;
function SecToTime(const Sec: Cardinal): TTime;
var
TH, TM, TS: String;
@@ -310,30 +336,6 @@ begin
Result := Number / Factor;
end;
function CharLowerCase(Character: Char): Char;
{ Basierend auf der Technik von SysUtils.LowerCase, nur simpler/schneller }
begin
if Character in ['A'..'Z'] then
begin
Result := Char(Word(Character) or $0020);
end else
begin
Result := Character;
end;
end;
function CharUpperCase(Character: Char): Char;
{ Basierend auf der Technik von SysUtils.UpperCase, nur simpler/schneller }
begin
if Character in ['a'..'z'] then
begin
Result := Char(Word(Character) xor $0020);
end else
begin
Result := Character;
end;
end;
function FontSizeToHeight(Size: Integer; PpI: Integer): Integer;
begin
Result := - Size * PpI div 72;
@@ -344,6 +346,27 @@ begin
Result := - Height * 72 div PpI;
end;
procedure PrintText(Strings: TStrings; Font: TFont);
var
Index: Integer;
PrintText: TextFile;
begin
AssignPrn(PrintText);
Rewrite(PrintText);
try
if Font = nil then
begin
Printer.Canvas.Font := Font;
end;
for Index := 0 to Strings.Count - 1 do
begin
Writeln(PrintText, Strings.Strings[Index]);
end;
finally
CloseFile(PrintText);
end;
end;
procedure EnableDebugPrivilege;
var
Token: THandle;