- Timestamp:
- May 6, 2019, 2:49:33 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 1 deleted
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormAcronyms.pas
r184 r204 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 Menus, ActnList, UListViewSort, UAcronym, LazUTF8, SpecializedList;9 Menus, ActnList, UListViewSort, UAcronym, LazUTF8, fgl; 10 10 11 11 type … … 52 52 FAcronyms: TAcronyms; 53 53 MeaningCount: Integer; 54 procedure FilterList(List: T ListObject);54 procedure FilterList(List: TFPGObjectList<TObject>); 55 55 procedure SetAcronyms(AValue: TAcronyms); 56 56 procedure UpdateAcronymsList; … … 296 296 end; 297 297 298 procedure TFormAcronyms.FilterList(List: T ListObject);298 procedure TFormAcronyms.FilterList(List: TFPGObjectList<TObject>); 299 299 var 300 300 I: Integer; -
trunk/Forms/UFormCategories.lfm
r203 r204 49 49 Width = 784 50 50 Align = alBottom 51 Caption = 'ToolBar1'52 51 Images = Core.ImageList1 53 52 ParentShowHint = False -
trunk/Forms/UFormCategories.lrj
r203 r204 3 3 {"hash":346165,"name":"tformcategories.listviewcategories.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"}, 4 4 {"hash":107848676,"name":"tformcategories.listviewcategories.columns[1].caption","sourcebytes":[85,115,101,100,32,99,111,117,110,116],"value":"Used count"}, 5 {"hash":106991073,"name":"tformcategories.toolbar1.caption","sourcebytes":[84,111,111,108,66,97,114,49],"value":"ToolBar1"},6 5 {"hash":18340,"name":"tformcategories.aadd.caption","sourcebytes":[65,100,100],"value":"Add"}, 7 6 {"hash":93079237,"name":"tformcategories.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"}, -
trunk/Forms/UFormCheck.pas
r199 r204 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,8 Classes, SysUtils, LazFileUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ExtCtrls, ComCtrls, Menus, ActnList, UAcronym, URegistry, Registry, UCommon, 10 10 fgl; … … 394 394 State := stNone; 395 395 StartIndex := 0; 396 Acronym := ''; 396 397 repeat 397 398 if State = stAcronymUsage then begin -
trunk/Forms/UFormImportFormats.lfm
r203 r204 43 43 Width = 739 44 44 Align = alBottom 45 Caption = 'ToolBar1'46 45 Images = Core.ImageList1 47 46 ParentFont = False -
trunk/Forms/UFormImportFormats.lrj
r203 r204 2 2 {"hash":153070547,"name":"tformimportformats.caption","sourcebytes":[73,109,112,111,114,116,32,102,111,114,109,97,116,115],"value":"Import formats"}, 3 3 {"hash":346165,"name":"tformimportformats.listview1.columns[0].caption","sourcebytes":[78,97,109,101],"value":"Name"}, 4 {"hash":106991073,"name":"tformimportformats.toolbar1.caption","sourcebytes":[84,111,111,108,66,97,114,49],"value":"ToolBar1"},5 4 {"hash":18340,"name":"tformimportformats.aadd.caption","sourcebytes":[65,100,100],"value":"Add"}, 6 5 {"hash":93079237,"name":"tformimportformats.aremove.caption","sourcebytes":[82,101,109,111,118,101],"value":"Remove"}, -
trunk/Forms/UFormImportSources.pas
r174 r204 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ActnList, Menus, UAcronym, UJobProgressView, UListViewSort, SpecializedList, 10 LazUTF8; 9 ActnList, Menus, UAcronym, UJobProgressView, UListViewSort, LazUTF8, fgl; 11 10 12 11 type … … 63 62 private 64 63 procedure ProcessImportJob(Job: TJob); 65 procedure FilterList(List: T ListObject);64 procedure FilterList(List: TFPGObjectList<TObject>); 66 65 public 67 66 ImportSources: TImportSources; … … 297 296 end; 298 297 299 procedure TFormImportSources.FilterList(List: T ListObject);298 procedure TFormImportSources.FilterList(List: TFPGObjectList<TObject>); 300 299 var 301 300 I: Integer; -
trunk/Forms/UFormMain.pas
r200 r204 9 9 ComCtrls, StdCtrls, ExtCtrls, ActnList, Grids, UAcronym, UPersistentForm, 10 10 URegistry, ULastOpenedList, UListViewSort, UJobProgressView, 11 Registry, SpecializedList, LazUTF8, LazFileUtils;11 Registry, fgl, LazUTF8, LazFileUtils; 12 12 13 13 type … … 151 151 function FilterCell(Text1, Text2: string): Boolean; 152 152 procedure ProcessImportsJob(Job: TJob); 153 procedure FilterList(List: T ListObject);153 procedure FilterList(List: TFPGObjectList<TObject>); 154 154 procedure OpenRecentClick(Sender: TObject); 155 155 procedure SetToolbarHints; … … 655 655 end; 656 656 657 procedure TFormMain.FilterList(List: T ListObject);657 procedure TFormMain.FilterList(List: TFPGObjectList<TObject>); 658 658 var 659 659 I: Integer; -
trunk/Languages/AcronymDecoder.cs.po
r203 r204 10 10 "Content-Transfer-Encoding: 8bit\n" 11 11 "Language: cs\n" 12 "X-Generator: Poedit 1.8.8\n"12 "X-Generator: Poedit 2.2\n" 13 13 14 14 #: tformabout.buttonclose.caption … … 34 34 msgctxt "tformabout.labelcontent.caption" 35 35 msgid " " 36 msgstr " "36 msgstr " " 37 37 38 38 #: tformacronym.acategoryadd.caption … … 128 128 msgstr "ToolBar1" 129 129 130 #: tformcategories.aadd.caption 131 msgctxt "tformcategories.aadd.caption" 132 msgid "Add" 133 msgstr "Přidat" 134 135 #: tformcategories.adisable.caption 136 msgctxt "tformcategories.adisable.caption" 137 msgid "Disable" 138 msgstr "Zakázat" 139 140 #: tformcategories.aenable.caption 141 msgctxt "tformcategories.aenable.caption" 142 msgid "Enable" 143 msgstr "Povolit" 144 145 #: tformcategories.amodify.caption 146 msgctxt "tformcategories.amodify.caption" 147 msgid "Modify" 148 msgstr "Upravit" 149 150 #: tformcategories.aremove.caption 151 msgctxt "tformcategories.aremove.caption" 152 msgid "Remove" 153 msgstr "Odebrat" 154 155 #: tformcategories.aselectall.caption 156 msgctxt "tformcategories.aselectall.caption" 157 msgid "Select all" 158 msgstr "Vybrat vše" 159 160 #: tformcategories.caption 161 msgid "Acronym categories" 162 msgstr "Kategorie zkratek" 163 164 #: tformcategories.listviewcategories.columns[0].caption 165 msgctxt "tformcategories.listviewcategories.columns[0].caption" 166 msgid "Name" 167 msgstr "Název" 168 169 #: tformcategories.listviewcategories.columns[1].caption 170 msgid "Used count" 171 msgstr "Počet použitých" 172 173 #: tformcategoryselect.buttoncancel.caption 174 msgctxt "tformcategoryselect.buttoncancel.caption" 175 msgid "Cancel" 176 msgstr "Zrušit" 177 178 #: tformcategoryselect.buttonok.caption 179 msgid "Select" 180 msgstr "Vybrat" 181 182 #: tformcategoryselect.caption 183 msgid "Select categories" 184 msgstr "Vybrat kategorie" 185 130 186 #: tformcheck.agotolocation.caption 131 187 msgctxt "tformcheck.agotolocation.caption" … … 258 314 msgstr "Formát dat:" 259 315 316 #: tformimportformat.aadd.caption 317 msgctxt "tformimportformat.aadd.caption" 318 msgid "Add" 319 msgstr "Přidat" 320 321 #: tformimportformat.amodify.caption 322 msgctxt "tformimportformat.amodify.caption" 323 msgid "Modify" 324 msgstr "Upravit" 325 326 #: tformimportformat.amovedown.caption 327 msgid "Move down" 328 msgstr "Posunout dolů" 329 330 #: tformimportformat.amoveup.caption 331 msgid "Move up" 332 msgstr "Posunout nahoru" 333 334 #: tformimportformat.aremove.caption 335 msgctxt "tformimportformat.aremove.caption" 336 msgid "Remove" 337 msgstr "Odebrat" 338 339 #: tformimportformat.buttoncancel.caption 340 msgctxt "tformimportformat.buttoncancel.caption" 341 msgid "Cancel" 342 msgstr "Zrušit" 343 344 #: tformimportformat.buttonok.caption 345 msgctxt "tformimportformat.buttonok.caption" 346 msgid "Ok" 347 msgstr "Ok" 348 349 #: tformimportformat.caption 350 msgid "Import format" 351 msgstr "Formát importu" 352 353 #: tformimportformat.label1.caption 354 msgctxt "tformimportformat.label1.caption" 355 msgid "Name:" 356 msgstr "Název:" 357 358 #: tformimportformat.label2.caption 359 msgid "Item rules:" 360 msgstr "Pravidla položky:" 361 362 #: tformimportformat.label3.caption 363 msgid "Type:" 364 msgstr "Typ:" 365 366 #: tformimportformat.label8.caption 367 msgid "Block start:" 368 msgstr "Začátek bloku:" 369 370 #: tformimportformat.label9.caption 371 msgid "Block end:" 372 msgstr "Konec bloku:" 373 374 #: tformimportformat.listviewitemrules.columns[0].caption 375 msgid "Start string" 376 msgstr "Počáteční řetězec" 377 378 #: tformimportformat.listviewitemrules.columns[1].caption 379 msgid "End string" 380 msgstr "Konec řetězce" 381 382 #: tformimportformat.listviewitemrules.columns[2].caption 383 msgid "Action" 384 msgstr "Akce" 385 386 #: tformimportformat.listviewitemrules.columns[3].caption 387 msgid "Variable" 388 msgstr "Proměnná" 389 390 #: tformimportformat.listviewitemrules.columns[4].caption 391 msgctxt "tformimportformat.listviewitemrules.columns[4].caption" 392 msgid "Repetition" 393 msgstr "Opakování" 394 395 #: tformimportformats.aadd.caption 396 msgctxt "tformimportformats.aadd.caption" 397 msgid "Add" 398 msgstr "Přidat" 399 400 #: tformimportformats.amodify.caption 401 msgctxt "tformimportformats.amodify.caption" 402 msgid "Modify" 403 msgstr "Upravit" 404 405 #: tformimportformats.aremove.caption 406 msgctxt "tformimportformats.aremove.caption" 407 msgid "Remove" 408 msgstr "Odebrat" 409 410 #: tformimportformats.caption 411 msgctxt "tformimportformats.caption" 412 msgid "Import formats" 413 msgstr "Formáty importu" 414 415 #: tformimportformats.listview1.columns[0].caption 416 msgctxt "tformimportformats.listview1.columns[0].caption" 417 msgid "Name" 418 msgstr "Název" 419 260 420 #: tformimportpattern.buttoncancel.caption 261 421 msgctxt "tformimportpattern.buttoncancel.caption" … … 279 439 #: tformimportpattern.label10.caption 280 440 msgid "Action:" 281 msgstr "Akce "441 msgstr "Akce:" 282 442 283 443 #: tformimportpattern.label11.caption 284 444 msgid "Variable:" 285 msgstr "Proměnná "445 msgstr "Proměnná:" 286 446 287 447 #: tformimportpattern.label8.caption 288 448 msgctxt "tformimportpattern.label8.caption" 289 449 msgid "Start string:" 290 msgstr "Počáteční řetězec "450 msgstr "Počáteční řetězec:" 291 451 292 452 #: tformimportpattern.label9.caption 293 453 msgctxt "tformimportpattern.label9.caption" 294 454 msgid "End string:" 295 msgstr "Koncový řetězec "455 msgstr "Koncový řetězec:" 296 456 297 457 #: tformimportsource.acategoryadd.caption -
trunk/Languages/AcronymDecoder.po
r203 r204 118 118 msgstr "" 119 119 120 #: tformcategories.aadd.caption 121 msgctxt "tformcategories.aadd.caption" 122 msgid "Add" 123 msgstr "" 124 125 #: tformcategories.adisable.caption 126 msgctxt "tformcategories.adisable.caption" 127 msgid "Disable" 128 msgstr "" 129 130 #: tformcategories.aenable.caption 131 msgctxt "tformcategories.aenable.caption" 132 msgid "Enable" 133 msgstr "" 134 135 #: tformcategories.amodify.caption 136 msgctxt "tformcategories.amodify.caption" 137 msgid "Modify" 138 msgstr "" 139 140 #: tformcategories.aremove.caption 141 msgctxt "tformcategories.aremove.caption" 142 msgid "Remove" 143 msgstr "" 144 145 #: tformcategories.aselectall.caption 146 msgctxt "tformcategories.aselectall.caption" 147 msgid "Select all" 148 msgstr "" 149 150 #: tformcategories.caption 151 msgid "Acronym categories" 152 msgstr "" 153 154 #: tformcategories.listviewcategories.columns[0].caption 155 msgctxt "tformcategories.listviewcategories.columns[0].caption" 156 msgid "Name" 157 msgstr "" 158 159 #: tformcategories.listviewcategories.columns[1].caption 160 msgid "Used count" 161 msgstr "" 162 163 #: tformcategoryselect.buttoncancel.caption 164 msgctxt "tformcategoryselect.buttoncancel.caption" 165 msgid "Cancel" 166 msgstr "" 167 168 #: tformcategoryselect.buttonok.caption 169 msgid "Select" 170 msgstr "" 171 172 #: tformcategoryselect.caption 173 msgid "Select categories" 174 msgstr "" 175 120 176 #: tformcheck.agotolocation.caption 121 177 msgctxt "tformcheck.agotolocation.caption" … … 248 304 msgstr "" 249 305 306 #: tformimportformat.aadd.caption 307 msgctxt "tformimportformat.aadd.caption" 308 msgid "Add" 309 msgstr "" 310 311 #: tformimportformat.amodify.caption 312 msgctxt "tformimportformat.amodify.caption" 313 msgid "Modify" 314 msgstr "" 315 316 #: tformimportformat.amovedown.caption 317 msgid "Move down" 318 msgstr "" 319 320 #: tformimportformat.amoveup.caption 321 msgid "Move up" 322 msgstr "" 323 324 #: tformimportformat.aremove.caption 325 msgctxt "tformimportformat.aremove.caption" 326 msgid "Remove" 327 msgstr "" 328 329 #: tformimportformat.buttoncancel.caption 330 msgctxt "tformimportformat.buttoncancel.caption" 331 msgid "Cancel" 332 msgstr "" 333 334 #: tformimportformat.buttonok.caption 335 msgctxt "tformimportformat.buttonok.caption" 336 msgid "Ok" 337 msgstr "" 338 339 #: tformimportformat.caption 340 msgid "Import format" 341 msgstr "" 342 343 #: tformimportformat.label1.caption 344 msgctxt "tformimportformat.label1.caption" 345 msgid "Name:" 346 msgstr "" 347 348 #: tformimportformat.label2.caption 349 msgid "Item rules:" 350 msgstr "" 351 352 #: tformimportformat.label3.caption 353 msgid "Type:" 354 msgstr "" 355 356 #: tformimportformat.label8.caption 357 msgid "Block start:" 358 msgstr "" 359 360 #: tformimportformat.label9.caption 361 msgid "Block end:" 362 msgstr "" 363 364 #: tformimportformat.listviewitemrules.columns[0].caption 365 msgid "Start string" 366 msgstr "" 367 368 #: tformimportformat.listviewitemrules.columns[1].caption 369 msgid "End string" 370 msgstr "" 371 372 #: tformimportformat.listviewitemrules.columns[2].caption 373 msgid "Action" 374 msgstr "" 375 376 #: tformimportformat.listviewitemrules.columns[3].caption 377 msgid "Variable" 378 msgstr "" 379 380 #: tformimportformat.listviewitemrules.columns[4].caption 381 msgctxt "tformimportformat.listviewitemrules.columns[4].caption" 382 msgid "Repetition" 383 msgstr "" 384 385 #: tformimportformats.aadd.caption 386 msgctxt "tformimportformats.aadd.caption" 387 msgid "Add" 388 msgstr "" 389 390 #: tformimportformats.amodify.caption 391 msgctxt "tformimportformats.amodify.caption" 392 msgid "Modify" 393 msgstr "" 394 395 #: tformimportformats.aremove.caption 396 msgctxt "tformimportformats.aremove.caption" 397 msgid "Remove" 398 msgstr "" 399 400 #: tformimportformats.caption 401 msgctxt "tformimportformats.caption" 402 msgid "Import formats" 403 msgstr "" 404 405 #: tformimportformats.listview1.columns[0].caption 406 msgctxt "tformimportformats.listview1.columns[0].caption" 407 msgid "Name" 408 msgstr "" 409 250 410 #: tformimportpattern.buttoncancel.caption 251 411 msgctxt "TFORMIMPORTPATTERN.BUTTONCANCEL.CAPTION" -
trunk/Packages/Common/Common.lpk
r181 r204 60 60 <Item5> 61 61 <Filename Value="UPrefixMultiplier.pas"/> 62 <HasRegisterProc Value="True"/> 62 63 <UnitName Value="UPrefixMultiplier"/> 63 64 </Item5> … … 144 145 <EnableI18NForLFM Value="True"/> 145 146 </i18n> 146 <RequiredPkgs Count=" 3">147 <RequiredPkgs Count="2"> 147 148 <Item1> 148 149 <PackageName Value="LCL"/> 149 150 </Item1> 150 151 <Item2> 151 <PackageName Value="TemplateGenerics"/>152 </Item2>153 <Item3>154 152 <PackageName Value="FCL"/> 155 153 <MinVersion Major="1" Valid="True"/> 156 </Item 3>154 </Item2> 157 155 </RequiredPkgs> 158 156 <UsageOptions> -
trunk/Packages/Common/Common.pas
r181 r204 20 20 begin 21 21 RegisterUnit('UDebugLog', @UDebugLog.Register); 22 RegisterUnit('UPrefixMultiplier', @UPrefixMultiplier.Register); 22 23 RegisterUnit('ULastOpenedList', @ULastOpenedList.Register); 23 24 RegisterUnit('UJobProgressView', @UJobProgressView.Register); -
trunk/Packages/Common/Languages/UJobProgressView.cs.po
r200 r204 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 1.8.8\n"12 "X-Generator: Poedit 2.2\n" 13 13 14 14 #: ujobprogressview.sestimatedtime … … 24 24 msgstr "Dokončené" 25 25 26 #: ujobprogressview.soperations27 msgid "Operations:"28 msgstr ""29 30 26 #: ujobprogressview.spleasewait 31 27 msgid "Please wait..." -
trunk/Packages/Common/Languages/UJobProgressView.po
r200 r204 14 14 msgstr "" 15 15 16 #: ujobprogressview.soperations17 msgid "Operations:"18 msgstr ""19 20 16 #: ujobprogressview.spleasewait 21 17 msgid "Please wait..." -
trunk/Packages/Common/UCommon.pas
r200 r204 28 28 unfDNSDomainName = 11); 29 29 30 TFilterMethodMethod = function (FileName: string): Boolean of object; 30 TFilterMethod = function (FileName: string): Boolean of object; 31 TFileNameMethod = procedure (FileName: string) of object; 32 31 33 var 32 34 ExceptionHandler: TExceptionEvent; … … 74 76 procedure SaveStringToFile(S, FileName: string); 75 77 procedure SearchFiles(AList: TStrings; Dir: string; 76 FilterMethod: TFilterMethod Method = nil);78 FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil); 77 79 function GetStringPart(var Text: string; Separator: string): string; 78 80 function StripTags(const S: string): string; … … 81 83 function PosFromIndexReverse(SubStr: string; Text: string; 82 84 StartIndex: Integer): Integer; 85 procedure CopyStringArray(Dest: TStringArray; Source: array of string); 83 86 84 87 … … 108 111 I: Integer; 109 112 begin 113 Result := ''; 110 114 for I := 1 to Length(Source) do begin 111 115 Result := Result + LowerCase(IntToHex(Ord(Source[I]), 2)); … … 543 547 544 548 procedure SearchFiles(AList: TStrings; Dir: string; 545 FilterMethod: TFilterMethod Method = nil);549 FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil); 546 550 var 547 551 SR: TSearchRec; … … 553 557 if (SR.Name = '.') or (SR.Name = '..') or (Assigned(FilterMethod) and (not FilterMethod(SR.Name) or 554 558 not FilterMethod(Copy(Dir, 3, Length(Dir)) + SR.Name))) then Continue; 559 if Assigned(FileNameMethod) then 560 FileNameMethod(Dir + SR.Name); 555 561 AList.Add(Dir + SR.Name); 556 562 if (SR.Attr and faDirectory) <> 0 then … … 654 660 end; 655 661 662 procedure CopyStringArray(Dest: TStringArray; Source: array of string); 663 var 664 I: Integer; 665 begin 666 SetLength(Dest, Length(Source)); 667 for I := 0 to Length(Dest) - 1 do 668 Dest[I] := Source[I]; 669 end; 670 656 671 657 672 initialization -
trunk/Packages/Common/UDebugLog.pas
r181 r204 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, SpecializedList, SyncObjs;8 Classes, SysUtils, FileUtil, fgl, SyncObjs; 9 9 10 10 type … … 29 29 procedure SetMaxCount(const AValue: Integer); 30 30 public 31 Items: T ListObject;31 Items: TFPGObjectList<TDebugLogItem>; 32 32 Lock: TCriticalSection; 33 33 procedure Add(Text: string; Group: string = ''); … … 117 117 begin 118 118 inherited; 119 Items := T ListObject.Create;119 Items := TFPGObjectList<TDebugLogItem>.Create; 120 120 Lock := TCriticalSection.Create; 121 121 MaxCount := 100; -
trunk/Packages/Common/UJobProgressView.lfm
r200 r204 15 15 OnShow = FormShow 16 16 Position = poScreenCenter 17 LCLVersion = ' 1.8.2.0'17 LCLVersion = '2.0.2.0' 18 18 object PanelOperationsTitle: TPanel 19 19 Left = 0 … … 241 241 Interval = 100 242 242 OnTimer = TimerUpdateTimer 243 left = 264243 left = 320 244 244 top = 8 245 245 end -
trunk/Packages/Common/UJobProgressView.pas
r200 r204 175 175 STotalEstimatedTime = 'Total estimated time: %s'; 176 176 SFinished = 'Finished'; 177 SOperations = 'Operations:';178 177 179 178 procedure Register; -
trunk/Packages/Common/UListViewSort.pas
r181 r204 9 9 uses 10 10 {$IFDEF Windows}Windows, CommCtrl, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils, 11 Controls, DateUtils, Dialogs, SpecializedList, Forms, Grids, StdCtrls, ExtCtrls,11 Controls, DateUtils, Dialogs, fgl, Forms, Grids, StdCtrls, ExtCtrls, 12 12 LclIntf, LMessages, LclType, LResources; 13 13 … … 52 52 {$ENDIF} 53 53 public 54 List: T ListObject;55 Source: T ListObject;54 List: TFPGObjectList<TObject>; 55 Source: TFPGObjectList<TObject>; 56 56 constructor Create(AOwner: TComponent); override; 57 57 destructor Destroy; override; … … 98 98 end; 99 99 100 { TListViewEx } 101 102 TListViewEx = class(TWinControl) 103 private 104 FFilter: TListViewFilter; 105 FListView: TListView; 106 FListViewSort: TListViewSort; 107 procedure ResizeHanlder; 108 public 109 constructor Create(TheOwner: TComponent); override; 110 destructor Destroy; override; 111 published 112 property ListView: TListView read FListView write FListView; 113 property ListViewSort: TListViewSort read FListViewSort write FListViewSort; 114 property Filter: TListViewFilter read FFilter write FFilter; 115 property Visible; 116 end; 117 100 118 procedure Register; 101 119 … … 105 123 procedure Register; 106 124 begin 107 RegisterComponents('Common', [TListViewSort, TListViewFilter]); 125 RegisterComponents('Common', [TListViewSort, TListViewFilter, TListViewEx]); 126 end; 127 128 { TListViewEx } 129 130 procedure TListViewEx.ResizeHanlder; 131 begin 132 end; 133 134 constructor TListViewEx.Create(TheOwner: TComponent); 135 begin 136 inherited Create(TheOwner); 137 Filter := TListViewFilter.Create(Self); 138 Filter.Parent := Self; 139 Filter.Align := alBottom; 140 ListView := TListView.Create(Self); 141 ListView.Parent := Self; 142 ListView.Align := alClient; 143 ListViewSort := TListViewSort.Create(Self); 144 ListViewSort.ListView := ListView; 145 end; 146 147 destructor TListViewEx.Destroy; 148 begin 149 inherited Destroy; 108 150 end; 109 151 … … 277 319 end; 278 320 321 var 322 ListViewSortCompare: TCompareEvent; 323 324 function ListViewCompare(const Item1, Item2: TObject): Integer; 325 begin 326 Result := ListViewSortCompare(Item1, Item2); 327 end; 328 279 329 procedure TListViewSort.Sort(Compare: TCompareEvent); 280 330 begin 331 // TODO: Because TFLGObjectList compare handler is not class method, 332 // it is necessary to use simple function compare handler with local variable 333 ListViewSortCompare := Compare; 281 334 if (List.Count > 0) then 282 List.Sort( Compare);335 List.Sort(ListViewCompare); 283 336 end; 284 337 … … 343 396 begin 344 397 inherited; 345 List := T ListObject.Create;346 List. OwnsObjects := False;398 List := TFPGObjectList<TObject>.Create; 399 List.FreeObjects := False; 347 400 end; 348 401 -
trunk/Packages/Common/UMemory.pas
r200 r204 112 112 procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory); 113 113 begin 114 Move(Memory.FData, PByte( @FData+ Position)^, Memory.Size);114 Move(Memory.FData, PByte(PByte(@FData) + Position)^, Memory.Size); 115 115 end; 116 116 117 117 procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory); 118 118 begin 119 Move(PByte( @FData+ Position)^, Memory.FData, Memory.Size);119 Move(PByte(PByte(@FData) + Position)^, Memory.FData, Memory.Size); 120 120 end; 121 121 -
trunk/Packages/Common/UPool.pas
r3 r204 6 6 7 7 uses 8 Classes, SysUtils, syncobjs, SpecializedList, UThreading;8 Classes, SysUtils, syncobjs, fgl, UThreading; 9 9 10 10 type … … 22 22 function NewItemObject: TObject; virtual; 23 23 public 24 Items: T ListObject;25 FreeItems: T ListObject;24 Items: TFPGObjectList<TObject>; 25 FreeItems: TFPGObjectList<TObject>; 26 26 function Acquire: TObject; virtual; 27 27 procedure Release(Item: TObject); virtual; … … 185 185 begin 186 186 inherited; 187 Items := T ListObject.Create;188 FreeItems := T ListObject.Create;189 FreeItems. OwnsObjects := False;187 Items := TFPGObjectList<TObject>.Create; 188 FreeItems := TFPGObjectList<TObject>.Create; 189 FreeItems.FreeObjects := False; 190 190 FReleaseEvent := TEvent.Create(nil, False, False, ''); 191 191 end; -
trunk/Packages/Common/UPrefixMultiplier.pas
r3 r204 21 21 { TPrefixMultiplier } 22 22 23 TPrefixMultiplier = class 23 TPrefixMultiplier = class(TComponent) 24 24 private 25 function TruncateDigits(Value: Double;Digits:Integer=3):Double;25 function TruncateDigits(Value: Double; Digits: Integer = 3): Double; 26 26 public 27 27 function Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef; … … 72 72 ); 73 73 74 procedure Register; 75 76 74 77 implementation 78 79 procedure Register; 80 begin 81 RegisterComponents('Common', [TPrefixMultiplier]); 82 end; 75 83 76 84 { TPrefixMultiplier } … … 92 100 end; 93 101 94 function TPrefixMultiplier.Add(Value: Double;PrefixMultipliers:TPrefixMultiplierDef95 ; UnitText:string;Digits:Integer):string;102 function TPrefixMultiplier.Add(Value: Double; PrefixMultipliers: TPrefixMultiplierDef 103 ; UnitText:string; Digits: Integer): string; 96 104 var 97 105 I: Integer; -
trunk/Packages/Common/URegistry.pas
r169 r204 29 29 procedure SetCurrentContext(AValue: TRegistryContext); 30 30 public 31 function ReadChar(const Name: string): Char; 32 procedure WriteChar(const Name: string; Value: Char); 31 33 function ReadBoolWithDefault(const Name: string; 32 34 DefaultValue: Boolean): Boolean; 33 35 function ReadIntegerWithDefault(const Name: string; DefaultValue: Integer): Integer; 34 36 function ReadStringWithDefault(const Name: string; DefaultValue: string): string; 37 function ReadCharWithDefault(const Name: string; DefaultValue: Char): Char; 35 38 function ReadFloatWithDefault(const Name: string; 36 39 DefaultValue: Double): Double; … … 89 92 end; 90 93 94 function TRegistryEx.ReadCharWithDefault(const Name: string; DefaultValue: Char 95 ): Char; 96 begin 97 if ValueExists(Name) then Result := ReadChar(Name) 98 else begin 99 WriteChar(Name, DefaultValue); 100 Result := DefaultValue; 101 end; 102 end; 103 91 104 function TRegistryEx.ReadFloatWithDefault(const Name: string; 92 105 DefaultValue: Double): Double; … … 137 150 end; 138 151 152 function TRegistryEx.ReadChar(const Name: string): Char; 153 var 154 S: string; 155 begin 156 S := ReadString(Name); 157 if Length(S) > 0 then Result := S[1] 158 else Result := #0; 159 end; 160 161 procedure TRegistryEx.WriteChar(const Name: string; Value: Char); 162 begin 163 WriteString(Name, Value); 164 end; 165 139 166 function TRegistryEx.ReadBoolWithDefault(const Name: string; 140 167 DefaultValue: Boolean): Boolean; -
trunk/Packages/CoolTranslator/UCoolTranslator.pas
r203 r204 200 200 PropInfo: PPropInfo; 201 201 PropList: PPropList; 202 Excludes: TComponentExcludes;203 202 begin 204 203 Count := GetTypeData(Component.ClassInfo)^.PropCount; … … 253 252 if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then 254 253 //if not IsExcluded(Component, PropInfo^.Name) then 255 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo)));254 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, string(GetWideStrProp(Component, PropInfo)))); 256 255 end; 257 256 tkClass: begin … … 415 414 Lang := ParamStr(i + 1); 416 415 end; 417 if Lang = '' then 416 if Lang = '' then begin 417 T := ''; 418 418 LazGetLanguageIDs(Lang, T); 419 end; 419 420 420 421 if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin … … 432 433 function TCoolTranslator.FindLocaleFileName(LCExt: string): string; 433 434 var 434 T: string;435 435 Lang: string; 436 436 begin -
trunk/Packages/TemplateGenerics/Generic/GenericMatrix.inc
r3 r204 23 23 function GetItem(Index: TIndex): TGMatrixItem; 24 24 function GetCapacity: TIndex; 25 function GetLast: TGMatrixItem;26 function GetFirst: TGMatrixItem;27 25 procedure SetCapacity(const AValue: TIndex); 28 procedure SetLast(AValue: TGMatrixItem);29 procedure SetFirst(AValue: TGMatrixItem);30 26 procedure PutItemXY(X: TGMatrixIndexX; Y: TGMatrixIndexY; const AValue: TGMatrixItem); virtual; 31 27 procedure PutItem(Index: TIndex; const AValue: TGMatrixItem); virtual; 32 28 procedure SetCount(const AValue: TIndex); 33 29 public 34 function Add(Item: TGMatrixItem): TIndex;35 procedure AddMatrix(Values: array of TRow);36 procedure AddList(List: TGMatrix);37 30 procedure Assign(Source: TGMatrix); 38 31 procedure Clear; virtual; 39 32 procedure Contract; 40 33 function CreateIndex(X: TGMatrixIndexY; Y: TGMatrixIndexX): TIndex; 41 procedure Delete(Index: TIndex); virtual;42 procedure DeleteItems(Index, Count: TIndex);43 function EqualTo(List: TGMatrix): Boolean;44 34 procedure Expand; 45 function Extract(Item: TGMatrixItem): TGMatrixItem;46 35 procedure Exchange(Index1, Index2: TIndex); 47 property First: TGMatrixItem read GetFirst write SetFirst;48 36 procedure FillAll(Value: TGMatrixItem); 49 37 procedure Fill(Start, Count: TIndex; Value: TGMatrixItem); 50 38 function Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string; 51 procedure Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);52 function IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex;53 function IndexOfList(List: TGMatrix; Start: TIndex): TIndex;54 procedure Insert(Index: TIndex; Item: TGMatrixItem);55 procedure InsertList(Index: TIndex; List: TGMatrix);56 procedure InsertArray(Index: TIndex; Values: array of TGMatrixItem);57 procedure Move(CurIndex, NewIndex: TIndex);58 procedure MoveItems(CurIndex, NewIndex, Count: TIndex);59 39 procedure Merge(Index: TIndex; Source: TGMatrix; Proc: TMerge); 60 40 procedure Replace(Index: TIndex; Source: TGMatrix); 61 function Remove(Item: TGMatrixItem): TIndex;62 41 procedure Reverse; 63 42 procedure ReverseHorizontal; 64 43 procedure ReverseVertical; 65 procedure Sort(Compare: TSortCompare);66 procedure SetArray(Values: array of TGMatrixItem);67 44 property Count: TIndex read FCount write SetCount; 68 45 property Capacity: TIndex read GetCapacity write SetCapacity; … … 71 48 property Items[Index: TIndex]: TGMatrixItem 72 49 read GetItem write PutItem; 73 property Last: TGMatrixItem read GetLast write SetLast;74 50 end; 75 51 … … 78 54 79 55 {$IFDEF IMPLEMENTATION_USES} 80 81 uses82 RtlConsts;83 56 84 57 resourcestring … … 137 110 138 111 procedure TGMatrix.SetCapacity(const AValue: TIndex); 139 var140 Y: TGMatrixIndexY;141 112 begin 142 113 if (Capacity.X <> AValue.X) and (Capacity.Y <> AValue.Y) then begin 143 (* SetLength(FItems, AValue.Y);144 Y := 0;145 while Y < Length(FItems) do begin146 SetLength(FItems[Y], AValue.X);147 Y := Y + 1;148 end;149 end;150 *)151 114 SetLength(FItems, AValue.Y, AValue.X); 152 115 end; … … 244 207 end; 245 208 246 function TGMatrix.Extract(Item: TGMatrixItem): TGMatrixItem;247 var248 I: TIndex;249 begin250 (* I := IndexOf(Item);251 if I >= 0 then begin252 Result := Item;253 Delete(I);254 end else255 raise EListError.CreateFmt(SListIndexError, [0]);256 *)257 end;258 259 function TGMatrix.IndexOf(Item: TGMatrixItem; Start: TIndex): TIndex;260 begin261 (* Result := Start;262 while (Result < FCount) and263 not CompareMem(Addr(FItems[Result]), Addr(Item), SizeOf(TGMatrixItem)) do264 Result := Result + 1;265 if Result = FCount then Result := -1;266 *)267 end;268 269 procedure TGMatrix.Insert(Index: TIndex; Item: TGMatrixItem);270 begin271 (* if (Index < 0) or (Index > FCount ) then272 raise EListError.CreateFmt(SListIndexError, [Index]);273 if FCount = Capacity then Expand;274 if Index < FCount then275 System.Move(FItems[Index], FItems[Index + 1], (FCount - Index) * SizeOf(TGMatrixItem));276 FItems[Index] := Item;277 FCount := FCount + 1;278 *)279 end;280 281 procedure TGMatrix.InsertList(Index: TIndex; List: TGMatrix);282 var283 I: TIndex;284 begin285 (* I := 0;286 while (I < List.Count) do begin287 Insert(Index + I, List[I]);288 I := I + 1;289 end;290 *)291 end;292 293 function TGMatrix.IndexOfList(List: TGMatrix; Start: TIndex): TIndex;294 var295 I: TIndex;296 begin297 (* if List.Count > 0 then begin298 Result := IndexOf(List[0], Start);299 if Result <> -1 then begin300 I := 1;301 while I < List.Count do begin302 if not CompareMem(Addr(FItems[Result + I]), Addr(List.FItems[I]), SizeOf(TGMatrixItem)) then begin303 Result := -1;304 Break;305 end;306 I := I + 1;307 end;308 end;309 end else Result := -1;310 *)311 end;312 313 function TGMatrix.GetLast: TGMatrixItem;314 begin315 (* if FCount = 0 then316 raise EListError.CreateFmt(SListIndexError, [0])317 else318 Result := Items[FCount - 1];319 *)320 end;321 322 procedure TGMatrix.SetLast(AValue: TGMatrixItem);323 begin324 (* if FCount = 0 then325 raise EListError.CreateFmt(SListIndexError, [0])326 else327 Items[FCount - 1] := AValue;328 *)329 end;330 331 function TGMatrix.GetFirst: TGMatrixItem;332 begin333 (* if FCount = 0 then334 raise EListError.CreateFmt(SListIndexError, [0])335 else336 Result := Items[0];337 *)338 end;339 340 procedure TGMatrix.SetFirst(AValue: TGMatrixItem);341 begin342 (* if FCount = 0 then343 raise EListError.CreateFmt(SListIndexError, [0])344 else345 Items[0] := AValue;346 *)347 end;348 349 procedure TGMatrix.Move(CurIndex, NewIndex: TIndex);350 var351 Temp: TGMatrixItem;352 begin353 (* if ((CurIndex < 0) or (CurIndex > Count - 1)) then354 raise EListError.CreateFmt(SListIndexError, [CurIndex]);355 if ((NewIndex < 0) or (NewIndex > Count -1)) then356 raise EListError.CreateFmt(SlistIndexError, [NewIndex]);357 Temp := FItems[CurIndex];358 if NewIndex > CurIndex then begin359 System.Move(FItems[CurIndex + 1], FItems[CurIndex], (NewIndex - CurIndex) * SizeOf(TGMatrixItem));360 end else361 if NewIndex < CurIndex then begin362 System.Move(FItems[NewIndex], FItems[NewIndex + 1], (CurIndex - NewIndex) * SizeOf(TGMatrixItem));363 end;364 FItems[NewIndex] := Temp;365 //Delete(CurIndex);366 //Insert(NewIndex, Temp);*)367 end;368 369 procedure TGMatrix.MoveItems(CurIndex, NewIndex, Count: TIndex);370 var371 S: Integer;372 D: Integer;373 begin374 (* if CurIndex < NewIndex then begin375 S := CurIndex + Count - 1;376 D := NewIndex + Count - 1;377 while S >= CurIndex do begin378 Move(S, D);379 S := S - 1;380 D := D - 1;381 end;382 end else383 if CurIndex > NewIndex then begin384 S := CurIndex;385 D := NewIndex;386 while S < (CurIndex + Count) do begin387 Move(S, D);388 S := S + 1;389 D := D + 1;390 end;391 end;*)392 end;393 394 function TGMatrix.Remove(Item: TGMatrixItem): TIndex;395 begin396 (* Result := IndexOf(Item);397 if Result <> -1 then398 Delete(Result); *)399 end;400 401 function TGMatrix.EqualTo(List: TGMatrix): Boolean;402 var403 I: TIndex;404 begin405 (* Result := Count = List.Count;406 if Result then begin407 I := 0;408 while I < Count do begin409 if not CompareMem(Addr(FItems[I]), Addr(List.FItems[I]), SizeOf(TGMatrixItem)) then begin410 Result := False;411 Break;412 end;413 I := I + 1;414 end;415 end; *)416 end;417 418 209 procedure TGMatrix.Reverse; 419 210 var … … 464 255 end; 465 256 466 procedure TGMatrix.Sort(Compare: TSortCompare);467 begin468 (* if FCount > 1 then469 QuickSort(0, FCount - 1, Compare); *)470 end;471 472 procedure TGMatrix.AddMatrix(Values: array of TRow);473 var474 I: TIndex;475 begin476 (* I := 0;477 while I <= High(Values) do begin478 Add(Values[I]);479 I := I + 1;480 end; *)481 end;482 483 procedure TGMatrix.SetArray(Values: array of TGMatrixItem);484 var485 I: TIndex;486 begin487 (* Clear;488 I := 0;489 while I <= High(Values) do begin490 Add(Values[I]);491 I := I + 1;492 end; *)493 end;494 495 procedure TGMatrix.InsertArray(Index: TIndex; Values: array of TGMatrixItem);496 var497 I: TIndex;498 begin499 (* I := 0;500 while I <= High(Values) do begin501 Insert(Index + I, Values[I]);502 I := I + 1;503 end; *)504 end;505 506 257 function TGMatrix.Implode(RowSeparator, ColSeparator: string; Converter: TToStringConverter): string; 507 258 var … … 525 276 end; 526 277 527 procedure TGMatrix.Explode(Text, Separator: string; Converter: TFromStringConverter; SlicesCount: Integer = -1);528 begin529 (* Clear;530 while (Pos(Separator, Text) > 0) and531 ((Count < (SlicesCount - 1)) or (SlicesCount = -1)) do begin532 Add(Converter(Copy(Text, 1, Pos(Separator, Text) - 1)));533 System.Delete(Text, 1, Pos(Separator, Text) + Length(Separator) - 1);534 end;535 Add(Converter(Text)); *)536 end;537 538 function TGMatrix.Add(Item: TGMatrixItem): TIndex;539 begin540 (* if FCount = Capacity then541 Self.Expand;542 FItems[FCount] := Item;543 Result := FCount;544 FCount := FCount + 1; *)545 end;546 547 procedure TGMatrix.AddList(List: TGMatrix);548 var549 I: TIndex;550 begin551 (* I := 0;552 while I < List.Count do begin553 Add(List[I]);554 I := I + 1;555 end; *)556 end;557 558 278 procedure TGMatrix.Clear; 559 279 begin 560 280 Count := CreateIndex(0, 0); 561 281 Capacity := CreateIndex(0, 0); 562 end;563 564 procedure TGMatrix.Delete(Index: TIndex);565 begin566 (* if (Index < 0) or (Index >= FCount) then567 raise EListError.CreateFmt(SListIndexError, [Index]);568 FCount := FCount - 1;569 System.Move(FItems[Index + 1], FItems[Index], (FCount - Index) * SizeOf(TGMatrixItem));570 Contract;571 *)572 end;573 574 procedure TGMatrix.DeleteItems(Index, Count: TIndex);575 var576 I: TIndex;577 begin578 (* I := Index;579 while I < (Index + Count) do begin580 Delete(Index);581 I := I + 1;582 end;583 *)584 282 end; 585 283 -
trunk/Packages/TemplateGenerics/Specialized/SpecializedStream.pas
r3 r204 113 113 function TMemoryStreamByte.WriteBuffer(var Buffer; Count: Integer): Integer; 114 114 begin 115 115 Result := 0; 116 116 end; 117 117 … … 137 137 function TMemoryStreamByte.ReadBuffer(var Buffer; Count: Integer): Integer; 138 138 begin 139 139 Result := 0; 140 140 end; 141 141 … … 143 143 ): Integer; 144 144 begin 145 145 Result := 0; 146 146 end; 147 147 -
trunk/UAcronym.pas
r192 r204 7 7 uses 8 8 Classes, SysUtils, Contnrs, XMLRead, XMLWrite, DOM, UXMLUtils, 9 SpecializedList, fphttpclient2, Dialogs, odbcconn, sqldb, LazUTF8, 10 fgl; 9 fphttpclient2, Dialogs, odbcconn, sqldb, LazUTF8, fgl; 11 10 12 11 type … … 102 101 procedure AssignFromStrings(Strings: TStrings); 103 102 procedure AddFromStrings(Strings: TStrings); 104 procedure AssignToList(List: T ListObject);103 procedure AssignToList(List: TFPGObjectList<TObject>); 105 104 function GetString: string; 106 105 procedure UpdateLinkImportSources(Item: TImportSource); … … 215 214 procedure SaveToNode(Node: TDOMNode); 216 215 procedure LoadFromNode(Node: TDOMNode); 217 procedure AssignToList(List: T ListObject);216 procedure AssignToList(List: TFPGObjectList<TObject>); 218 217 end; 219 218 … … 244 243 procedure RemoveMeaning(Meaning: TAcronymMeaning); 245 244 procedure RemoveAcronym(AcronymName, MeaningName: string); 246 procedure AssignToList(List: T ListObject; EnabledCategoryOnly: Boolean = False);245 procedure AssignToList(List: TFPGObjectList<TObject>; EnabledCategoryOnly: Boolean = False); 247 246 procedure BeginUpdate; 248 247 procedure EndUpdate; … … 595 594 end; 596 595 597 procedure TImportSources.AssignToList(List: T ListObject);596 procedure TImportSources.AssignToList(List: TFPGObjectList<TObject>); 598 597 var 599 598 I: Integer; … … 1336 1335 end; 1337 1336 1338 procedure TAcronymCategories.AssignToList(List: T ListObject);1337 procedure TAcronymCategories.AssignToList(List: TFPGObjectList<TObject>); 1339 1338 var 1340 1339 I: Integer; … … 1747 1746 end; 1748 1747 1749 procedure TAcronymDb.AssignToList(List: T ListObject; EnabledCategoryOnly: Boolean = False);1748 procedure TAcronymDb.AssignToList(List: TFPGObjectList<TObject>; EnabledCategoryOnly: Boolean = False); 1750 1749 var 1751 1750 I: Integer; -
trunk/UCore.lfm
r203 r204 3476 3476 AppName = 'Acronym Decoder' 3477 3477 Description = 'A simple tool for quick searching of meaning for various acronyms and abbreviations.' 3478 ReleaseDate = 435 793478 ReleaseDate = 43591 3479 3479 RegistryKey = '\Software\' 3480 3480 RegistryRoot = rrKeyCurrentUser
Note:
See TracChangeset
for help on using the changeset viewer.