Changeset 128 for trunk/Packages/Common
- Timestamp:
- Apr 8, 2022, 9:43:55 PM (3 years ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.lpk
r90 r128 33 33 <Other> 34 34 <CompilerMessages> 35 <IgnoredMessages idx6058="True" idx50 24="True" idx3124="True" idx3123="True"/>35 <IgnoredMessages idx6058="True" idx5071="True" idx5024="True" idx3124="True" idx3123="True"/> 36 36 </CompilerMessages> 37 37 </Other> -
trunk/Packages/Common/UDebugLog.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, FileUtil, fgl, SyncObjs;6 Classes, SysUtils, FileUtil, Generics.Collections, SyncObjs; 7 7 8 8 type … … 13 13 Group: string; 14 14 Text: string; 15 end; 16 17 TDebugLogItems = class(TObjectList<TDebugLogItem>) 15 18 end; 16 19 … … 27 30 procedure SetMaxCount(const AValue: Integer); 28 31 public 29 Items: T FPGObjectList<TDebugLogItem>;32 Items: TDebugLogItems; 30 33 Lock: TCriticalSection; 31 34 procedure Add(Text: string; Group: string = ''); … … 116 119 begin 117 120 inherited; 118 Items := T FPGObjectList<TDebugLogItem>.Create;121 Items := TDebugLogItems.Create; 119 122 Lock := TCriticalSection.Create; 120 123 MaxCount := 100; … … 125 128 destructor TDebugLog.Destroy; 126 129 begin 127 Items.Free;128 Lock.Free;130 FreeAndNil(Items); 131 FreeAndNil(Lock); 129 132 inherited; 130 133 end; -
trunk/Packages/Common/UFindFile.pas
r90 r128 35 35 private 36 36 s : TStringList; 37 38 37 fSubFolder : boolean; 39 38 fAttr: TFileAttrib; 40 39 fPath : string; 41 40 fFileMask : string; 42 43 41 procedure SetPath(Value: string); 44 42 procedure FileSearch(const inPath : string); … … 46 44 constructor Create(AOwner: TComponent); override; 47 45 destructor Destroy; override; 48 49 46 function SearchForFiles: TStringList; 50 47 published … … 64 61 65 62 procedure Register; 63 66 64 67 65 implementation -
trunk/Packages/Common/UJobProgressView.pas
r127 r128 5 5 uses 6 6 SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs, 7 Dialogs, ComCtrls, StdCtrls, ExtCtrls, fgl, UThreading, Math,7 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, UThreading, Math, 8 8 DateUtils; 9 9 … … 69 69 end; 70 70 71 TJobs = class(T FPGObjectList<TJob>)71 TJobs = class(TObjectList<TJob>) 72 72 end; 73 73 -
trunk/Packages/Common/ULanguages.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, fgl;6 Classes, SysUtils, Generics.Collections; 7 7 8 8 type … … 15 15 { TLanguages } 16 16 17 TLanguages = class(T FPGObjectList<TLanguage>)17 TLanguages = class(TObjectList<TLanguage>) 18 18 function SearchByCode(ACode: string): TLanguage; 19 19 procedure AddNew(Code: string; Name: string); -
trunk/Packages/Common/UListViewSort.pas
r127 r128 7 7 uses 8 8 {$IFDEF Windows}Windows, CommCtrl, LMessages, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils, 9 Controls, DateUtils, Dialogs, fgl,Forms, Grids, StdCtrls, ExtCtrls,10 LclIntf, LclType, LResources ;9 Controls, DateUtils, Dialogs, Forms, Grids, StdCtrls, ExtCtrls, 10 LclIntf, LclType, LResources, Generics.Collections, Generics.Defaults; 11 11 12 12 type … … 17 17 TCompareEvent = function (Item1, Item2: TObject): Integer of object; 18 18 TListFilterEvent = procedure (ListViewSort: TListViewSort) of object; 19 20 TObjects = TObjectList<TObject>; 19 21 20 22 { TListViewSort } … … 50 52 {$ENDIF} 51 53 public 52 List: TFPGObjectList<TObject>;53 Source: TFPGObjectList<TObject>;54 Source: TObjects; 55 List: TObjects; 54 56 constructor Create(AOwner: TComponent); override; 55 57 destructor Destroy; override; … … 336 338 ListViewSortCompare: TCompareEvent; 337 339 338 function ListViewCompare(const Item1, Item2: TObject): Integer;340 function ListViewCompare(constref Item1, Item2: TObject): Integer; 339 341 begin 340 342 Result := ListViewSortCompare(Item1, Item2); … … 347 349 ListViewSortCompare := Compare; 348 350 if (List.Count > 0) then 349 List.Sort( ListViewCompare);351 List.Sort(TComparer<TObject>.Construct(ListViewCompare)); 350 352 end; 351 353 … … 353 355 begin 354 356 if Assigned(FOnFilter) then FOnFilter(Self) 355 else if Assigned(Source) then 356 List.Assign(Source) else 357 else if Assigned(Source) then begin 357 358 List.Clear; 359 List.AddRange(Source); 360 end else List.Clear; 358 361 if ListView.Items.Count <> List.Count then 359 362 ListView.Items.Count := List.Count; … … 410 413 begin 411 414 inherited; 412 List := T FPGObjectList<TObject>.Create;413 List. FreeObjects := False;415 List := TObjects.Create; 416 List.OwnsObjects := False; 414 417 end; 415 418 416 419 destructor TListViewSort.Destroy; 417 420 begin 418 List.Free;421 FreeAndNil(List); 419 422 inherited; 420 423 end; -
trunk/Packages/Common/UMetaCanvas.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, Graphics, Types, fgl;6 Classes, SysUtils, Graphics, Types, Generics.Collections; 7 7 8 8 type … … 17 17 end; 18 18 19 TCanvasObjects = class(T FPGObjectList<TCanvasObject>)19 TCanvasObjects = class(TObjectList<TCanvasObject>) 20 20 end; 21 21 -
trunk/Packages/Common/UPool.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, syncobjs, fgl, UThreading;6 Classes, SysUtils, syncobjs, Generics.Collections, UThreading; 7 7 8 8 type … … 20 20 function NewItemObject: TObject; virtual; 21 21 public 22 Items: T FPGObjectList<TObject>;23 FreeItems: T FPGObjectList<TObject>;22 Items: TObjectList<TObject>; 23 FreeItems: TObjectList<TObject>; 24 24 function Acquire: TObject; virtual; 25 25 procedure Release(Item: TObject); virtual; … … 183 183 begin 184 184 inherited; 185 Items := T FPGObjectList<TObject>.Create;186 FreeItems := T FPGObjectList<TObject>.Create;187 FreeItems. FreeObjects := False;185 Items := TObjectList<TObject>.Create; 186 FreeItems := TObjectList<TObject>.Create; 187 FreeItems.OwnsObjects := False; 188 188 FReleaseEvent := TEvent.Create(nil, False, False, ''); 189 189 end; -
trunk/Packages/Common/UScaleDPI.pas
r127 r128 6 6 7 7 uses 8 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, fgl; 8 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, 9 Generics.Collections; 9 10 10 11 type … … 26 27 end; 27 28 28 TControlDimensions = class(T FPGObjectList<TControlDimension>)29 TControlDimensions = class(TObjectList<TControlDimension>) 29 30 end; 30 31 -
trunk/Packages/Common/UTheme.pas
r127 r128 5 5 uses 6 6 Classes, SysUtils, Graphics, ComCtrls, Controls, ExtCtrls, Menus, StdCtrls, 7 Spin, Forms, fgl, Grids;7 Spin, Forms, Generics.Collections, Grids; 8 8 9 9 type … … 19 19 { TThemes } 20 20 21 TThemes = class(T FPGObjectList<TTheme>)21 TThemes = class(TObjectList<TTheme>) 22 22 function AddNew(Name: string): TTheme; 23 23 function FindByName(Name: string): TTheme; -
trunk/Packages/Common/UThreading.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, Forms, fgl, SyncObjs;6 Classes, SysUtils, Forms, Generics.Collections, SyncObjs; 7 7 8 8 type … … 99 99 { TThreadList } 100 100 101 TThreadList = class(T FPGObjectList<TVirtualThread>)101 TThreadList = class(TObjectList<TVirtualThread>) 102 102 function FindById(Id: TThreadID): TVirtualThread; 103 103 constructor Create; virtual; … … 358 358 ThreadListLock := TCriticalSection.Create; 359 359 ThreadList := TThreadList.Create; 360 ThreadList. FreeObjects := False;360 ThreadList.OwnsObjects := False; 361 361 362 362 finalization -
trunk/Packages/Common/UTranslator.pas
r127 r128 4 4 5 5 uses 6 Classes, SysUtils, Forms, ExtCtrls, Controls, fgl,LazFileUtils, LazUTF8,6 Classes, SysUtils, Forms, ExtCtrls, Controls, LazFileUtils, LazUTF8, 7 7 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType, 8 LCLVersion ;8 LCLVersion, Generics.Collections; 9 9 10 10 type 11 11 THandleStringEvent = function (AValue: string): string of object; 12 12 13 TPoFiles = class(T FPGObjectList<TPOFile>)13 TPoFiles = class(TObjectList<TPOFile>) 14 14 end; 15 15 … … 25 25 { TComponentExcludesList } 26 26 27 TComponentExcludesList = class(T FPGObjectList<TComponentExcludes>)27 TComponentExcludesList = class(TObjectList<TComponentExcludes>) 28 28 function FindByClassType(AClassType: TClass): TComponentExcludes; 29 29 procedure DumpToStrings(Strings: TStrings); … … 288 288 Item := Component.ClassType; 289 289 while Assigned(Item) do begin 290 //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);291 290 Excludes := ComponentExcludes.FindByClassType(Item.ClassType); 292 291 if Assigned(Excludes) then begin
Note:
See TracChangeset
for help on using the changeset viewer.