Changeset 72 for trunk/Packages
- Timestamp:
- Mar 6, 2016, 12:10:38 AM (9 years ago)
- Location:
- trunk/Packages
- Files:
-
- 17 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 = ('+', '-'); -
trunk/Packages/CoolTranslator/CoolTranslator.pas
r54 r72 3 3 } 4 4 5 unit CoolTranslator; 5 unit CoolTranslator; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9 … … 12 13 implementation 13 14 14 procedure Register; 15 procedure Register; 15 16 begin 16 RegisterUnit('UCoolTranslator', @UCoolTranslator.Register); 17 end; 17 RegisterUnit('UCoolTranslator', @UCoolTranslator.Register); 18 end; 18 19 19 20 initialization 20 RegisterPackage('CoolTranslator', @Register); 21 RegisterPackage('CoolTranslator', @Register); 21 22 end. -
trunk/Packages/CoolTranslator/UCoolTranslator.pas
r54 r72 6 6 7 7 uses 8 Classes, SysUtils, Forms, StdCtrls, ExtCtrls, StrUtils, Controls, Contnrs, 9 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType; 8 Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs, 9 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType, 10 LazFileUtils, LazUTF8; 10 11 11 12 type … … 190 191 PropInfo: PPropInfo; 191 192 PropList: PPropList; 192 Excludes: TComponentExcludes;193 193 begin 194 194 Count := GetTypeData(Component.ClassInfo)^.PropCount; … … 223 223 var 224 224 PropType: PTypeInfo; 225 Parent: TObject;226 225 Obj: TObject; 227 226 I: Integer; … … 244 243 if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then 245 244 //if not IsExcluded(Component, PropInfo^.Name) then 246 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, Get WideStrProp(Component, PropInfo)));245 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetStrProp(Component, PropInfo))); 247 246 end; 248 247 tkClass: begin … … 382 381 T: string; 383 382 begin 383 T := ''; 384 384 385 // Win32 user may decide to override locale with LANG variable. 385 386 Lang := GetEnvironmentVariableUTF8('LANG'); … … 396 397 end; 397 398 if Lang = '' then 398 L CLGetLanguageIDs(Lang, T);399 LazGetLanguageIDs(Lang, T); 399 400 400 401 if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin … … 414 415 function TCoolTranslator.FindLocaleFileName(LCExt: string): string; 415 416 var 416 T: string;417 I: Integer;418 417 Lang: string; 419 418 begin -
trunk/Packages/TemplateGenerics/Additional/UBinarySerializer.pas
r54 r72 65 65 StringLength: Longint; 66 66 begin 67 StringLength := 0; 67 68 FStream.ReadBuffer(StringLength, SizeOf(StringLength)); 68 69 Result := ReadString(StringLength); … … 94 95 function TBinarySerializer.ReadByte: Byte; 95 96 begin 97 Result := 0; 96 98 FStream.ReadBuffer(Result, SizeOf(Byte)); 97 99 end; … … 99 101 function TBinarySerializer.ReadCardinal: Cardinal; 100 102 begin 103 Result := 0; 101 104 FStream.ReadBuffer(Result, SizeOf(Cardinal)); 102 105 if SwapData then Result := SwapEndian(Result); … … 105 108 function TBinarySerializer.ReadInt64: Int64; 106 109 begin 110 Result := 0; 107 111 FStream.ReadBuffer(Result, SizeOf(Int64)); 108 112 if SwapData then Result := SwapEndian(Result); … … 121 125 Count: Byte; 122 126 begin 127 Count := 0; 123 128 FStream.ReadBuffer(Count, 1); 124 129 Result := ReadString(Count); … … 206 211 function TBinarySerializer.ReadDouble: Double; 207 212 begin 213 Result := 0; 208 214 FStream.ReadBuffer(Result, SizeOf(Double)); 209 215 end; … … 211 217 function TBinarySerializer.ReadSingle: Single; 212 218 begin 219 Result := 0; 213 220 FStream.ReadBuffer(Result, SizeOf(Single)); 214 221 end; … … 216 223 function TBinarySerializer.ReadWord: Word; 217 224 begin 225 Result := 0; 218 226 FStream.ReadBuffer(Result, SizeOf(Word)); 219 227 if SwapData then Result := SwapEndian(Result); … … 262 270 procedure TBinarySerializer.WriteByte(Data: Byte); 263 271 begin 272 Data := 0; 264 273 FStream.WriteBuffer(Data, SizeOf(Byte)); 265 274 end; -
trunk/Packages/TemplateGenerics/Generic/GenericMatrix.inc
r54 r72 49 49 function Implode(RowSeparator, ColSeparator: string; Converter: TGMatrixToStringConverter): string; 50 50 procedure Explode(Text, Separator: string; Converter: TGMatrixFromStringConverter; SlicesCount: Integer = -1); 51 function IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex = 0): TGMatrixIndex;52 function IndexOfList(List: TGMatrix; Start: TGMatrixIndex = 0): TGMatrixIndex;51 function IndexOf(Item: TGMatrixItem; Start: TGMatrixIndex): TGMatrixIndex; 52 function IndexOfList(List: TGMatrix; Start: TGMatrixIndex): TGMatrixIndex; 53 53 procedure Insert(Index: TGMatrixIndex; Item: TGMatrixItem); 54 54 procedure InsertList(Index: TGMatrixIndex; List: TGMatrix); -
trunk/Packages/TemplateGenerics/TemplateGenerics.lpk
r54 r72 1 <?xml version="1.0" ?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 3 <Package Version="4"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="TemplateGenerics"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <AddToProjectUsesSection Value="True"/> 7 8 <Author Value="Chronos (robie@centrum.cz)"/> … … 16 17 <CodeGeneration> 17 18 <Optimizations> 19 <OptimizationLevel Value="3"/> 18 20 <VariablesInRegisters Value="True"/> 19 <OptimizationLevel Value="3"/>20 21 </Optimizations> 21 22 </CodeGeneration> 22 23 <Other> 23 24 <CompilerMessages> 24 < UseMsgFile Value="True"/>25 <IgnoredMessages idx5024="True"/> 25 26 </CompilerMessages> 26 <CompilerPath Value="$(CompPath)"/>27 27 </Other> 28 28 </CompilerOptions> … … 139 139 </Item27> 140 140 </Files> 141 <Type Value="RunAndDesignTime"/>142 141 <RequiredPkgs Count="2"> 143 142 <Item1> -
trunk/Packages/TemplateGenerics/TemplateGenerics.pas
r54 r72 5 5 unit TemplateGenerics; 6 6 7 {$warn 5023 off : no warning about unused units} 7 8 interface 8 9
Note:
See TracChangeset
for help on using the changeset viewer.