- Timestamp:
- Apr 25, 2022, 6:32:09 PM (3 years ago)
- Location:
- Common
- Files:
-
- 2 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/Common.lpk
r555 r558 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"/>43 <Version Minor="10"/> 44 44 <Files Count="29"> 45 45 <Item1> -
Common/StopWatch.pas
r393 r558 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} -
Common/UAboutDialog.pas
r555 r558 1 1 unit UAboutDialog; 2 3 {$mode delphi}4 2 5 3 interface -
Common/UApplicationInfo.pas
r548 r558 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 -
Common/UCommon.pas
r557 r558 1 1 unit UCommon; 2 3 {$mode delphi}4 2 5 3 interface … … 8 6 {$IFDEF WINDOWS}Windows,{$ENDIF} 9 7 {$IFDEF UNIX}baseunix,{$ENDIF} 10 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 8 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics, 11 9 FileUtil; //, ShFolder, ShellAPI; 12 10 … … 34 32 DLLHandle1: HModule; 35 33 36 {$IFDEF WINDOWS} 37 GetUserNameEx: procedure (NameFormat: DWORD; 38 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; 39 {$ENDIF} 34 {$IFDEF WINDOWS} 35 GetUserNameEx: procedure (NameFormat: DWORD; 36 lpNameBuffer: LPSTR; nSize: PULONG); stdcall; 37 {$ENDIF} 38 39 const 40 clLightBlue = TColor($FF8080); 41 clLightGreen = TColor($80FF80); 42 clLightRed = TColor($8080FF); 40 43 41 44 function AddLeadingZeroes(const aNumber, Length : integer) : string; -
Common/UDebugLog.pas
r520 r558 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; -
Common/UDelay.pas
r303 r558 1 1 unit UDelay; 2 3 {$mode delphi}4 2 5 3 interface -
Common/UFindFile.pas
r555 r558 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 -
Common/UFormAbout.pas
r553 r558 1 1 unit UFormAbout; 2 3 {$mode delphi}4 2 5 3 interface -
Common/UGeometric.pas
r555 r558 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 -
Common/UJobProgressView.pas
r555 r558 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 -
Common/ULanguages.pas
r554 r558 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); -
Common/ULastOpenedList.pas
r556 r558 1 1 unit ULastOpenedList; 2 3 {$mode delphi}4 2 5 3 interface -
Common/UListViewSort.pas
r552 r558 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; … … 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; -
Common/UMemory.pas
r527 r558 1 1 unit UMemory; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface … … 43 41 property Position: Integer read FPosition write FPosition; 44 42 end; 43 45 44 46 45 implementation -
Common/UMetaCanvas.pas
r555 r558 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 -
Common/UPersistentForm.pas
r548 r558 1 1 unit UPersistentForm; 2 3 {$mode delphi}4 2 5 3 // Date: 2020-11-26 -
Common/UPixelPointer.pas
r551 r558 59 59 function Color32ToColor(Color: TColor32): TColor; 60 60 function ColorToColor32(Color: TColor): TColor32; 61 61 62 62 63 implementation -
Common/UPool.pas
r520 r558 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; … … 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; -
Common/UPrefixMultiplier.pas
r520 r558 2 2 3 3 // Date: 2010-06-01 4 5 {$mode delphi}6 4 7 5 interface -
Common/URegistry.pas
r555 r558 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 } -
Common/UResetableThread.pas
r510 r558 1 1 unit UResetableThread; 2 3 {$mode Delphi}{$H+}4 2 5 3 interface -
Common/UScaleDPI.pas
r555 r558 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 -
Common/UStringTable.pas
r510 r558 1 1 unit UStringTable; 2 3 {$mode objfpc}{$H+}4 2 5 3 interface -
Common/USyncCounter.pas
r434 r558 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 -
Common/UTheme.pas
r552 r558 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; … … 42 42 end; 43 43 44 const 45 ThemeNameSystem = 'System'; 46 ThemeNameLight = 'Light'; 47 ThemeNameDark = 'Dark'; 48 44 49 procedure Register; 50 45 51 46 52 implementation … … 105 111 inherited; 106 112 Themes := TThemes.Create; 107 with Themes.AddNew( 'System') do begin113 with Themes.AddNew(ThemeNameSystem) do begin 108 114 ColorWindow := clWindow; 109 115 ColorWindowText := clWindowText; … … 113 119 end; 114 120 Theme := TTheme(Themes.First); 115 with Themes.AddNew( 'Dark') do begin121 with Themes.AddNew(ThemeNameDark) do begin 116 122 ColorWindow := RGBToColor($20, $20, $20); 117 123 ColorWindowText := clWhite; … … 120 126 ColorControlSelected := RGBToColor(96, 125, 155); 121 127 end; 122 with Themes.AddNew( 'Light') do begin128 with Themes.AddNew(ThemeNameLight) do begin 123 129 ColorWindow := clWhite; 124 130 ColorWindowText := clBlack; … … 175 181 procedure TThemeManager.UseTheme(Form: TForm); 176 182 begin 177 if not Used and (FTheme.Name = 'System') then Exit;183 if not Used and (FTheme.Name = ThemeNameSystem) then Exit; 178 184 ApplyTheme(Form); 179 185 Used := True; -
Common/UThreading.pas
r550 r558 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; … … 361 358 ThreadListLock := TCriticalSection.Create; 362 359 ThreadList := TThreadList.Create; 363 ThreadList. FreeObjects := False;360 ThreadList.OwnsObjects := False; 364 361 365 362 finalization -
Common/UTranslator.pas
r554 r558 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 -
Common/UURI.pas
r510 r558 2 2 3 3 // Date: 2011-04-04 4 5 {$mode delphi}6 4 7 5 interface … … 84 82 property AsString: string read GetAsString write SetAsString; 85 83 end; 84 86 85 87 86 implementation -
Common/UXMLUtils.pas
r518 r558 1 1 unit UXMLUtils; 2 3 {$mode delphi}4 2 5 3 interface
Note:
See TracChangeset
for help on using the changeset viewer.