Changeset 72 for trunk/Packages/Common
- Timestamp:
- Mar 6, 2016, 12:10:38 AM (9 years ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.lpk
r61 r72 4 4 <PathDelim Value="\"/> 5 5 <Name Value="Common"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <AddToProjectUsesSection Value="True"/> 7 8 <Author Value="Chronos (robie@centrum.cz)"/> … … 12 13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 13 14 </SearchPaths> 15 <Other> 16 <CompilerMessages> 17 <IgnoredMessages idx5024="True"/> 18 </CompilerMessages> 19 </Other> 14 20 </CompilerOptions> 15 21 <Description Value="Various libraries"/> … … 110 116 <OutDir Value="Languages"/> 111 117 </i18n> 112 <Type Value="RunAndDesignTime"/>113 118 <RequiredPkgs Count="2"> 114 119 <Item1> -
trunk/Packages/Common/Common.pas
r61 r72 5 5 unit Common; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9 -
trunk/Packages/Common/UApplicationInfo.pas
r59 r72 6 6 7 7 uses 8 SysUtils, Registry,Classes, Forms, URegistry;8 SysUtils, Classes, Forms, URegistry; 9 9 10 10 type -
trunk/Packages/Common/UCommon.pas
r59 r72 8 8 {$IFDEF Windows}Windows,{$ENDIF} 9 9 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 10 FileUtil ; //, ShFolder, ShellAPI;10 FileUtil, LazFileUtils; //, ShFolder, ShellAPI; 11 11 12 12 type … … 91 91 I: Integer; 92 92 begin 93 Result := ''; 93 94 for I := 1 to Length(Source) do begin 94 95 Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2)); … … 105 106 Path := IncludeTrailingPathDelimiter(APath); 106 107 107 Find := FindFirst( UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);108 Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec); 108 109 while Find = 0 do begin 109 DeleteFileUTF8(Path + UTF8Encode(SearchRec.Name));110 DeleteFileUTF8(Path + SearchRec.Name); 110 111 111 112 Find := SysUtils.FindNext(SearchRec); … … 416 417 417 418 procedure OpenWebPage(URL: string); 418 var419 Process: TProcess;420 Browser, Params: string;421 419 begin 422 420 OpenURL(URL); 423 {try424 Process := TProcess.Create(nil);425 Browser := '';426 //FindDefaultBrowser(Browser, Params);427 //Process.Executable := Browser;428 //Process.Parameters.Add(Format(Params, [ApplicationInfo.HomePage]);429 Process.CommandLine := 'cmd.exe /c start ' + URL;430 Process.Options := [poNoConsole];431 Process.Execute;432 finally433 Process.Free;434 end;}435 421 end; 436 422 -
trunk/Packages/Common/UDebugLog.pas
r59 r72 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, SpecializedList, SyncObjs ;8 Classes, SysUtils, FileUtil, SpecializedList, SyncObjs, LazFileUtils; 9 9 10 10 type … … 104 104 if ExtractFileDir(FileName) <> '' then 105 105 ForceDirectoriesUTF8(ExtractFileDir(FileName)); 106 if FileExistsUTF8(FileName) then LogFile := TFileStream.Create( UTF8Decode(FileName), fmOpenWrite)107 else LogFile := TFileStream.Create( UTF8Decode(FileName), fmCreate);106 if FileExistsUTF8(FileName) then LogFile := TFileStream.Create(FileName, fmOpenWrite) 107 else LogFile := TFileStream.Create(FileName, fmCreate); 108 108 LogFile.Seek(0, soFromEnd); 109 109 Text := FormatDateTime('hh:nn:ss.zzz', Now) + ': ' + Text + LineEnding; -
trunk/Packages/Common/UFindFile.pas
r59 r72 24 24 25 25 uses 26 SysUtils, Classes, Graphics, Controls, Forms, Dialogs , FileCtrl;26 SysUtils, Classes, Graphics, Controls, Forms, Dialogs; 27 27 28 28 type … … 116 116 if ffaAnyFile in FileAttr then Attr := Attr + faAnyFile; 117 117 118 if SysUtils.FindFirst( UTF8Decode(inPath + FileMask), Attr, Rec) = 0 then118 if SysUtils.FindFirst(inPath + FileMask, Attr, Rec) = 0 then 119 119 try 120 120 repeat … … 127 127 If not InSubFolders then Exit; 128 128 129 if SysUtils.FindFirst( UTF8Decode(inPath + '*.*'), faDirectory, Rec) = 0 then129 if SysUtils.FindFirst(inPath + '*.*', faDirectory, Rec) = 0 then 130 130 try 131 131 repeat -
trunk/Packages/Common/ULastOpenedList.pas
r59 r72 139 139 OpenKey(Context.Key, True); 140 140 for I := 0 to Items.Count - 1 do 141 WriteString('File' + IntToStr(I), UTF8Decode(Items[I]));141 WriteString('File' + IntToStr(I), Items[I]); 142 142 finally 143 143 Free; -
trunk/Packages/Common/UListViewSort.pas
r59 r72 119 119 var 120 120 I: Integer; 121 NewColumn: TGridColumn;122 121 begin 123 122 with FStringGrid1 do begin 124 123 Columns.Clear; 125 124 while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1); 126 while Columns.Count < ListView.Columns.Count do NewColumn :=Columns.Add;125 while Columns.Count < ListView.Columns.Count do Columns.Add; 127 126 for I := 0 to ListView.Columns.Count - 1 do begin 128 127 Columns[I].Width := ListView.Columns[I].Width; -
trunk/Packages/Common/UScaleDPI.pas
r61 r72 27 27 function ScaleX(Size: Integer; FromDPI: Integer): Integer; 28 28 function ScaleY(Size: Integer; FromDPI: Integer): Integer; 29 constructor Create(AOwner: TComponent); 29 constructor Create(AOwner: TComponent); override; 30 30 published 31 31 property AutoDetect: Boolean read FAutoDetect write SetAutoDetect; -
trunk/Packages/Common/UURI.pas
r59 r72 89 89 function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean; 90 90 var 91 I , J: Integer;91 I: Integer; 92 92 Matched: Boolean; 93 93 begin … … 113 113 function RightCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean; 114 114 var 115 I , J: Integer;115 I: Integer; 116 116 Matched: Boolean; 117 117 begin … … 202 202 203 203 procedure TURI.SetAsString(Value: string); 204 var205 HostAddr: string;206 HostPort: string;207 204 begin 208 205 LeftCutString(Value, Scheme, ':'); -
trunk/Packages/Common/UXMLUtils.pas
r54 r72 10 10 11 11 function XMLTimeToDateTime(XMLDateTime: string): TDateTime; 12 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;12 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string; 13 13 14 14 … … 35 35 function LeftCutString(var Source: string; out Output: string; Delimiter: string; Allowed: string = ''): Boolean; 36 36 var 37 I , J: Integer;37 I: Integer; 38 38 Matched: Boolean; 39 39 begin … … 106 106 end; 107 107 108 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString;108 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): string; 109 109 const 110 110 Neg: array[Boolean] of string = ('+', '-');
Note:
See TracChangeset
for help on using the changeset viewer.