Changeset 137 for trunk/Packages/Common
- Timestamp:
- Sep 9, 2022, 1:16:58 AM (2 years ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 6 added
- 3 deleted
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.lpk
r131 r137 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> … … 41 41 Source: https://svn.zdechov.net/PascalClassLibrary/Common/"/> 42 42 <License Value="Copy left."/> 43 <Version Minor=" 9"/>44 <Files Count=" 29">43 <Version Minor="10"/> 44 <Files Count="31"> 45 45 <Item1> 46 46 <Filename Value="StopWatch.pas"/> … … 171 171 <UnitName Value="UPixelPointer"/> 172 172 </Item29> 173 <Item30> 174 <Filename Value="UDataFile.pas"/> 175 <UnitName Value="UDataFile"/> 176 </Item30> 177 <Item31> 178 <Filename Value="UTestCase.pas"/> 179 <UnitName Value="UTestCase"/> 180 </Item31> 173 181 </Files> 174 182 <CompatibilityMode Value="True"/> -
trunk/Packages/Common/Common.pas
r131 r137 14 14 UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, UMetaCanvas, 15 15 UGeometric, UTranslator, ULanguages, UFormAbout, UAboutDialog, 16 UPixelPointer, LazarusPackageIntf;16 UPixelPointer, UDataFile, UTestCase, LazarusPackageIntf; 17 17 18 18 implementation -
trunk/Packages/Common/StopWatch.pas
r89 r137 5 5 6 6 uses 7 {$IFDEF W indows}Windows,{$ENDIF}7 {$IFDEF WINDOWS}Windows,{$ENDIF} 8 8 SysUtils, DateUtils; 9 9 … … 32 32 end; 33 33 34 34 35 implementation 35 36 … … 40 41 fIsRunning := False; 41 42 42 {$IFDEF W indows}43 {$IFDEF WINDOWS} 43 44 fIsHighResolution := QueryPerformanceFrequency(fFrequency) ; 44 45 {$ELSE} -
trunk/Packages/Common/UAboutDialog.pas
r131 r137 1 1 unit UAboutDialog; 2 3 {$mode delphi}4 2 5 3 interface -
trunk/Packages/Common/UApplicationInfo.pas
r131 r137 1 1 unit UApplicationInfo; 2 3 {$mode delphi}4 2 5 3 interface … … 59 57 procedure Register; 60 58 59 61 60 implementation 62 61 -
trunk/Packages/Common/UCommon.pas
r131 r137 1 1 unit UCommon; 2 3 {$mode delphi}4 2 5 3 interface … … 34 32 DLLHandle1: HModule; 35 33 34 {$IFDEF WINDOWS} 35 GetUserNameEx: procedure (NameFormat: DWORD; 36 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; 37 {$ENDIF} 38 36 39 const 37 40 clLightBlue = TColor($FF8080); 38 41 clLightGreen = TColor($80FF80); 39 42 clLightRed = TColor($8080FF); 40 41 {$IFDEF WINDOWS}42 GetUserNameEx: procedure (NameFormat: DWORD;43 lpNameBuffer: LPSTR; nSize: PULONG); stdcall;44 {$ENDIF}45 43 46 44 function AddLeadingZeroes(const aNumber, Length : integer) : string; -
trunk/Packages/Common/UDebugLog.pas
r131 r137 1 1 unit UDebugLog; 2 3 {$mode delphi}4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, FileUtil, fgl, SyncObjs;6 Classes, SysUtils, FileUtil, Generics.Collections, SyncObjs; 9 7 10 8 type … … 15 13 Group: string; 16 14 Text: string; 15 end; 16 17 TDebugLogItems = class(TObjectList<TDebugLogItem>) 17 18 end; 18 19 … … 29 30 procedure SetMaxCount(const AValue: Integer); 30 31 public 31 Items: T FPGObjectList<TDebugLogItem>;32 Items: TDebugLogItems; 32 33 Lock: TCriticalSection; 33 34 procedure Add(Text: string; Group: string = ''); … … 44 45 45 46 procedure Register; 47 46 48 47 49 implementation … … 117 119 begin 118 120 inherited; 119 Items := T FPGObjectList<TDebugLogItem>.Create;121 Items := TDebugLogItems.Create; 120 122 Lock := TCriticalSection.Create; 121 123 MaxCount := 100; … … 126 128 destructor TDebugLog.Destroy; 127 129 begin 128 Items.Free;129 Lock.Free;130 FreeAndNil(Items); 131 FreeAndNil(Lock); 130 132 inherited; 131 133 end; -
trunk/Packages/Common/UDelay.pas
r84 r137 1 1 unit UDelay; 2 3 {$mode delphi}4 2 5 3 interface -
trunk/Packages/Common/UFindFile.pas
r131 r137 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 … … 87 85 begin 88 86 s.Free; 89 inherited Destroy;87 inherited; 90 88 end; 91 89 -
trunk/Packages/Common/UFormAbout.pas
r131 r137 1 1 unit UFormAbout; 2 3 {$mode delphi}4 2 5 3 interface -
trunk/Packages/Common/UGeometric.pas
r131 r137 1 1 unit UGeometric; 2 3 {$mode delphi}4 2 5 3 interface … … 26 24 function RectEnlarge(Rect: TRect; Value: Integer): TRect; 27 25 function ShiftRect(ARect: TRect; Delta: TPoint): TRect; 26 28 27 29 28 implementation -
trunk/Packages/Common/UJobProgressView.pas
r131 r137 1 1 unit UJobProgressView; 2 3 {$MODE Delphi}4 2 5 3 interface … … 7 5 uses 8 6 SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs, 9 Dialogs, ComCtrls, StdCtrls, ExtCtrls, fgl, UThreading, Math,7 Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, UThreading, Math, 10 8 DateUtils; 11 9 … … 71 69 end; 72 70 73 TJobs = class(T FPGObjectList<TJob>)71 TJobs = class(TObjectList<TJob>) 74 72 end; 75 73 … … 163 161 resourcestring 164 162 SExecuted = 'Executed'; 163 165 164 166 165 implementation … … 642 641 begin 643 642 FLock.Free; 644 inherited Destroy;643 inherited; 645 644 end; 646 645 -
trunk/Packages/Common/ULanguages.pas
r131 r137 1 1 unit ULanguages; 2 2 3 {$mode delphi}{$H+}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, fgl;6 Classes, SysUtils, Generics.Collections; 9 7 10 8 type … … 17 15 { TLanguages } 18 16 19 TLanguages = class(T FPGObjectList<TLanguage>)17 TLanguages = class(TObjectList<TLanguage>) 20 18 function SearchByCode(ACode: string): TLanguage; 21 19 procedure AddNew(Code: string; Name: string); -
trunk/Packages/Common/ULastOpenedList.pas
r131 r137 1 1 unit ULastOpenedList; 2 3 {$mode delphi}4 2 5 3 interface -
trunk/Packages/Common/UListViewSort.pas
r131 r137 2 2 3 3 // Date: 2019-05-17 4 5 {$mode delphi}6 4 7 5 interface … … 9 7 uses 10 8 {$IFDEF Windows}Windows, CommCtrl, LMessages, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils, 11 Controls, DateUtils, Dialogs, fgl,Forms, Grids, StdCtrls, ExtCtrls,12 LclIntf, LclType, LResources ;9 Controls, DateUtils, Dialogs, Forms, Grids, StdCtrls, ExtCtrls, 10 LclIntf, LclType, LResources, Generics.Collections, Generics.Defaults; 13 11 14 12 type … … 19 17 TCompareEvent = function (Item1, Item2: TObject): Integer of object; 20 18 TListFilterEvent = procedure (ListViewSort: TListViewSort) of object; 19 20 TObjects = TObjectList<TObject>; 21 21 22 22 { TListViewSort } … … 52 52 {$ENDIF} 53 53 public 54 List: TFPGObjectList<TObject>;55 Source: TFPGObjectList<TObject>;54 Source: TObjects; 55 List: TObjects; 56 56 constructor Create(AOwner: TComponent); override; 57 57 destructor Destroy; override; … … 149 149 destructor TListViewEx.Destroy; 150 150 begin 151 inherited Destroy;151 inherited; 152 152 end; 153 153 … … 338 338 ListViewSortCompare: TCompareEvent; 339 339 340 function ListViewCompare(const Item1, Item2: TObject): Integer;340 function ListViewCompare(constref Item1, Item2: TObject): Integer; 341 341 begin 342 342 Result := ListViewSortCompare(Item1, Item2); … … 349 349 ListViewSortCompare := Compare; 350 350 if (List.Count > 0) then 351 List.Sort( ListViewCompare);351 List.Sort(TComparer<TObject>.Construct(ListViewCompare)); 352 352 end; 353 353 … … 355 355 begin 356 356 if Assigned(FOnFilter) then FOnFilter(Self) 357 else if Assigned(Source) then 358 List.Assign(Source) else 357 else if Assigned(Source) then begin 359 358 List.Clear; 359 List.AddRange(Source); 360 end else List.Clear; 360 361 if ListView.Items.Count <> List.Count then 361 362 ListView.Items.Count := List.Count; … … 412 413 begin 413 414 inherited; 414 List := T FPGObjectList<TObject>.Create;415 List. FreeObjects := False;415 List := TObjects.Create; 416 List.OwnsObjects := False; 416 417 end; 417 418 418 419 destructor TListViewSort.Destroy; 419 420 begin 420 List.Free;421 FreeAndNil(List); 421 422 inherited; 422 423 end; -
trunk/Packages/Common/UMemory.pas
r131 r137 1 1 unit UMemory; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface … … 44 42 end; 45 43 44 46 45 implementation 47 46 … … 50 49 procedure TPositionMemory.SetSize(AValue: Integer); 51 50 begin 52 inherited SetSize(AValue);51 inherited; 53 52 if FPosition > FSize then FPosition := FSize; 54 53 end; … … 107 106 begin 108 107 Size := 0; 109 inherited Destroy;108 inherited; 110 109 end; 111 110 -
trunk/Packages/Common/UMetaCanvas.pas
r131 r137 1 1 unit UMetaCanvas; 2 2 3 {$mode delphi}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Graphics, Types, fgl;6 Classes, SysUtils, Graphics, Types, Generics.Collections; 9 7 10 8 type … … 19 17 end; 20 18 21 TCanvasObjects = class(T FPGObjectList<TCanvasObject>)19 TCanvasObjects = class(TObjectList<TCanvasObject>) 22 20 end; 23 21 -
trunk/Packages/Common/UPersistentForm.pas
r131 r137 1 1 unit UPersistentForm; 2 3 {$mode delphi}4 2 5 3 // Date: 2020-11-26 -
trunk/Packages/Common/UPixelPointer.pas
r131 r137 59 59 function Color32ToColor(Color: TColor32): TColor; 60 60 function ColorToColor32(Color: TColor): TColor32; 61 61 62 62 63 implementation -
trunk/Packages/Common/UPool.pas
r131 r137 1 1 unit UPool; 2 2 3 {$mode Delphi}{$H+}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, syncobjs, fgl, UThreading;6 Classes, SysUtils, syncobjs, Generics.Collections, UThreading; 9 7 10 8 type … … 22 20 function NewItemObject: TObject; virtual; 23 21 public 24 Items: T FPGObjectList<TObject>;25 FreeItems: T FPGObjectList<TObject>;22 Items: TObjectList<TObject>; 23 FreeItems: TObjectList<TObject>; 26 24 function Acquire: TObject; virtual; 27 25 procedure Release(Item: TObject); virtual; … … 108 106 constructor TThreadedPool.Create; 109 107 begin 110 inherited Create;108 inherited; 111 109 Lock := TCriticalSection.Create; 112 110 end; … … 116 114 TotalCount := 0; 117 115 Lock.Free; 118 inherited Destroy;116 inherited; 119 117 end; 120 118 … … 185 183 begin 186 184 inherited; 187 Items := T FPGObjectList<TObject>.Create;188 FreeItems := T FPGObjectList<TObject>.Create;189 FreeItems. FreeObjects := False;185 Items := TObjectList<TObject>.Create; 186 FreeItems := TObjectList<TObject>.Create; 187 FreeItems.OwnsObjects := False; 190 188 FReleaseEvent := TEvent.Create(nil, False, False, ''); 191 189 end; -
trunk/Packages/Common/UPrefixMultiplier.pas
r131 r137 2 2 3 3 // Date: 2010-06-01 4 5 {$mode delphi}6 4 7 5 interface -
trunk/Packages/Common/URegistry.pas
r131 r137 1 1 unit URegistry; 2 3 {$MODE delphi}4 2 5 3 interface … … 48 46 HKEY_CURRENT_CONFIG, HKEY_DYN_DATA); 49 47 48 50 49 implementation 51 52 50 53 51 { TRegistryContext } -
trunk/Packages/Common/UResetableThread.pas
r122 r137 1 1 unit UResetableThread; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface … … 167 165 FreeAndNil(FStopEvent); 168 166 FreeAndNil(FLock); 169 inherited Destroy;167 inherited; 170 168 end; 171 169 … … 286 284 constructor TThreadPool.Create; 287 285 begin 288 inherited Create;286 inherited; 289 287 end; 290 288 … … 293 291 TotalCount := 0; 294 292 WaitForEmpty; 295 inherited Destroy;293 inherited; 296 294 end; 297 295 -
trunk/Packages/Common/UScaleDPI.pas
r131 r137 3 3 { See: http://wiki.lazarus.freepascal.org/High_DPI } 4 4 5 {$mode delphi}{$H+}6 7 5 interface 8 6 9 7 uses 10 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, fgl; 8 Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, 9 Generics.Collections; 11 10 12 11 type … … 28 27 end; 29 28 30 TControlDimensions = class(T FPGObjectList<TControlDimension>)29 TControlDimensions = class(TObjectList<TControlDimension>) 31 30 end; 32 31 -
trunk/Packages/Common/UStringTable.pas
r122 r137 1 1 unit UStringTable; 2 3 {$mode objfpc}{$H+}4 2 5 3 interface -
trunk/Packages/Common/USyncCounter.pas
r122 r137 1 1 unit USyncCounter; 2 3 {$mode delphi}4 2 5 3 interface … … 25 23 procedure Assign(Source: TSyncCounter); 26 24 end; 25 27 26 28 27 implementation … … 69 68 begin 70 69 Lock.Free; 71 inherited Destroy;70 inherited; 72 71 end; 73 72 -
trunk/Packages/Common/UTheme.pas
r131 r137 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; … … 48 48 49 49 procedure Register; 50 50 51 51 52 implementation -
trunk/Packages/Common/UThreading.pas
r131 r137 1 1 unit UThreading; 2 2 3 {$mode delphi}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Forms, fgl, SyncObjs;6 Classes, SysUtils, Forms, Generics.Collections, SyncObjs; 9 7 10 8 type 11 9 TExceptionEvent = procedure (Sender: TObject; E: Exception) of object; 12 10 TMethodCall = procedure of object; 13 14 11 15 12 { TVirtualThread } … … 102 99 { TThreadList } 103 100 104 TThreadList = class(T FPGObjectList<TVirtualThread>)101 TThreadList = class(TObjectList<TVirtualThread>) 105 102 function FindById(Id: TThreadID): TVirtualThread; 106 103 constructor Create; virtual; … … 295 292 end; 296 293 FThread.Free; 297 inherited Destroy;294 inherited; 298 295 end; 299 296 … … 361 358 ThreadListLock := TCriticalSection.Create; 362 359 ThreadList := TThreadList.Create; 363 ThreadList. FreeObjects := False;360 ThreadList.OwnsObjects := False; 364 361 365 362 finalization -
trunk/Packages/Common/UTranslator.pas
r131 r137 1 1 unit UTranslator; 2 2 3 {$mode delphi}{$H+}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, Forms, ExtCtrls, Controls, fgl,LazFileUtils, LazUTF8,6 Classes, SysUtils, Forms, ExtCtrls, Controls, LazFileUtils, LazUTF8, 9 7 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType, 10 LCLVersion ;8 LCLVersion, Generics.Collections; 11 9 12 10 type 13 11 THandleStringEvent = function (AValue: string): string of object; 14 12 15 TPoFiles = class(T FPGObjectList<TPOFile>)13 TPoFiles = class(TObjectList<TPOFile>) 16 14 end; 17 15 … … 27 25 { TComponentExcludesList } 28 26 29 TComponentExcludesList = class(T FPGObjectList<TComponentExcludes>)27 TComponentExcludesList = class(TObjectList<TComponentExcludes>) 30 28 function FindByClassType(AClassType: TClass): TComponentExcludes; 31 29 procedure DumpToStrings(Strings: TStrings); … … 290 288 Item := Component.ClassType; 291 289 while Assigned(Item) do begin 292 //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);293 290 Excludes := ComponentExcludes.FindByClassType(Item.ClassType); 294 291 if Assigned(Excludes) then begin -
trunk/Packages/Common/UURI.pas
r122 r137 2 2 3 3 // Date: 2011-04-04 4 5 {$mode delphi}6 4 7 5 interface … … 85 83 end; 86 84 85 87 86 implementation 88 87 … … 183 182 begin 184 183 Items.Free; 185 inherited Destroy;184 inherited; 186 185 end; 187 186 … … 232 231 begin 233 232 Path.Free; 234 inherited Destroy;233 inherited; 235 234 end; 236 235 … … 243 242 Fragment := TURI(Source).Fragment; 244 243 Query := TURI(Source).Query; 245 end else inherited Assign(Source);244 end else inherited; 246 245 end; 247 246 … … 291 290 destructor TURL.Destroy; 292 291 begin 293 inherited Destroy;292 inherited; 294 293 end; 295 294 … … 344 343 begin 345 344 Directory.Free; 346 inherited Destroy; 347 end; 348 345 inherited; 346 end; 349 347 350 348 end. -
trunk/Packages/Common/UXMLUtils.pas
r131 r137 1 1 unit UXMLUtils; 2 3 {$mode delphi}4 2 5 3 interface
Note:
See TracChangeset
for help on using the changeset viewer.