Changeset 441 for Generics/TemplateGenerics/Generic
- Timestamp:
- Nov 19, 2012, 2:47:07 PM (12 years ago)
- Location:
- Generics/TemplateGenerics/Generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/GenericFileList.inc
r426 r441 15 15 procedure SetFileName(const Value: string); 16 16 procedure SetMode(const Value: Word); 17 function GetOpenned: Boolean; 17 18 public 18 19 constructor Create; override; … … 22 23 property FileName: string read FFileName write SetFileName; 23 24 property Mode: Word read FMode write SetMode; 25 property Openned: Boolean read GetOpenned; 24 26 end; 25 27 … … 81 83 end; 82 84 85 function TGFileList.GetOpenned: Boolean; 86 begin 87 Result := FHandle <> feInvalidHandle; 88 end; 83 89 84 90 {$UNDEF IMPLEMENTATION} -
Generics/TemplateGenerics/Generic/GenericList.inc
r427 r441 39 39 procedure SetFirst(AValue: TGListItem); 40 40 procedure QuickSort(L, R : TGListIndex; Compare: TSortCompare); 41 procedure DoUpdate; 41 42 protected 42 43 procedure Put(Index: TGListIndex; const AValue: TGListItem); virtual; … … 109 110 begin 110 111 FCount := 0; 112 FUpdateCount := 0; 111 113 end; 112 114 … … 341 343 if (Index < 0) or (Index > FCount) then 342 344 raise EListError.CreateFmt(SListIndexError, [Index]); 343 InsertCount(Index, 1); 344 FItems[Index] := Item; 345 Update; 345 try 346 BeginUpdate; 347 InsertCount(Index, 1); 348 FItems[Index] := Item; 349 finally 350 EndUpdate; 351 end; 346 352 end; 347 353 … … 564 570 procedure TGList.EndUpdate; 565 571 begin 566 Dec(FUpdateCount); 567 Update; 572 if FUpdateCount > 0 then Dec(FUpdateCount); 573 if FUpdateCount = 0 then DoUpdate; 574 end; 575 576 procedure TGList.DoUpdate; 577 begin 578 if Assigned(FOnUpdate) then FOnUpdate(Self); 568 579 end; 569 580 570 581 procedure TGList.Update; 571 582 begin 572 if Assigned(FOnUpdate) and (FUpdateCount = 0) then FOnUpdate(Self);583 if FUpdateCount = 0 then DoUpdate; 573 584 end; 574 585 -
Generics/TemplateGenerics/Generic/GenericListObject.inc
r426 r441 88 88 end; 89 89 end; 90 I := FCount; 90 91 inherited; 92 // Nil newly allocated items 93 while I < AValue do begin 94 FItems[I] := nil; 95 I := I + 1; 96 end; 91 97 end; 92 98
Note:
See TracChangeset
for help on using the changeset viewer.