diff --git a/Information/Credits.txt b/Information/Credits.txt index dd3494d..f9a6ac2 100644 --- a/Information/Credits.txt +++ b/Information/Credits.txt @@ -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. \ No newline at end of file +solutions for countless problems. + +Other official contributors are: +(No contributors are listed) \ No newline at end of file diff --git a/Information/License.txt b/Information/License.txt index bd095d0..a12b9a4 100644 --- a/Information/License.txt +++ b/Information/License.txt @@ -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! \ No newline at end of file +INFO: Even if the code contains copyright marks or references, they + are overwritten by this document! \ No newline at end of file diff --git a/Information/Manual.txt b/Information/Manual.txt index 07d1b08..03d58e6 100644 --- a/Information/Manual.txt +++ b/Information/Manual.txt @@ -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 diff --git a/Information/Statistics.txt b/Information/Statistics.txt new file mode 100644 index 0000000..14e0788 --- /dev/null +++ b/Information/Statistics.txt @@ -0,0 +1,4 @@ +These statistics cover the official repository of Lina Components. + +Total lines of code (LoC): 3100+ +Total visual components (VC): 9 \ No newline at end of file diff --git a/Package/Delphi_XE5/LINA_D_XE5.identcache b/Package/Delphi_XE5/LINA_D_XE5.identcache index 1560f1f..2961c23 100644 Binary files a/Package/Delphi_XE5/LINA_D_XE5.identcache and b/Package/Delphi_XE5/LINA_D_XE5.identcache differ diff --git a/Resource/Bitmap/Large/TProgressBarManager.bmp b/Resource/Bitmap/Large/TComponentManager.bmp similarity index 100% rename from Resource/Bitmap/Large/TProgressBarManager.bmp rename to Resource/Bitmap/Large/TComponentManager.bmp diff --git a/Resource/Bitmap/Small/TProgressBarManager.bmp b/Resource/Bitmap/Small/TComponentManager.bmp similarity index 100% rename from Resource/Bitmap/Small/TProgressBarManager.bmp rename to Resource/Bitmap/Small/TComponentManager.bmp diff --git a/Resource/Bitmap/Small/Thumbs.db b/Resource/Bitmap/Small/Thumbs.db index 6c0251a..d2e25fe 100644 Binary files a/Resource/Bitmap/Small/Thumbs.db and b/Resource/Bitmap/Small/Thumbs.db differ diff --git a/Resource/Compiled/uFrmCtrls.dcr b/Resource/Compiled/uFrmCtrls.dcr index 904b68d..426e16b 100644 Binary files a/Resource/Compiled/uFrmCtrls.dcr and b/Resource/Compiled/uFrmCtrls.dcr differ diff --git a/Resource/LINA.rc b/Resource/LINA.rc index 47d38b8..2e9cee0 100644 --- a/Resource/LINA.rc +++ b/Resource/LINA.rc @@ -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" \ No newline at end of file diff --git a/Source/Compiled/uAdvCtrls.dcu b/Source/Compiled/uAdvCtrls.dcu index 6c0f162..09e4b7e 100644 Binary files a/Source/Compiled/uAdvCtrls.dcu and b/Source/Compiled/uAdvCtrls.dcu differ diff --git a/Source/Compiled/uBase.dcu b/Source/Compiled/uBase.dcu index b9b3f48..2b2c59f 100644 Binary files a/Source/Compiled/uBase.dcu and b/Source/Compiled/uBase.dcu differ diff --git a/Source/Compiled/uBattery.dcu b/Source/Compiled/uBattery.dcu index a69010b..20375da 100644 Binary files a/Source/Compiled/uBattery.dcu and b/Source/Compiled/uBattery.dcu differ diff --git a/Source/Compiled/uCrypt.dcu b/Source/Compiled/uCrypt.dcu index 16e52a6..7e65d43 100644 Binary files a/Source/Compiled/uCrypt.dcu and b/Source/Compiled/uCrypt.dcu differ diff --git a/Source/Compiled/uFileTools.dcu b/Source/Compiled/uFileTools.dcu index a8414f9..dba427b 100644 Binary files a/Source/Compiled/uFileTools.dcu and b/Source/Compiled/uFileTools.dcu differ diff --git a/Source/Compiled/uFrmCtrls.dcu b/Source/Compiled/uFrmCtrls.dcu index 2eb5c51..e83ecf9 100644 Binary files a/Source/Compiled/uFrmCtrls.dcu and b/Source/Compiled/uFrmCtrls.dcu differ diff --git a/Source/Compiled/uLocalMgr.dcu b/Source/Compiled/uLocalMgr.dcu index 786202a..d91fd92 100644 Binary files a/Source/Compiled/uLocalMgr.dcu and b/Source/Compiled/uLocalMgr.dcu differ diff --git a/Source/Compiled/uScriptMgr.dcu b/Source/Compiled/uScriptMgr.dcu index 1b897b2..cd9b576 100644 Binary files a/Source/Compiled/uScriptMgr.dcu and b/Source/Compiled/uScriptMgr.dcu differ diff --git a/Source/Compiled/uSysTools.dcu b/Source/Compiled/uSysTools.dcu index 504f0c4..33b99b8 100644 Binary files a/Source/Compiled/uSysTools.dcu and b/Source/Compiled/uSysTools.dcu differ diff --git a/Source/Compiled/uVirtObj.dcu b/Source/Compiled/uVirtObj.dcu index 94fde32..843837b 100644 Binary files a/Source/Compiled/uVirtObj.dcu and b/Source/Compiled/uVirtObj.dcu differ diff --git a/Source/Compiled/uWebCtrls.dcu b/Source/Compiled/uWebCtrls.dcu index e7fb851..745fc30 100644 Binary files a/Source/Compiled/uWebCtrls.dcu and b/Source/Compiled/uWebCtrls.dcu differ diff --git a/Source/uBase.pas b/Source/uBase.pas index c2c4356..a9bc96c 100644 --- a/Source/uBase.pas +++ b/Source/uBase.pas @@ -31,7 +31,7 @@ interface uses { Standard-Units } - SysUtils, Dialogs; + SysUtils, Classes, Dialogs; type TComponentAbout = class diff --git a/Source/uFrmCtrls.pas b/Source/uFrmCtrls.pas index 76e49cd..38bf2c3 100644 --- a/Source/uFrmCtrls.pas +++ b/Source/uFrmCtrls.pas @@ -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 ---------------------------------------------------------------------------- } diff --git a/Source/uSysTools.pas b/Source/uSysTools.pas index 61a3d41..1e77fc6 100644 --- a/Source/uSysTools.pas +++ b/Source/uSysTools.pas @@ -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; @@ -36,6 +41,30 @@ type TPointList = TList; {$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.