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.15a

Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
Dennis07
2016-02-12 06:06:47 +01:00
parent 13370e478b
commit 43339d5a24
29 changed files with 693 additions and 122 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
These statistics cover the official repository of Lina Components.
Total lines of code (LoC): 12000+
Total visual components (VC): 20
Total lines of code (LoC): 13600+
Total visual components (VC): 22

View File

@@ -50,7 +50,6 @@ requires
contains
uBase in '..\..\Source\uBase.pas',
uSysCtrls in '..\..\Source\uSysCtrls.pas',
uCrypt in '..\..\Source\uCrypt.pas',
uFileTools in '..\..\Source\uFileTools.pas',
uFrmCtrls in '..\..\Source\uFrmCtrls.pas',
uLocalMgr in '..\..\Source\uLocalMgr.pas',

View File

@@ -122,7 +122,6 @@
<DCCReference Include="IndyCore.dcp"/>
<DCCReference Include="..\..\Source\uBase.pas"/>
<DCCReference Include="..\..\Source\uSysCtrls.pas"/>
<DCCReference Include="..\..\Source\uCrypt.pas"/>
<DCCReference Include="..\..\Source\uFileTools.pas"/>
<DCCReference Include="..\..\Source\uFrmCtrls.pas"/>
<DCCReference Include="..\..\Source\uLocalMgr.pas"/>

View File

@@ -1,53 +1,53 @@
<?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.592,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uFileTools.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.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.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.650,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uBattery.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.204,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.411,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uAdvCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.675,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.938,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.934,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</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.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.325,=dbrtl.dcp</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.934,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</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.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.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.576,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uSysTools.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.648,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uScriptMgr.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.861,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Settings.inc</Transaction>
<Transaction>1899.12.30 00:00:00.000.318,=vcl.dcp</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.938,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\Config.inc</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.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.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.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.896,C:\Users\Dennis G\Documents\CodeQuality.htm=</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.414,C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.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.621,=C:\Users\Dennis\Documents\RAD Studio\Projekte\LinaComponents\uLinaTest.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.971,=IndySystem.dcp</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.075,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCalc.pas</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.686,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\uSysTools.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.196,=rtl.dcp</Transaction>
<Transaction>1899.12.30 00:00:00.000.075,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCalc.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.525,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uCrypt.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.582,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uWebCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.932,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\uFileCtrls.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.412,=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.837,=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.674,=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.173,C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Package\Delphi_XE5\Unit1.pas=C:\Users\Dennis G\Documents\RAD Studio\Projekte\LinaComponents\Source\uInit.pas</Transaction>
<Transaction>1899.12.30 00:00:00.000.791,=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.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"/>
@@ -67,7 +67,6 @@
<File Path="..\..\Source\uAdvCtrls.pas"/>
<File Path="..\..\Source\uBase.pas"/>
<File Path="..\..\Source\uCalc.pas"/>
<File Path="..\..\Source\uCrypt.pas"/>
<File Path="..\..\Source\uFileCtrls.pas"/>
<File Path="..\..\Source\uFileTools.pas"/>
<File Path="..\..\Source\uFrmCtrls.pas"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

View File

@@ -35,6 +35,9 @@ TPAINTMEMO32 BITMAP "Bitmap\Large\TPaintMemo.bmp"
TPARAMDEFINER BITMAP "Bitmap\TParamDefiner.bmp"
TPARAMDEFINER16 BITMAP "Bitmap\Small\TParamDefiner.bmp"
TPARAMDEFINER32 BITMAP "Bitmap\Large\TParamDefiner.bmp"
TPATHEDIT BITMAP "Bitmap\TPathEdit.bmp"
TPATHEDIT16 BITMAP "Bitmap\Small\TPathEdit.bmp"
TPATHEDIT32 BITMAP "Bitmap\Large\TPathEdit.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.

Binary file not shown.

Binary file not shown.

View File

@@ -13,7 +13,7 @@ interface
uses
{ Standard-Units }
SysUtils, Classes, StdCtrls, ExtCtrls, Windows, Messages, Graphics, Controls,
Printers, Contnrs, Forms, Math,
Printers, Contnrs, Forms, Math, ShLwApi,
{ Andere Package-Units }
uBase, uSysTools, uFileTools;
@@ -23,6 +23,7 @@ type
TShortcutLabelState = (slsDefault,slsHovered,slsPressed);
TSizePanelAllow = set of (spaResize,spaMove);
TPanelBorderStyle = bsNone..bsSizeable;
TPathEditPaths = set of (pepURL_History,pepURL_Recent,pepFS_Dirs,pepFS_Shell);
TValueEditAllow = set of (veaNumbers,veaLetters,veaSpaces,veaSeparators,veaOperators,veaOther);
type
@@ -234,6 +235,35 @@ type
property BorderStyle: TPanelBorderStyle read FBorderStyle write SetBorderStyle default bsNone;
end;
{$IFNDEF NO_MULTIPLATFORM}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF}
TPathEdit = class(TEdit)
protected
{ Protected-Deklarationen }
procedure UpdateAutoComplete;
private
{ Private-Deklarationen }
FAbout: TComponentAbout;
FAutoSuggest: Boolean;
FAutoAppend: Boolean;
FPaths: TPathEditPaths;
{ Methoden }
procedure SetPaths(Value: TPathEditPaths);
procedure SetAutoSuggest(Value: Boolean);
procedure SetAutoAppend(Value: Boolean);
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published-Deklarationen }
property About: TComponentAbout read FAbout;
property AutoSuggest: Boolean read FAutoSuggest write SetAutoSuggest default True;
property AutoAppend: Boolean read FAutoAppend write SetAutoAppend default True;
property Paths: TPathEditPaths read FPaths write SetPaths default [pepURL_History,pepURL_Recent,pepFS_Dirs,pepFS_Shell];
end;
{$IFNDEF NO_MULTIPLATFORM}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF}
@@ -292,7 +322,7 @@ implementation
{$IFDEF ADD_COMPONENTREG}
procedure Register;
begin
RegisterComponents(ComponentsPage,[TCommandButton,TScrollListBox,TPaintMemo,TShortcutLabel,TSizePanel,TValueEdit]);
RegisterComponents(ComponentsPage,[TCommandButton,TScrollListBox,TPaintMemo,TShortcutLabel,TSizePanel,TPathEdit,TValueEdit]);
end;
{$ENDIF}
@@ -918,6 +948,83 @@ begin
end;
end;
{ ----------------------------------------------------------------------------
TPathEdit
---------------------------------------------------------------------------- }
constructor TPathEdit.Create(AOwner: TComponent);
begin
inherited;
FAbout := TComponentAbout.Create(TPathEdit);
FAutoSuggest := True;
FAutoAppend := True;
FPaths := [pepURL_History,pepURL_Recent,pepFS_Dirs,pepFS_Shell];
end;
destructor TPathEdit.Destroy;
begin
FAbout.Free;
inherited;
end;
procedure TPathEdit.SetPaths(Value: TPathEditPaths);
begin
UpdateAutoComplete;
FPaths := Value;
end;
procedure TPathEdit.SetAutoSuggest(Value: Boolean);
begin
UpdateAutoComplete;
FAutoSuggest := Value;
end;
procedure TPathEdit.SetAutoAppend(Value: Boolean);
begin
UpdateAutoComplete;
FAutoAppend := Value;
end;
procedure TPathEdit.UpdateAutoComplete;
const
SHACF_FILESYS_DIRS = $00000020;
var
AutoCompleteOptions: DWORD;
begin
if AutoSuggest = True then
begin
AutoCompleteOptions := SHACF_AUTOSUGGEST_FORCE_ON;
end else
begin
AutoCompleteOptions := SHACF_AUTOSUGGEST_FORCE_OFF;
end;
if AutoAppend = True then
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_AUTOAPPEND_FORCE_ON;
end else
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_AUTOAPPEND_FORCE_OFF;
end;
if pepURL_History in Paths then
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_URLHISTORY;
end;
if pepURL_Recent in Paths then
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_URLMRU;
end;
if pepFS_Dirs in Paths then
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_FILESYS_DIRS;
end;
if pepFS_Shell in Paths then
begin
AutoCompleteOptions := AutoCompleteOptions or SHACF_FILESYSTEM;
end;
AutoCompleteOptions := AutoCompleteOptions or SHACF_FILESYS_ONLY;
SHAutoComplete(Self.Handle,AutoCompleteOptions or SHACF_FILESYS_ONLY);
end;
{ ----------------------------------------------------------------------------
TValueEdit
---------------------------------------------------------------------------- }

View File

@@ -280,11 +280,11 @@ begin
Key := ExtStrToRegKey(Ext) + ContextRegPathShell;
with ARegistry do
begin
OpenKey(Key + '\' + AName,True);
OpenKey(Key + PathDelim + AName,True);
WriteString('',ACaption);
WriteString('icon',AIcon);
CloseKey;
OpenKey(Key + '\' + AName + ContextRegPathCommand,True);
OpenKey(Key + PathDelim + AName + ContextRegPathCommand,True);
WriteString('',ACommand);
CloseKey;
end;
@@ -331,7 +331,7 @@ begin
if Reg.KeyExists(SubKeys.Strings[Index] + ContextRegPathCommand) = True then
begin
Reg.CloseKey;
Reg.OpenKeyReadOnly(Key + '\' + SubKeys.Strings[Index]);
Reg.OpenKeyReadOnly(Key + PathDelim + SubKeys.Strings[Index]);
if Reg.ValueExists('') = True then
begin
Cptn := Reg.ReadString('');
@@ -347,7 +347,7 @@ begin
Icn := '';
end;
Reg.CloseKey;
Reg.OpenKeyReadOnly(Key + '\' + SubKeys.Strings[Index] + ContextRegPathCommand);
Reg.OpenKeyReadOnly(Key + PathDelim + SubKeys.Strings[Index] + ContextRegPathCommand);
if Reg.ValueExists('') = True then
begin
Cmd := Reg.ReadString('');

View File

@@ -22,6 +22,7 @@ type
{ Fehlermeldungen }
EWinUserInformation = class(Exception);
EStringCharAccess = class(Exception);
EInvalidBFCommand = class(Exception);
type
{ Hilfsklassen }
@@ -65,7 +66,7 @@ type
TFloatArray = array of Extended;
TSingleArray = array of Single;
TDoubleArray = array of Double;
TRealArray = array of Real;
TRealArray = TDoubleArray;
TExtendedArray = TFloatArray;
TPointArray = array of TPoint;
@@ -216,8 +217,8 @@ type
end;
{ Typenumwandelungen }
function BoolToInt(B: Boolean): Integer;
function IntToBool(Value: Integer): Boolean;
function BoolToInt(B: Boolean): Integer; inline;
function IntToBool(Value: Integer): Boolean; inline;
{ Typen-�quivalenz-Pr�fungen }
function StrIsInt(const S: String): Boolean;
function StrIsFloat(const S: String): Boolean;
@@ -270,21 +271,25 @@ type
procedure NormalizeDeg(var X: Integer); overload;
procedure NormalizeDeg(var X: Single); overload;
procedure NormalizeDeg(var X: Double); overload;
procedure NormalizeDeg(var X: Real); overload;
procedure NormalizeDeg(var X: Extended); overload;
{ PQ-Formel }
function PQFormula(P,Q: Single): TSingleArray; overload;
function PQFormula(P,Q: Double): TDoubleArray; overload;
function PQFormula(P,Q: Real): TRealArray; overload;
function PQFormula(P,Q: Extended): TExtendedArray; overload;
{ Gleitkomma-Modulo }
function FloatMod(X,Y: Single): Single; overload;
function FloatMod(X,Y: Double): Double; overload;
function FloatMod(X,Y: Real): Real; overload;
function FloatMod(X,Y: Extended): Extended; overload;
{ GGT ("GCD") / KGV ("LCM") }
function GCD(A,B: Byte): Byte; overload;
function GCD(A,B: Word): Word; overload;
function GCD(A,B: Cardinal): Cardinal; overload;
function LCM(A,B: Byte): Word; overload;
function LCM(A,B: Word): Cardinal; overload;
function LCM(A,B: Cardinal): Cardinal; overload;
{ Summenformel }
function SumOf(Value: Byte; Offset: Byte = 1): Byte; overload;
function SumOf(Value: Word; Offset: Word = 1): Word; overload;
function SumOf(Value: Byte; Offset: Byte = 1): Word; overload;
function SumOf(Value: Word; Offset: Word = 1): Cardinal; overload;
function SumOf(Value: Cardinal; Offset: Cardinal = 1): Cardinal; overload;
{ Addition numerischer Arrays }
function ArrayAdd(A,B: array of ShortInt): TShortIntArray; overload;
@@ -296,8 +301,19 @@ type
function ArrayAdd(A,B: array of Cardinal): TCardinalArray; overload;
function ArrayAdd(A,B: array of Single): TSingleArray; overload;
function ArrayAdd(A,B: array of Double): TDoubleArray; overload;
function ArrayAdd(A,B: array of Real): TRealArray; overload;
function ArrayAdd(A,B: array of Extended): TExtendedArray; overload;
{ Sortier-Algorithmen }
procedure BubbleSort(var Elements: array of String); overload;
procedure BubbleSort(var Elements: array of ShortInt); overload;
procedure BubbleSort(var Elements: array of SmallInt); overload;
procedure BubbleSort(var Elements: array of Integer); overload;
procedure BubbleSort(var Elements: array of Int64); overload;
procedure BubbleSort(var Elements: array of Byte); overload;
procedure BubbleSort(var Elements: array of Word); overload;
procedure BubbleSort(var Elements: array of Cardinal); overload;
procedure BubbleSort(var Elements: array of Single); overload;
procedure BubbleSort(var Elements: array of Double); overload;
procedure BubbleSort(var Elements: array of Extended); overload;
{ RTTI-Werzeuge }
function GetSubPropInfo(Instance: TObject; const PropName: String; AKinds: TTypeKinds = []): PPropInfo;
function GetObjectSubProp(Instance: TObject; const PropName: String): TObject;
@@ -375,7 +391,10 @@ type
{$ENDIF}
function ConsistsOf(const S: String; Chars: array of Char): Boolean; overload;
function ConsistsOf(const S: String; Chars: TCharSet): Boolean; overload;
procedure Exchange(var X,Y); inline;
procedure PrintText(Strings: TStrings; Font: TFont);
procedure BFInterpret(const S: String; var P: Pointer); overload;
procedure BFInterpret(const S: String; var P: Pointer; var ReadBuffer, WriteBuffer: TIntegerArray); overload;
procedure ExtractChars(var Text: String; Chars: array of Char); overload;
procedure ExtractChars(var Text: String; Chars: TCharSet); overload;
procedure SetPrivilege(const Name: PChar; Value: Boolean); overload;
@@ -430,12 +449,12 @@ implementation
uses
uFileTools;
function BoolToInt(B: Boolean): Integer;
function BoolToInt(B: Boolean): Integer; inline;
begin
Result := -Integer(B);
end;
function IntToBool(Value: Integer): Boolean;
function IntToBool(Value: Integer): Boolean; inline;
begin
Result := (Value <> 0);
end;
@@ -524,8 +543,8 @@ begin
end;
end;
{$IFDEF PUREPASCAL}
procedure ToZero(var X: LongInt);
{$IFDEF PUREPASCAL}
begin
if X < 0 then
begin
@@ -537,21 +556,20 @@ begin
end;
end;
{$ELSE}
procedure ToZero(var X: Integer); assembler;
asm
CMP [EAX],0
JE @Zer
JL @Neg
SUB [EAX],1
JMP @Zer
RET
@Neg:
ADD [EAX],1
@Zer:
end;
{$ENDIF}
{$IFDEF PUREPASCAL}
procedure ToInf(var X: LongInt);
{$IFDEF PUREPASCAL}
begin
if X < 0 then
begin
@@ -563,21 +581,20 @@ begin
end;
end;
{$ELSE}
procedure ToInf(var X: Integer); assembler;
asm
CMP [EAX],0
JE @Zer
JL @Neg
ADD [EAX],1
JMP @Zer
RET
@Neg:
SUB [EAX],1
@Zer:
end;
{$ENDIF}
procedure NormalizeDeg(var X: Integer);
{$IFDEF PUREPASCAL}
procedure NormalizeDeg(var X: LongInt);
begin
while X >= 360 do
begin
@@ -589,7 +606,6 @@ begin
end;
end;
{$ELSE}
procedure NormalizeDeg(var X: Integer); assembler;
asm
@Cmp_Low:
CMP [EAX],0
@@ -597,14 +613,13 @@ asm
@Cmp_High:
CMP [EAX],360
JGE @High
JMP @Fin
RET
@Low:
ADD [EAX],360
JMP @Cmp_Low
@High:
SUB [EAX],360
JMP @Cmp_High
@Fin:
end;
{$ENDIF}
@@ -632,18 +647,6 @@ begin
end;
end;
procedure NormalizeDeg(var X: Real); overload;
begin
while X >= 360 do
begin
X := X - 360;
end;
while X < 0 do
begin
X := X + 360;
end;
end;
procedure NormalizeDeg(var X: Extended); overload;
begin
while X >= 360 do
@@ -700,28 +703,6 @@ begin
end;
end;
function PQFormula(P,Q: Real): TRealArray;
var
Root: Real;
begin
Root := Sqr(P / 2) - Q;
if Root < 0 then
begin
SetLength(Result,0);
end else
begin
if Root = 0 then
begin
SetLength(Result,1);
end else
begin
SetLength(Result,2);
Result[1] := -(P / 2) - Sqrt(Root);
end;
Result[0] := -(P / 2) + Sqrt(Root);
end;
end;
function PQFormula(P,Q: Extended): TExtendedArray;
var
Root: Extended;
@@ -754,17 +735,129 @@ begin
Result := X - Y * Trunc(X / Y);
end;
function FloatMod(X,Y: Real): Real;
begin
Result := X - Y * Trunc(X / Y);
end;
function FloatMod(X,Y: Extended): Extended;
begin
Result := X - Y * Trunc(X / Y);
end;
function SumOf(Value: Byte; Offset: Byte = 1): Byte;
function GCD(A,B: Byte): Byte; overload;
begin
if B <> 0 then
begin
if A > B then
begin
Result := B;
B := A;
A := Result;
end else
begin
if A <> 0 then
begin
Result := A;
end else
begin
Result := 0;
Exit;
end;
end;
while (A mod Result <> 0) or (B mod Result <> 0) do
begin
Dec(Result);
end;
end else
begin
Result := 0;
end;
end;
function GCD(A,B: Word): Word; overload;
begin
if B <> 0 then
begin
if A > B then
begin
Result := B;
B := A;
A := Result;
end else
begin
if A <> 0 then
begin
Result := A;
end else
begin
Result := 0;
Exit;
end;
end;
while (A mod Result <> 0) or (B mod Result <> 0) do
begin
Dec(Result);
end;
end else
begin
Result := 0;
end;
end;
function GCD(A,B: Cardinal): Cardinal; overload;
begin
if B <> 0 then
begin
if A > B then
begin
Result := B;
B := A;
A := Result;
end else
begin
if A <> 0 then
begin
Result := A;
end else
begin
Result := 0;
Exit;
end;
end;
while (A mod Result <> 0) or (B mod Result <> 0) do
begin
Dec(Result);
end;
end else
begin
Result := 0;
end;
end;
function LCM(A,B: Byte): Word; overload;
begin
Result := GCD(A,B);
if Result <> 0 then
begin
Result := A * B div Result;
end;
end;
function LCM(A,B: Word): Cardinal; overload;
begin
Result := GCD(A,B);
if Result <> 0 then
begin
Result := A * B div Result;
end;
end;
function LCM(A,B: Cardinal): Cardinal; overload;
begin
Result := GCD(A,B);
if Result <> 0 then
begin
Result := A * B div Result;
end;
end;
function SumOf(Value: Byte; Offset: Byte = 1): Word;
begin
if Offset < Value then
begin
@@ -775,7 +868,7 @@ begin
end;
end;
function SumOf(Value: Word; Offset: Word = 1): Word;
function SumOf(Value: Word; Offset: Word = 1): Cardinal;
begin
if Offset < Value then
begin
@@ -842,14 +935,295 @@ begin
end;
function ArrayAdd(A,B: array of Real): TRealArray;
function ArrayAdd(A,B: array of Extended): TExtendedArray;
begin
end;
function ArrayAdd(A,B: array of Extended): TExtendedArray;
procedure BubbleSort(var Elements: array of String); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: String;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if AnsiCompareText(Elements[Index],Elements[Index + 1]) > 0 then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of ShortInt); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: ShortInt;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of SmallInt); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: SmallInt;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Integer); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Integer;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Int64); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Int64;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Byte); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Byte;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Word); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Word;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Cardinal); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Cardinal;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Single); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Single;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Double); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Double;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
procedure BubbleSort(var Elements: array of Extended); overload;
var
Changed: Boolean;
Index: Integer;
Buffer: Extended;
begin
Changed := True;
while Changed = True do
begin
Changed := False;
for Index := Low(Elements) to High(Elements) - 1 do
begin
if Elements[Index] > Elements[Index + 1] then
begin
Buffer := Elements[Index];
Elements[Index] := Elements[Index + 1];
Elements[Index + 1] := Buffer;
if Changed = False then
begin
Changed := True;
end;
end;
end;
end;
end;
function GetSubPropInfo(Instance: TObject; const PropName: String; AKinds: TTypeKinds = []): PPropInfo;
@@ -1437,8 +1811,8 @@ begin
end;
end;
{$IFDEF PUREPASCAL}
function Factional(X: Byte): Cardinal;
{$IFDEF PUREPASCAL}
var
Index: Integer;
begin
@@ -1449,7 +1823,6 @@ begin
end;
end;
{$ELSE}
function Factional(X: Byte): Cardinal; assembler;
asm
MOV ECX,EAX
MOV EAX,1
@@ -1597,9 +1970,7 @@ begin
for Index_Amount := 1 to Amount do
begin
Tick_Start := GetTickCount;
asm
CALL [Command]
end;
TProcedure(Command);
Tick_Finish := GetTickCount;
Inc(Result,Tick_Finish - Tick_Start);
end;
@@ -2382,6 +2753,23 @@ begin
end;
{$ENDIF}
function ConsistsOf(const S: String; Chars: array of Char): Boolean; overload;
var
Current: PChar;
begin
Current := PChar(S);
while Current^ <> #0 do
begin
if ArrayPos(Current^,Chars) = -1 then
begin
Result := False;
Exit;
end;
Inc(Current);
end;
Result := True;
end;
function ConsistsOf(const S: String; Chars: TCharSet): Boolean; overload;
var
Current: PChar;
@@ -2399,21 +2787,13 @@ begin
Result := True;
end;
function ConsistsOf(const S: String; Chars: array of Char): Boolean; overload;
procedure Exchange(var X,Y); inline;
var
Current: PChar;
Buffer: Pointer;
begin
Current := PChar(S);
while Current^ <> #0 do
begin
if ArrayPos(Current^,Chars) = -1 then
begin
Result := False;
Exit;
end;
Inc(Current);
end;
Result := True;
Buffer := Pointer(X);
Pointer(X) := Pointer(Y);
Pointer(Y) := Buffer;
end;
procedure PrintText(Strings: TStrings; Font: TFont);
@@ -2437,6 +2817,90 @@ begin
end;
end;
procedure BFInterpret(const S: String; var P: Pointer);
{ Liest einen BF-Quelltext "S" ein und ver�ndert den Zeiger "P" entsprechend.
Ung�ltige Zeichen l�sen eine Fehlermeldung aus. Eingaben werden aus der
aktuellen Datei oder der Konsole eingelesen und Ausgaben dort ausgegeben. }
var
Current: PChar;
begin
if P <> nil then
begin
Current := PChar(S);
while Current^ <> #0 do
begin
case Current^ of
'>': Inc(Integer(P));
'<': Dec(Integer(P));
'+': Inc(Integer(P^));
'-': Dec(Integer(P^));
'.': Write(Integer(P^));
',': Read(Integer(P^));
'[': if Integer(P^) = 0 then
begin
repeat
Inc(Current);
until Current^ = ']';
end;
']': if Integer(P^) <> 0 then
begin
repeat
Dec(Current);
until Pred(Current^) = '[';
end;
else raise EInvalidBFCommand.Create('Invalid character in BF source code: "' + Current^ + '"');
end;
Inc(Current);
end;
end;
end;
procedure BFInterpret(const S: String; var P: Pointer; var ReadBuffer, WriteBuffer: TIntegerArray);
{ Siehe Methode "BFInterpret(String,Pointer)".
Eingaben werden aus "ReadBuffer" eingelesen und Ausgaben in "WriteBuffer"
ausgegeben. }
var
Current: PChar;
Reader: PInteger;
begin
if P <> nil then
begin
Current := PChar(S);
Reader := PInteger(ReadBuffer);
while Current^ <> #0 do
begin
case Current^ of
'>': Inc(Integer(P));
'<': Dec(Integer(P));
'+': Inc(Integer(P^));
'-': Dec(Integer(P^));
'.': begin
SetLength(WriteBuffer,Length(WriteBuffer) + 1);
WriteBuffer[Length(WriteBuffer) - 1] := Integer(P^);
end;
',': begin
Integer(P^) := Reader^;
Inc(Reader);
end;
'[': if Integer(P^) = 0 then
begin
repeat
Inc(Current);
until Current^ = ']';
end;
']': if Integer(P^) <> 0 then
begin
repeat
Dec(Current);
until Pred(Current^) = '[';
end;
else raise EInvalidBFCommand.Create('Invalid character in BF source code: "' + Current^ + '"');
end;
Inc(Current);
end;
end;
end;
procedure ExtractChars(var Text: String; Chars: array of Char); overload;
var
Current: PChar;

View File

@@ -54,8 +54,8 @@ type
TVirtualProgram = class(TComponent)
private
{ Private-Deklarationen }
FObjects: TVirtualObjects;
FAbout: TComponentAbout;
FObjects: TVirtualObjects;
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
@@ -83,12 +83,12 @@ implementation
constructor TVirtualProgram.Create(AOwner: TComponent);
begin
inherited;
//...
FAbout := TComponentAbout.Create(TVirtualProgram);
end;
destructor TVirtualProgram.Destroy;
begin
//...
FAbout.Free;
inherited;
end;