You've already forked lina-components
mirror of
https://bitbucket.org/Dennis07/lina-components.git
synced 2025-08-24 21:49:04 +02:00
Version 1.0 DEV 1.05
Signed-off-by: Dennis07 <den.goehlert@t-online.de>
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
The official version of "Lina Components" with all its belongings,
|
||||
elements and features is maintained by Dennis G�hlert.
|
||||
|
||||
Special thanks go to Sebastian J�nicke for his great help finding
|
||||
solutions for countless problems.
|
||||
solutions for countless problems.
|
||||
|
||||
Other official contributors are:
|
||||
(No contributors are listed)
|
@@ -9,5 +9,5 @@ You can optain the current version online from www.mozilla.org.
|
||||
For a list of all authors who contributed to this project see:
|
||||
"Credits.txt" file.
|
||||
|
||||
INFO: Even if the code contains copyright marks or references,
|
||||
they are overwritten by this document!
|
||||
INFO: Even if the code contains copyright marks or references, they
|
||||
are overwritten by this document!
|
@@ -15,9 +15,20 @@ versions installed:
|
||||
- Delphi XE5
|
||||
- Delphi XE6
|
||||
|
||||
*) The code will run under Turbo-Delphi 2006, but the components
|
||||
won't be available in the components palett of the personal
|
||||
version.
|
||||
You also need to have a version of the following packages installed
|
||||
to fully make use of the features of Lina Components:
|
||||
|
||||
- Indy 10 **
|
||||
- RemObjects PascalScript 3 **
|
||||
|
||||
*) The code will run under Turbo-Delphi 2006, but the components
|
||||
won't be available in the components palett of the personal
|
||||
version.
|
||||
|
||||
**) This is the recommended version under which the official
|
||||
repository of Lina Components is being developed. The code might
|
||||
also run with older versions, but that might cause errors or
|
||||
limitations.
|
||||
|
||||
== Obtainment =====================================================
|
||||
To get Lina Componants, you can either download a snapshot or use a
|
||||
|
4
Information/Statistics.txt
Normal file
4
Information/Statistics.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
These statistics cover the official repository of Lina Components.
|
||||
|
||||
Total lines of code (LoC): 3100+
|
||||
Total visual components (VC): 9
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Binary file not shown.
@@ -1,15 +1,15 @@
|
||||
//TBATTERY BITMAP "TBattery.bmp"
|
||||
TBATTERY16 BITMAP "Bitmap\Small\TBattery.bmp"
|
||||
TBATTERY32 BITMAP "Bitmap\Large\TBattery.bmp"
|
||||
//TCOMPONENTMANAGER BITMAP "TComponentManager.bmp"
|
||||
TCOMPONENTMANAGER16 BITMAP "Bitmap\Small\TComponentManager.bmp"
|
||||
TCOMPONENTMANAGER32 BITMAP "Bitmap\Large\TComponentManager.bmp"
|
||||
//TDOWNLOAD BITMAP "TDownload.bmp"
|
||||
TDOWNLOAD16 BITMAP "Bitmap\Small\TDownload.bmp"
|
||||
TDOWNLOAD32 BITMAP "Bitmap\Large\TDownload.bmp"
|
||||
//TLOCALIZATIONMANAGER BITMAP "TLocalizationManager.bmp"
|
||||
TLOCALIZATIONMANAGER16 BITMAP "Bitmap\Small\TLocalizationManager.bmp"
|
||||
TLOCALIZATIONMANAGER32 BITMAP "Bitmap\Large\TLocalizationManager.bmp"
|
||||
//TPROGRESSBARMANAGER BITMAP "TProgressBarManager.bmp"
|
||||
TPROGRESSBARMANAGER16 BITMAP "Bitmap\Small\TProgressBarManager.bmp"
|
||||
TPROGRESSBARMANAGER32 BITMAP "Bitmap\Large\TProgressBarManager.bmp"
|
||||
//TSCRIPTMANAGER BITMAP "TScriptManager.bmp"
|
||||
TSCRIPTMANAGER16 BITMAP "Bitmap\Small\TScriptManager.bmp"
|
||||
TSCRIPTMANAGER32 BITMAP "Bitmap\Large\TScriptManager.bmp"
|
||||
@@ -18,4 +18,4 @@ TSPLASHSCREEN16 BITMAP "Bitmap\Small\TSplashScreen.bmp"
|
||||
TSPLASHSCREEN32 BITMAP "Bitmap\Large\TSplashScreen.bmp"
|
||||
//TVIRTUALPROGRAM BITMAP "TVirtualProgram.bmp"
|
||||
TVIRTUALPROGRAM16 BITMAP "Bitmap\Small\TVirtualProgram.bmp"
|
||||
TVIRTUALPROGRAM32 BITMAP "Bitmap\Large\TVirtualProgram.bmp"
|
||||
TVIRTUALPROGRAM32 BITMAP "Bitmap\Large\TVirtualProgram.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.
@@ -31,7 +31,7 @@ interface
|
||||
|
||||
uses
|
||||
{ Standard-Units }
|
||||
SysUtils, Dialogs;
|
||||
SysUtils, Classes, Dialogs;
|
||||
|
||||
type
|
||||
TComponentAbout = class
|
||||
|
@@ -10,15 +10,16 @@ interface
|
||||
|
||||
uses
|
||||
{ Standard-Units }
|
||||
SysUtils, Classes, Controls, Forms, ComCtrls, ExtCtrls, Graphics,
|
||||
SysUtils, Classes, Controls, Forms, StdCtrls, ComCtrls, ExtCtrls, Graphics,
|
||||
{ Andere Package-Units }
|
||||
uBase, uBattery, uWebCtrls;
|
||||
uBase, uSysTools, uBattery, uWebCtrls;
|
||||
|
||||
type
|
||||
{ Hilfsklassen }
|
||||
TSplashScreenMode = (ssmDefault,ssmModal);
|
||||
TSplashScreenAnimation = (ssaNone,ssaShallow);
|
||||
TProgressBarManagerMode = (pmmNone,pmmBattery,pmmDownload);
|
||||
TListBoxManagerMode = (lmmNone,lmmEdit,lmmComboBox);
|
||||
TParamReferenceType = (prtAutomatic,prtChar,prtString,prtInteger,prtFloat);
|
||||
|
||||
type
|
||||
@@ -29,7 +30,7 @@ type
|
||||
TSplashHideEvent = procedure(Sender: TObject) of object;
|
||||
TSplashChangeEvent = procedure(Sender: TObject) of object;
|
||||
TSplashTimerEvent = procedure(Sender: TObject) of object;
|
||||
TProgressBarManagerUpdateEvent = procedure(Sender: TObject) of object;
|
||||
TComponentManagerUpdateEvent = procedure(Sender: TObject) of object;
|
||||
|
||||
type
|
||||
{ Hauptklassen }
|
||||
@@ -221,8 +222,28 @@ type
|
||||
property AnimationSpeed: Byte read FAnimationSpeed write FAnimationSpeed default 10;
|
||||
end;
|
||||
|
||||
{ TProgressBarManager }
|
||||
TProgressBarManager = class(TComponent)
|
||||
{ T...Manager }
|
||||
|
||||
TComponentManager = class(TComponent)
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
FAbout: TComponentAbout;
|
||||
{ Ereignisse }
|
||||
FUpdateEvent: TComponentManagerUpdateEvent;
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure Update;
|
||||
published
|
||||
{ Published-Deklarationen }
|
||||
{ Ereignisse }
|
||||
property OnUpdate: TComponentManagerUpdateEvent read FUpdateEvent write FUpdateEvent;
|
||||
{ Eigenschaften }
|
||||
property About: TComponentAbout read FAbout;
|
||||
end;
|
||||
|
||||
TProgressBarManager = class(TComponentManager)
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
FAbout: TComponentAbout;
|
||||
@@ -230,8 +251,6 @@ type
|
||||
FSourceBattery: TBattery;
|
||||
FSourceDownload: TDownload;
|
||||
FMode: TProgressBarManagerMode;
|
||||
{ Ereignisse }
|
||||
FUpdateEvent: TProgressBarManagerUpdateEvent;
|
||||
{ Methoden }
|
||||
procedure SetTarget(Value: TProgressBar);
|
||||
procedure SetSourceBattery(Value: TBattery);
|
||||
@@ -244,16 +263,42 @@ type
|
||||
procedure Update;
|
||||
published
|
||||
{ Published-Deklarationen }
|
||||
{ Ereignisse }
|
||||
property OnUpdate: TProgressBarManagerUpdateEvent read FUpdateEvent write FUpdateEvent;
|
||||
{ Eigenschaften }
|
||||
property About: TComponentAbout read FAbout;
|
||||
property Target: TProgressBar read FTarget write SetTarget;
|
||||
property SourceBattery: TBattery read FSourceBattery write SetSourceBattery;
|
||||
property SourceDownload: TDownload read FSourceDownload write SetSourceDownload;
|
||||
property Mode: TProgressBarManagerMode read FMode write SetMode default pmmNone;
|
||||
end;
|
||||
|
||||
TListBoxManager = class(TComponentManager)
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
FilteredList: TFilteredStringList;
|
||||
FTarget: TListBox;
|
||||
FSourceEdit: TEdit;
|
||||
FSourceComboBox: TComboBox;
|
||||
FMode: TListBoxManagerMode;
|
||||
FFilterOptions: TStringFilterOptions;
|
||||
{ Methoden }
|
||||
procedure SetTarget(Value: TListBox);
|
||||
procedure SetSourceEdit(Value: TEdit);
|
||||
procedure SetSourceComboBox(Value: TComboBox);
|
||||
procedure SetMode(Value: TListBoxManagerMode);
|
||||
procedure SetFilterOptions(Value: TStringFilterOptions);
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
procedure Update;
|
||||
procedure LoadList;
|
||||
published
|
||||
{ Published-Deklarationen }
|
||||
property Target: TListBox read FTarget write SetTarget;
|
||||
property SourceEdit: TEdit read FSourceEdit write SetSourceEdit;
|
||||
property SourceComboBox: TComboBox read FSourceComboBox write SetSourceComboBox;
|
||||
property Mode: TListBoxManagerMode read FMode write SetMode default lmmNone;
|
||||
property FilterOptions: TStringFilterOptions read FFilterOptions write SetFilterOptions default [sfoCaseSensitive,sfoForceTrim,sfoDefaultVisible];
|
||||
end;
|
||||
|
||||
{ TParam... }
|
||||
TParamFormat = class
|
||||
private
|
||||
@@ -320,6 +365,11 @@ const
|
||||
ProgressBarManagerComponent_Copyright = 'Copyright � 2014';
|
||||
ProgressBarManagerComponent_Author = 'Dennis G�hlert a.o.';
|
||||
|
||||
ListBoxManagerComponent_Name = 'ListBoxManager';
|
||||
ListBoxManagerComponent_Version = 1.0;
|
||||
ListBoxManagerComponent_Copyright = 'Copyright � 2014';
|
||||
ListBoxManagerComponent_Author = 'Dennis G�hlert a.o.';
|
||||
|
||||
ParamDefinerComponent_Name = 'ParamDefiner';
|
||||
ParamDefinerComponent_Version = 1.0;
|
||||
ParamDefinerComponent_Copyright = 'Copyright � 2014';
|
||||
@@ -329,7 +379,7 @@ implementation
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterComponents(ComponentsPage,[TSplashScreen,TProgressBarManager]);
|
||||
RegisterComponents(ComponentsPage,[TSplashScreen,TProgressBarManager,TListBoxManager]);
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
@@ -689,6 +739,27 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TComponentManager
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
constructor TComponentManager.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
//...
|
||||
end;
|
||||
|
||||
destructor TComponentManager.Destroy;
|
||||
begin
|
||||
//...
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TComponentManager.Update;
|
||||
begin
|
||||
//...
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TProgressBarManager
|
||||
---------------------------------------------------------------------------- }
|
||||
@@ -710,12 +781,13 @@ end;
|
||||
|
||||
procedure TProgressBarManager.Update;
|
||||
begin
|
||||
inherited;
|
||||
if Assigned(Target) = False then
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
if Mode <> pmmNone then
|
||||
begin
|
||||
if Assigned(Target) = False then
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
if (Mode = pmmBattery) and (Assigned(SourceBattery) = False)
|
||||
or (Mode = pmmDownload) and (Assigned(SourceDownload) = False) then
|
||||
begin
|
||||
@@ -766,6 +838,103 @@ begin
|
||||
Update;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TListBoxManager
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
constructor TListBoxManager.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited;
|
||||
FAbout := TComponentAbout.Create(ListBoxManagerComponent_Name,ListBoxManagerComponent_Version,ListBoxManagerComponent_Copyright,ListBoxManagerComponent_Author);
|
||||
FMode := lmmNone;
|
||||
FFilterOptions := [sfoCaseSensitive,sfoForceTrim,sfoDefaultVisible];
|
||||
FilteredList := TFilteredStringList.Create;
|
||||
Update;
|
||||
end;
|
||||
|
||||
destructor TListBoxManager.Destroy;
|
||||
begin
|
||||
FAbout.Free;
|
||||
FilteredList.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.Update;
|
||||
begin
|
||||
inherited;
|
||||
if Assigned(Target) = False then
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
if Mode <> lmmNone then
|
||||
begin
|
||||
if (Mode = lmmEdit) and (Assigned(SourceEdit) = False)
|
||||
or (Mode = lmmComboBox) and (Assigned(SourceComboBox) = False) then
|
||||
begin
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
if Mode = lmmEdit then
|
||||
begin
|
||||
FilteredList.Filter := SourceEdit.Text;
|
||||
end;
|
||||
if Mode = lmmComboBox then
|
||||
begin
|
||||
FilteredList.Filter := SourceComboBox.Text;
|
||||
end;
|
||||
Target.Items.Assign(FilteredList.FilteredStrings);
|
||||
if Assigned(OnUpdate) then
|
||||
begin
|
||||
OnUpdate(Self);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.LoadList;
|
||||
begin
|
||||
if Assigned(Target) then
|
||||
begin
|
||||
FilteredList.Assign(Target.Items);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.SetTarget(Value: TListBox);
|
||||
begin
|
||||
FTarget := Value;
|
||||
LoadList;
|
||||
Update;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.SetSourceEdit(Value: TEdit);
|
||||
begin
|
||||
FSourceEdit := Value;
|
||||
if Mode = lmmEdit then
|
||||
begin
|
||||
Update;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.SetSourceComboBox(Value: TComboBox);
|
||||
begin
|
||||
FSourceComboBox := Value;
|
||||
if Mode = lmmComboBox then
|
||||
begin
|
||||
Update;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.SetMode(Value: TListBoxManagerMode);
|
||||
begin
|
||||
FMode := Value;
|
||||
Update;
|
||||
end;
|
||||
|
||||
procedure TListBoxManager.SetFilterOptions(Value: TStringFilterOptions);
|
||||
begin
|
||||
FilteredList.FilterOptions := Value;
|
||||
FFilterOptions := Value;
|
||||
Update;
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TParamFormat
|
||||
---------------------------------------------------------------------------- }
|
||||
|
@@ -16,7 +16,7 @@ interface
|
||||
|
||||
uses
|
||||
{ Standard-Units }
|
||||
Classes, SysUtils, Math, Windows,
|
||||
SysUtils, Classes, Math, Windows,
|
||||
{$IFNDEF NO_GENERIC}
|
||||
Types, Generics.Collections,
|
||||
{$ENDIF}
|
||||
@@ -28,6 +28,11 @@ type
|
||||
EWinUserInformation = class(Exception);
|
||||
EInvalidValueType = class(Exception);
|
||||
|
||||
type
|
||||
{ Hilfsklassen }
|
||||
TStringFilterMode = (sfmAnyPosition,sfmBeginning);
|
||||
TStringFilterOptions = set of (sfoCaseSensitive,sfoForceTrim,sfoDefaultVisible);
|
||||
|
||||
type
|
||||
{$IFNDEF NO_GENERIC}
|
||||
TIntegerList = TList<Integer>;
|
||||
@@ -36,6 +41,30 @@ type
|
||||
TPointList = TList<TPoint>;
|
||||
{$ENDIF}
|
||||
|
||||
TFilteredStringList = class(TStringList)
|
||||
private
|
||||
{ Private-Deklarationen }
|
||||
FFiltered: Boolean;
|
||||
FFilter: String;
|
||||
FFilteredStrings: TStrings;
|
||||
FFilterMode: TStringFilterMode;
|
||||
FFilterOptions: TStringFilterOptions;
|
||||
{ Methoden }
|
||||
function GetFilteredStrings: TStrings;
|
||||
protected
|
||||
{ Protected-Deklarationen }
|
||||
procedure FilterUpdate;
|
||||
public
|
||||
{ Public-Deklarationen }
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
property Filtered: Boolean read FFiltered write FFiltered default True;
|
||||
property Filter: String read FFilter write FFilter;
|
||||
property FilteredStrings: TStrings read GetFilteredStrings;
|
||||
property FilterMode: TStringFilterMode read FFilterMode write FFilterMode default sfmBeginning;
|
||||
property FilterOptions: TStringFilterOptions read FFilterOptions write FFilterOptions default [sfoCaseSensitive,sfoForceTrim,sfoDefaultVisible];
|
||||
end;
|
||||
|
||||
{ Typenumwandelungen }
|
||||
function BoolToInt(B: Boolean): Integer;
|
||||
function IntToBool(Value: Integer): Boolean;
|
||||
@@ -52,7 +81,6 @@ type
|
||||
{ Sonstige }
|
||||
function SecToTime(const Sec: Cardinal): TTime;
|
||||
function SystemLanguage: String;
|
||||
function Empty(var Val): Boolean;
|
||||
|
||||
implementation
|
||||
|
||||
@@ -122,24 +150,6 @@ begin
|
||||
Result := Languages.NameFromLocaleID[Languages.UserDefaultLocale];
|
||||
end;
|
||||
|
||||
function Empty(var Val): Boolean;
|
||||
begin
|
||||
{ if Val is Pointer then
|
||||
begin
|
||||
Result := (Val = nil);
|
||||
end else
|
||||
begin
|
||||
if Val is TObject then
|
||||
begin
|
||||
Val = (Val as TObject).
|
||||
|
||||
end else
|
||||
begin
|
||||
raise EInvalidValueType.Create('Unsupported value type: ' + ToString(Val));
|
||||
end;
|
||||
end; }
|
||||
end;
|
||||
|
||||
function WinUserName: String;
|
||||
var
|
||||
Buffer: array [0..255] of Char;
|
||||
@@ -225,4 +235,67 @@ begin
|
||||
//... MUSS NOCH GESCHRIEBEN WERDEN!!!
|
||||
end;
|
||||
|
||||
{ ----------------------------------------------------------------------------
|
||||
TFilteredStringList
|
||||
---------------------------------------------------------------------------- }
|
||||
|
||||
constructor TFilteredStringList.Create;
|
||||
begin
|
||||
inherited;
|
||||
FFilteredStrings := TStringList.Create;
|
||||
FFiltered := True;
|
||||
FFilterMode := sfmBeginning;
|
||||
FFilterOptions := [sfoCaseSensitive,sfoForceTrim,sfoDefaultVisible];
|
||||
end;
|
||||
|
||||
destructor TFilteredStringList.Destroy;
|
||||
begin
|
||||
FFilteredStrings.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
function TFilteredStringList.GetFilteredStrings: TStrings;
|
||||
begin
|
||||
if Filtered = True then
|
||||
begin
|
||||
FilterUpdate;
|
||||
Result := FFilteredStrings;
|
||||
end else
|
||||
begin
|
||||
Result := Self;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFilteredStringList.FilterUpdate;
|
||||
var
|
||||
Index: Integer;
|
||||
StringPos: Integer;
|
||||
FilterValue: String;
|
||||
StringValue: String;
|
||||
begin
|
||||
FFilteredStrings.Clear;
|
||||
for Index := 0 to Count - 1 do
|
||||
begin
|
||||
FilterValue := Filter;
|
||||
StringValue := Strings[Index];
|
||||
if not (sfoCaseSensitive in FilterOptions) then
|
||||
begin
|
||||
FilterValue := LowerCase(FilterValue);
|
||||
StringValue := LowerCase(StringValue);
|
||||
end;
|
||||
if (sfoForceTrim in FilterOptions) then
|
||||
begin
|
||||
FilterValue := Trim(FilterValue);
|
||||
StringValue := Trim(StringValue);
|
||||
end;
|
||||
StringPos := Pos(FilterValue,StringValue);
|
||||
if (((FilterMode = sfmBeginning) and (StringPos = 1)) or
|
||||
((FilterMode = sfmAnyPosition) and (StringPos > 0))) or
|
||||
((Length(FilterValue) = 0) and (sfoDefaultVisible in FilterOptions)) then
|
||||
begin
|
||||
FFilteredStrings.Add(Strings[Index]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user