Changeset 15 for trunk/Packages
- Timestamp:
- Feb 27, 2018, 6:11:44 PM (7 years ago)
- Location:
- trunk/Packages
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Common.lpk
r1 r15 11 11 <PathDelim Value="\"/> 12 12 <SearchPaths> 13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) "/>13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 14 14 </SearchPaths> 15 <Parsing> 16 <SyntaxOptions> 17 <SyntaxMode Value="Delphi"/> 18 <CStyleOperator Value="False"/> 19 <AllowLabel Value="False"/> 20 <CPPInline Value="False"/> 21 </SyntaxOptions> 22 </Parsing> 23 <CodeGeneration> 24 <Optimizations> 25 <OptimizationLevel Value="0"/> 26 </Optimizations> 27 </CodeGeneration> 28 <Linking> 29 <Debugging> 30 <GenerateDebugInfo Value="False"/> 31 </Debugging> 32 </Linking> 33 <Other> 34 <CompilerMessages> 35 <IgnoredMessages idx5024="True"/> 36 </CompilerMessages> 37 </Other> 15 38 </CompilerOptions> 16 39 <Description Value="Various libraries"/> 17 40 <License Value="GNU/GPL"/> 18 41 <Version Minor="7"/> 19 <Files Count="2 0">42 <Files Count="21"> 20 43 <Item1> 21 44 <Filename Value="StopWatch.pas"/> … … 106 129 <UnitName Value="UScaleDPI"/> 107 130 </Item20> 131 <Item21> 132 <Filename Value="UTheme.pas"/> 133 <HasRegisterProc Value="True"/> 134 <UnitName Value="UTheme"/> 135 </Item21> 108 136 </Files> 109 137 <i18n> -
trunk/Packages/Common/Common.pas
r1 r15 8 8 9 9 uses 10 StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading, 11 UMemory, UResetableThread, UPool, ULastOpenedList, URegistry, 12 UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort, 13 UPersistentForm, UFindFile, UScaleDPI, LazarusPackageIntf;10 StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading, 11 UMemory, UResetableThread, UPool, ULastOpenedList, URegistry, 12 UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter, UListViewSort, 13 UPersistentForm, UFindFile, UScaleDPI, UTheme, LazarusPackageIntf; 14 14 15 15 implementation … … 25 25 RegisterUnit('UFindFile', @UFindFile.Register); 26 26 RegisterUnit('UScaleDPI', @UScaleDPI.Register); 27 RegisterUnit('UTheme', @UTheme.Register); 27 28 end; 28 29 -
trunk/Packages/Common/UCommon.pas
r1 r15 28 28 unfDNSDomainName = 11); 29 29 30 TFilterMethodMethod = function (FileName: string): Boolean of object; 30 31 var 31 32 ExceptionHandler: TExceptionEvent; … … 63 64 procedure OpenWebPage(URL: string); 64 65 procedure OpenFileInShell(FileName: string); 65 procedure ExecuteProgram( CommandLine:string);66 procedure ExecuteProgram(Executable: string; Parameters: array of string); 66 67 procedure FreeThenNil(var Obj); 67 68 function RemoveQuotes(Text: string): string; … … 70 71 function GetDirCount(Dir: string): Integer; 71 72 function MergeArray(A, B: array of string): TArrayOfString; 73 function LoadFileToStr(const FileName: TFileName): AnsiString; 74 procedure SearchFiles(AList: TStrings; Dir: string; 75 FilterMethod: TFilterMethodMethod); 72 76 73 77 … … 111 115 Path := IncludeTrailingPathDelimiter(APath); 112 116 113 Find := FindFirst( UTF8Decode(Path + AFileSpec), faAnyFile xor faDirectory, SearchRec);117 Find := FindFirst(Path + AFileSpec, faAnyFile xor faDirectory, SearchRec); 114 118 while Find = 0 do begin 115 DeleteFile(Path + UTF8Encode(SearchRec.Name));119 DeleteFile(Path + SearchRec.Name); 116 120 117 121 Find := SysUtils.FindNext(SearchRec); … … 428 432 end; 429 433 430 procedure ExecuteProgram( CommandLine:string);434 procedure ExecuteProgram(Executable: string; Parameters: array of string); 431 435 var 432 436 Process: TProcess; 437 I: Integer; 433 438 begin 434 439 try 435 440 Process := TProcess.Create(nil); 436 Process.CommandLine := CommandLine; 441 Process.Executable := Executable; 442 for I := 0 to Length(Parameters) - 1 do 443 Process.Parameters.Add(Parameters[I]); 437 444 Process.Options := [poNoConsole]; 438 445 Process.Execute; … … 455 462 procedure OpenFileInShell(FileName: string); 456 463 begin 457 ExecuteProgram('cmd.exe /c start "' + FileName + '"');464 ExecuteProgram('cmd.exe', ['/c', 'start', FileName]); 458 465 end; 459 466 … … 492 499 end; 493 500 501 function LoadFileToStr(const FileName: TFileName): AnsiString; 502 var 503 FileStream: TFileStream; 504 Read: Integer; 505 begin 506 Result := ''; 507 FileStream := TFileStream.Create(FileName, fmOpenRead); 508 try 509 if FileStream.Size > 0 then begin 510 SetLength(Result, FileStream.Size); 511 Read := FileStream.Read(Pointer(Result)^, FileStream.Size); 512 SetLength(Result, Read); 513 end; 514 finally 515 FileStream.Free; 516 end; 517 end; 518 519 function DefaultSearchFilter(const FileName: string): Boolean; 520 begin 521 Result := True; 522 end; 523 524 procedure SearchFiles(AList: TStrings; Dir: string; 525 FilterMethod: TFilterMethodMethod); 526 var 527 SR: TSearchRec; 528 begin 529 Dir := IncludeTrailingPathDelimiter(Dir); 530 if FindFirst(Dir + '*', faAnyFile, SR) = 0 then 531 try 532 repeat 533 if (SR.Name = '.') or (SR.Name = '..') or not FilterMethod(SR.Name) then Continue; 534 AList.Add(Dir + SR.Name); 535 if (SR.Attr and faDirectory) <> 0 then 536 SearchFiles(AList, Dir + SR.Name, FilterMethod); 537 until FindNext(SR) <> 0; 538 finally 539 FindClose(SR); 540 end; 541 end; 494 542 495 543 -
trunk/Packages/Common/UListViewSort.pas
r1 r15 81 81 FOnChange: TNotifyEvent; 82 82 FStringGrid1: TStringGrid; 83 procedure DoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);84 procedure DoOnResize(Sender: TObject);83 procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 84 procedure GridDoOnResize(Sender: TObject); 85 85 public 86 86 constructor Create(AOwner: TComponent); override; … … 110 110 { TListViewFilter } 111 111 112 procedure TListViewFilter. DoOnKeyUp(Sender: TObject; var Key: Word;112 procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word; 113 113 Shift: TShiftState); 114 114 begin … … 117 117 end; 118 118 119 procedure TListViewFilter. DoOnResize(Sender: TObject);119 procedure TListViewFilter.GridDoOnResize(Sender: TObject); 120 120 begin 121 121 FStringGrid1.DefaultRowHeight := FStringGrid1.Height; … … 135 135 FStringGrid1.Options := [goFixedHorzLine, goFixedVertLine, goVertLine, 136 136 goHorzLine, goRangeSelect, goEditing, goAlwaysShowEditor, goSmoothScroll]; 137 FStringGrid1.OnKeyUp := DoOnKeyUp;138 FStringGrid1.OnResize := DoOnResize;137 FStringGrid1.OnKeyUp := GridDoOnKeyUp; 138 FStringGrid1.OnResize := GridDoOnResize; 139 139 end; 140 140 … … 144 144 begin 145 145 with FStringGrid1 do begin 146 Options := Options - [goEditing, goAlwaysShowEditor]; 146 147 //Columns.Clear; 147 148 while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1); … … 150 151 Columns[I].Width := ListView.Columns[I].Width; 151 152 end; 153 Options := Options + [goEditing, goAlwaysShowEditor]; 152 154 end; 153 155 end; … … 197 199 if AMsg.Msg = WM_NOTIFY then 198 200 begin 199 Code := PHDNotify(vMsgNotify.NMHdr)^.Hdr.Code;201 Code := NMHDR(PHDNotify(vMsgNotify.NMHdr)^.Hdr).Code; 200 202 case Code of 201 203 HDN_ENDTRACKA, HDN_ENDTRACKW: … … 353 355 TP1: TPoint; 354 356 XBias, YBias: Integer; 355 OldColor: TColor; 357 PenColor: TColor; 358 BrushColor: TColor; 356 359 BiasTop, BiasLeft: Integer; 357 360 Rect1: TRect; … … 365 368 Item.Left := 0; 366 369 GetCheckBias(XBias, YBias, BiasTop, BiasLeft, ListView); 367 OldColor := ListView.Canvas.Pen.Color; 370 PenColor := ListView.Canvas.Pen.Color; 371 BrushColor := ListView.Canvas.Brush.Color; 368 372 //TP1 := Item.GetPosition; 369 373 lRect := Item.DisplayRect(drBounds); // Windows 7 workaround … … 408 412 end; 409 413 //ListView.Canvas.Brush.Color := ListView.Color; 410 ListView.Canvas.Brush.Color := clWindow;411 ListView.Canvas.Pen.Color := OldColor;414 ListView.Canvas.Brush.Color := BrushColor; 415 ListView.Canvas.Pen.Color := PenColor; 412 416 end; 413 417 -
trunk/Packages/CoolTranslator/CoolTranslator.lpk
r1 r15 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="CoolTranslator"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <AddToProjectUsesSection Value="True"/> 7 8 <Author Value="Chronos (robie@centrum.cz)"/> 8 9 <CompilerOptions> 9 <Version Value="1 0"/>10 <Version Value="11"/> 10 11 <PathDelim Value="\"/> 11 12 <SearchPaths> 12 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) "/>13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 13 14 </SearchPaths> 15 <Parsing> 16 <SyntaxOptions> 17 <SyntaxMode Value="Delphi"/> 18 <CStyleOperator Value="False"/> 19 <AllowLabel Value="False"/> 20 <CPPInline Value="False"/> 21 </SyntaxOptions> 22 </Parsing> 23 <CodeGeneration> 24 <Optimizations> 25 <OptimizationLevel Value="0"/> 26 </Optimizations> 27 </CodeGeneration> 28 <Linking> 29 <Debugging> 30 <GenerateDebugInfo Value="False"/> 31 </Debugging> 32 </Linking> 14 33 <Other> 15 <CompilerPath Value="$(CompPath)"/> 34 <CompilerMessages> 35 <IgnoredMessages idx5024="True"/> 36 </CompilerMessages> 16 37 </Other> 17 38 </CompilerOptions> … … 38 59 <OutDir Value="Languages"/> 39 60 </i18n> 40 <Type Value="RunAndDesignTime"/>41 61 <RequiredPkgs Count="2"> 42 62 <Item1> -
trunk/Packages/TemplateGenerics/TemplateGenerics.lpk
r1 r15 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)"/> … … 12 13 <IncludeFiles Value="Generic"/> 13 14 <OtherUnitFiles Value="Specialized;Generic;Additional"/> 14 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) "/>15 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 15 16 </SearchPaths> 17 <Parsing> 18 <SyntaxOptions> 19 <SyntaxMode Value="Delphi"/> 20 <CStyleOperator Value="False"/> 21 <AllowLabel Value="False"/> 22 <CPPInline Value="False"/> 23 </SyntaxOptions> 24 </Parsing> 16 25 <CodeGeneration> 17 26 <Optimizations> 27 <OptimizationLevel Value="0"/> 18 28 <VariablesInRegisters Value="True"/> 19 <OptimizationLevel Value="3"/>20 29 </Optimizations> 21 30 </CodeGeneration> 31 <Linking> 32 <Debugging> 33 <GenerateDebugInfo Value="False"/> 34 </Debugging> 35 </Linking> 22 36 <Other> 23 37 <CompilerMessages> 24 < UseMsgFile Value="True"/>38 <IgnoredMessages idx5024="True"/> 25 39 </CompilerMessages> 26 <CompilerPath Value="$(CompPath)"/>27 40 </Other> 28 41 </CompilerOptions> … … 48 61 <Item5> 49 62 <Filename Value="Generic\GenericFileList.inc"/> 63 <UnitName Value="GenericFileList"/> 50 64 </Item5> 51 65 <Item6> … … 142 156 </Item28> 143 157 </Files> 144 <Type Value="RunAndDesignTime"/>145 158 <RequiredPkgs Count="2"> 146 159 <Item1>
Note:
See TracChangeset
for help on using the changeset viewer.